You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by he...@apache.org on 2006/11/13 23:55:14 UTC
svn commit: r474551 [28/49] - in
/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo:
./ src/ src/alg/ src/animation/ src/cal/ src/charting/ src/charting/svg/
src/charting/vml/ src/collections/ src/crypto/ src/data/ src/data/cs...
Modified: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/svg.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/svg.js?view=diff&rev=474551&r1=474550&r2=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/svg.js (original)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/svg.js Mon Nov 13 14:54:45 2006
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2004-2005, The Dojo Foundation
+ Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
@@ -9,78 +9,96 @@
*/
dojo.provide("dojo.svg");
-dojo.require("dojo.lang");
+dojo.require("dojo.lang.common");
dojo.require("dojo.dom");
-dojo.lang.mixin(dojo.svg, dojo.dom);
+dojo.mixin(dojo.svg, dojo.dom);
-/**
- * The Graphics object. Hopefully gives the user a way into
- * XPlatform rendering functions supported correctly and incorrectly.
-**/
-dojo.svg.graphics = dojo.svg.g = new function(d){
- this.suspend = function(){
+dojo.svg.graphics=dojo.svg.g=new function(/* DOMDocument */ d){
+ // summary
+ // Singleton to encapsulate SVG rendering functions.
+ this.suspend=function(){
+ // summary
+ // Suspend the rendering engine
try { d.documentElement.suspendRedraw(0); } catch(e){ }
};
- this.resume = function(){
+ this.resume=function(){
+ // summary
+ // Resume the rendering engine
try { d.documentElement.unsuspendRedraw(0); } catch(e){ }
};
- this.force = function(){
+ this.force=function(){
+ // summary
+ // Force the render engine to redraw
try { d.documentElement.forceRedraw(); } catch(e){ }
};
}(document);
-/**
- * The Animations control object. Hopefully gives the user a way into
- * XPlatform animation functions supported correctly and incorrectly.
-**/
-dojo.svg.animations = dojo.svg.anim = new function(d){
- this.arePaused = function(){
+dojo.svg.animations=dojo.svg.anim=new function(/* DOMDocument */ d){
+ // summary
+ // Singleton to encapsulate SVG animation functionality.
+ this.arePaused=function(){
+ // summary
+ // check to see if all animations are paused
try {
- return d.documentElement.animationsPaused();
+ return d.documentElement.animationsPaused(); // bool
} catch(e){
- return false;
+ return false; // bool
}
} ;
- this.pause = function(){
+ this.pause=function(){
+ // summary
+ // pause all animations
try { d.documentElement.pauseAnimations(); } catch(e){ }
};
- this.resume = function(){
+ this.resume=function(){
+ // summary
+ // resume all animations
try { d.documentElement.unpauseAnimations(); } catch(e){ }
};
}(document);
-/**
- * signatures from dojo.style.
- */
-dojo.svg.toCamelCase = function(selector){
- var arr = selector.split('-'), cc = arr[0];
- for(var i = 1; i < arr.length; i++) {
+// fixme: these functions should be mixed in from dojo.style, but dojo.style is HTML-centric and needs to change.
+dojo.svg.toCamelCase=function(/* string */ selector){
+ // summary
+ // converts a CSS-style selector to a camelCased one
+ var arr=selector.split('-'), cc=arr[0];
+ for(var i=1; i < arr.length; i++) {
cc += arr[i].charAt(0).toUpperCase() + arr[i].substring(1);
}
- return cc;
-};
-dojo.svg.toSelectorCase = function (selector) {
- return selector.replace(/([A-Z])/g, "-$1" ).toLowerCase() ;
+ return cc; // string
};
-dojo.svg.getStyle = function(node, cssSelector){
- return document.defaultView.getComputedStyle(node, cssSelector);
-};
-dojo.svg.getNumericStyle = function(node, cssSelector){
+dojo.svg.toSelectorCase=function(/* string */ selector) {
+ // summary
+ // converts a camelCased selector to a CSS style one
+ return selector.replace(/([A-Z])/g, "-$1" ).toLowerCase(); // string
+};
+dojo.svg.getStyle=function(/* SVGElement */ node, /* string */ cssSelector){
+ // summary
+ // get the computed style of selector for node.
+ return document.defaultView.getComputedStyle(node, cssSelector); // object
+};
+dojo.svg.getNumericStyle=function(/* SVGElement */ node, /* string */ cssSelector){
+ // summary
+ // return the numeric version of the computed style of selector on node.
return parseFloat(dojo.svg.getStyle(node, cssSelector));
};
-/**
- * alpha channel operations
- */
-dojo.svg.getOpacity = function(node){
- return Math.min(1.0, dojo.svg.getNumericStyle(node, "fill-opacity"));
-};
-dojo.svg.setOpacity = function(node, opacity){
+// fixme: there are different ways of doing the following, need to take into account
+dojo.svg.getOpacity=function(/* SVGElement */node){
+ // summary
+ // Return the opacity of the passed element
+ return Math.min(1.0, dojo.svg.getNumericStyle(node, "fill-opacity")); // float
+};
+dojo.svg.setOpacity=function(/* SVGElement */ node, /* float */ opacity){
+ // summary
+ // set the opacity of node using attributes.
node.setAttributeNS(this.xmlns.svg, "fill-opacity", opacity);
node.setAttributeNS(this.xmlns.svg, "stroke-opacity", opacity);
};
-dojo.svg.clearOpacity = function(node){
+dojo.svg.clearOpacity=function(/* SVGElement */ node){
+ // summary
+ // Set any attributes setting opacity to opaque (1.0)
node.setAttributeNS(this.xmlns.svg, "fill-opacity", "1.0");
node.setAttributeNS(this.xmlns.svg, "stroke-opacity", "1.0");
};
@@ -88,105 +106,137 @@
/**
* Coordinates and dimensions.
*/
-dojo.svg.getCoords = function(node){
+
+// TODO ////////////////////////////////////////////////////////// TODO
+dojo.svg.getCoords=function(/* SVGElement */ node){
+ // summary
+ // Returns the x/y coordinates of the passed node, if available.
if (node.getBBox) {
- var box = node.getBBox();
- return { x: box.x, y: box.y };
+ var box=node.getBBox();
+ return { x: box.x, y: box.y }; // object
}
- return null;
+ return null; // object
};
-dojo.svg.setCoords = function(node, coords){
- var p = dojo.svg.getCoords();
+dojo.svg.setCoords=function(/* SVGElement */node, /* object */coords){
+ // summary
+ // Set the x/y coordinates of the passed node
+ var p=dojo.svg.getCoords();
if (!p) return;
- var dx = p.x - coords.x;
- var dy = p.y - coords.y;
+ var dx=p.x - coords.x;
+ var dy=p.y - coords.y;
dojo.svg.translate(node, dx, dy);
};
-dojo.svg.getDimensions = function(node){
+dojo.svg.getDimensions=function(/* SVGElement */node){
+ // summary
+ // Get the height and width of the passed node.
if (node.getBBox){
- var box = node.getBBox();
- return { width: box.width, height : box.height };
+ var box=node.getBBox();
+ return { width: box.width, height : box.height }; // object
}
- return null;
+ return null; // object
};
-dojo.svg.setDimensions = function(node, dim){
+dojo.svg.setDimensions=function(/* SVGElement */node, /* object */dim){
+ // summary
+ // Set the dimensions of the passed element if possible.
// will only support shape-based and container elements; path-based elements are ignored.
if (node.width){
- node.width.baseVal.value = dim.width;
- node.height.baseVal.vaule = dim.height;
+ node.width.baseVal.value=dim.width;
+ node.height.baseVal.value=dim.height;
}
else if (node.r){
- node.r.baseVal.value = Math.min(dim.width, dim.height)/2;
+ node.r.baseVal.value=Math.min(dim.width, dim.height)/2;
}
else if (node.rx){
- node.rx.baseVal.value = dim.width/2;
- node.ry.baseVal.value = dim.height/2;
+ node.rx.baseVal.value=dim.width/2;
+ node.ry.baseVal.value=dim.height/2;
}
};
/**
* Transformations.
*/
-dojo.svg.translate = function(node, dx, dy){
+dojo.svg.translate=function(/* SVGElement */node, /* int */dx, /* int */dy){
+ // summary
+ // Translates the passed node by dx and dy
if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform){
- var t = node.ownerSVGElement.createSVGTransform();
+ var t=node.ownerSVGElement.createSVGTransform();
t.setTranslate(dx, dy);
node.transform.baseVal.appendItem(t);
}
};
-dojo.svg.scale = function(node, scaleX, scaleY){
- if (!scaleY) var scaleY = scaleX;
+dojo.svg.scale=function(/* SVGElement */node, /* float */scaleX, /* float? */scaleY){
+ // summary
+ // Scales the passed element by factor scaleX and scaleY. If scaleY not passed, scaleX is used.
+ if (!scaleY) var scaleY=scaleX;
if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform){
- var t = node.ownerSVGElement.createSVGTransform();
+ var t=node.ownerSVGElement.createSVGTransform();
t.setScale(scaleX, scaleY);
node.transform.baseVal.appendItem(t);
}
};
-dojo.svg.rotate = function(node, ang, cx, cy){
+dojo.svg.rotate=function(/* SVGElement */node, /* float */ang, /* int? */cx, /* int? */cy){
+ // summary
+ // rotate the passed node by ang, with optional cx/cy as the rotation point.
if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform){
- var t = node.ownerSVGElement.createSVGTransform();
- if (!cx) t.setMatrix(t.matrix.rotate(ang));
+ var t=node.ownerSVGElement.createSVGTransform();
+ if (cx == null) t.setMatrix(t.matrix.rotate(ang));
else t.setRotate(ang, cx, cy);
node.transform.baseVal.appendItem(t);
}
};
-dojo.svg.skew = function(node, ang, axis){
- var dir = axis || "x";
+dojo.svg.skew=function(/* SVGElement */node, /* float */ang, /* string? */axis){
+ // summary
+ // skew the passed node by ang over axis.
+ var dir=axis || "x";
if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform){
- var t = node.ownerSVGElement.createSVGTransform();
+ var t=node.ownerSVGElement.createSVGTransform();
if (dir != "x") t.setSkewY(ang);
else t.setSkewX(ang);
node.transform.baseVal.appendItem(t);
}
};
-dojo.svg.flip = function(node, axis){
- var dir = axis || "x";
+dojo.svg.flip=function(/* SVGElement */node, /* string? */axis){
+ // summary
+ // flip the passed element over axis
+ var dir=axis || "x";
if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform){
- var t = node.ownerSVGElement.createSVGTransform();
+ var t=node.ownerSVGElement.createSVGTransform();
t.setMatrix((dir != "x") ? t.matrix.flipY() : t.matrix.flipX());
node.transform.baseVal.appendItem(t);
}
};
-dojo.svg.invert = function(node){
+dojo.svg.invert=function(/* SVGElement */node){
+ // summary
+ // transform the passed node by the inverse of the current matrix
if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform){
- var t = node.ownerSVGElement.createSVGTransform();
+ var t=node.ownerSVGElement.createSVGTransform();
t.setMatrix(t.matrix.inverse());
node.transform.baseVal.appendItem(t);
}
};
-dojo.svg.applyMatrix = function(node, a, b, c, d, e, f){
+dojo.svg.applyMatrix=function(
+ /* SVGElement */node,
+ /* int || SVGMatrix */a,
+ /* int? */b,
+ /* int? */c,
+ /* int? */d,
+ /* int? */e,
+ /* int? */f
+){
+ // summary
+ // apply the passed matrix to node. If params b - f are passed, a matrix will be created.
if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform){
var m;
if (b){
- var m = node.ownerSVGElement.createSVGMatrix();
- m.a = a;
- m.b = b;
- m.c = c;
- m.d = d;
- m.e = e;
- m.f = f;
- } else m = a;
- var t = node.ownerSVGElement.createSVGTransform();
+ var m=node.ownerSVGElement.createSVGMatrix();
+ m.a=a;
+ m.b=b;
+ m.c=c;
+ m.d=d;
+ m.e=e;
+ m.f=f;
+ } else m=a;
+ var t=node.ownerSVGElement.createSVGTransform();
t.setMatrix(m);
node.transform.baseVal.appendItem(t);
}
@@ -195,83 +245,76 @@
/**
* Grouping and z-index operations.
*/
-dojo.svg.group = function(nodes){
+dojo.svg.group=function(/* Nodelist || array */nodes){
+ // summary
// expect an array of nodes, attaches the group to the parent of the first node.
- var p = nodes.item(0).parentNode;
- var g = document.createElementNS(this.xmlns.svg, "g");
- for (var i = 0; i < nodes.length; i++) g.appendChild(nodes.item(i));
+ var p=nodes.item(0).parentNode;
+ var g=document.createElementNS(this.xmlns.svg, "g");
+ for (var i=0; i < nodes.length; i++) g.appendChild(nodes.item(i));
p.appendChild(g);
return g;
};
-dojo.svg.ungroup = function(g){
+dojo.svg.ungroup=function(/* SVGGElement */g){
+ // summary
// puts the children of the group on the same level as group was.
- var p = g.parentNode;
+ var p=g.parentNode;
while (g.childNodes.length > 0) p.appendChild(g.childNodes.item(0));
p.removeChild(g);
};
// if the node is part of a group, return the group, else return null.
-dojo.svg.getGroup = function(node){
+dojo.svg.getGroup=function(/* SVGElement */node){
+ // summary
// if the node is part of a group, return the group, else return null.
- var a = this.getAncestors(node);
- for (var i = 0; i < a.length; i++){
+ var a=this.getAncestors(node);
+ for (var i=0; i < a.length; i++){
if (a[i].nodeType == this.ELEMENT_NODE && a[i].nodeName.toLowerCase() == "g")
return a[i];
}
return null;
};
-dojo.svg.bringToFront = function(node){
- var n = this.getGroup(node) || node;
+dojo.svg.bringToFront=function(/* SVGElement */node){
+ // summary
+ // move the passed node the to top of the group (i.e. last child)
+ var n=this.getGroup(node) || node;
n.ownerSVGElement.appendChild(n);
};
-dojo.svg.sendToBack = function(node){
- var n = this.getGroup(node) || node;
+dojo.svg.sendToBack=function(/* SVGElement */node){
+ // summary
+ // move the passed node to the bottom of the group (i.e. first child)
+ var n=this.getGroup(node) || node;
n.ownerSVGElement.insertBefore(n, n.ownerSVGElement.firstChild);
};
+
// TODO: possibly push node up a level in the DOM if it's at the beginning or end of the childNodes list.
-dojo.svg.bringForward = function(node){
- var n = this.getGroup(node) || node;
+dojo.svg.bringForward=function(/* SVGElement */node){
+ // summary
+ // move the passed node up one in the child node chain
+ var n=this.getGroup(node) || node;
if (this.getLastChildElement(n.parentNode) != n){
this.insertAfter(n, this.getNextSiblingElement(n), true);
}
};
-dojo.svg.sendBackward = function(node){
- var n = this.getGroup(node) || node;
+dojo.svg.sendBackward=function(/* SVGElement */node){
+ // summary
+ // move the passed node down one in the child node chain
+ var n=this.getGroup(node) || node;
if (this.getFirstChildElement(n.parentNode) != n){
this.insertBefore(n, this.getPreviousSiblingElement(n), true);
}
};
-// modded to account for FF 1.5 mixed environment, will try ASVG first, then w3 standard.
-dojo.dom.createNodesFromText = function (txt, wrap){
- var docFrag;
- if (window.parseXML) docFrag = parseXML(txt, window.document);
- else if (window.DOMParser) docFrag = (new DOMParser()).parseFromString(txt, "text/xml");
- else dojo.raise("dojo.dom.createNodesFromText: environment does not support XML parsing");
- docFrag.normalize();
+// END TODO ////////////////////////////////////////////////////// TODO
+
+dojo.svg.createNodesFromText=function(/* string */ txt, /* bool? */ wrap){
+ // summary
+ // Create a list of nodes from text
+ var docFrag=(new DOMParser()).parseFromString(txt, "text/xml").normalize();
if(wrap){
- var ret = [docFrag.firstChild.cloneNode(true)];
- return ret;
+ return [docFrag.firstChild.cloneNode(true)]; // array
}
- var nodes = [];
+ var nodes=[];
for(var x=0; x<docFrag.childNodes.length; x++){
nodes.push(docFrag.childNodes.item(x).cloneNode(true));
}
- // tn.style.display = "none";
- return nodes;
-}
-
-// FIXME: this should be removed after 0.2 release
-if(!dojo.evalObjPath("dojo.dom.createNodesFromText")) {
- dojo.dom.createNodesFromText = function() {
- dojo.deprecated("dojo.dom.createNodesFromText", "use dojo.svg.createNodesFromText instead");
- dojo.svg.createNodesFromText.apply(dojo.html, arguments);
- }
+ return nodes; // array
}
-
-// IE INLINE FIX
-/*
-if (dojo.render.html.ie && dojo.render.svg.adobe){
- document.write("<object id=\"AdobeSVG\" classid=\"clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2\"></object>");
- document.write("<?import namespace=\"svg\" urn=\"http://www.w3.org/2000/svg\" implementation=\"#AdobeSVG\"?>");
-}
-*/
// vim:ts=4:noet:tw=0:
Modified: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/text/__package__.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/text/__package__.js?view=diff&rev=474551&r1=474550&r2=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/text/__package__.js (original)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/text/__package__.js Mon Nov 13 14:54:45 2006
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2004-2005, The Dojo Foundation
+ Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
@@ -8,10 +8,11 @@
http://dojotoolkit.org/community/licensing.shtml
*/
-dojo.hostenv.conditionalLoadModule({
+dojo.kwCompoundRequire({
common: [
"dojo.text.String",
"dojo.text.Builder"
]
});
-dojo.hostenv.moduleLoaded("dojo.text.*");
+
+dojo.deprecated("dojo.text", "textDirectory moved to cal, text.String and text.Builder havne't been here for awhile", "0.5");
Modified: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/text/textDirectory.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/text/textDirectory.js?view=diff&rev=474551&r1=474550&r2=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/text/textDirectory.js (original)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/text/textDirectory.js Mon Nov 13 14:54:45 2006
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2004-2005, The Dojo Foundation
+ Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
@@ -8,74 +8,5 @@
http://dojotoolkit.org/community/licensing.shtml
*/
-dojo.provide("dojo.text.textDirectory");
-dojo.provide("dojo.text.textDirectory.Property");
-dojo.provide("dojo.text.textDirectory.tokenise");
-dojo.require("dojo.string");
-
-/* adapted from Paul Sowden's iCalendar work */
-
-dojo.textDirectoryTokeniser = function () {}
-
-/*
- * This class parses a single line from a text/directory file
- * and returns an object with four named values; name, group, params
- * and value. name, group and value are strings containing the original
- * tokens unaltered and values is an array containing name/value pairs
- * or a single name token packed into arrays.
- */
-dojo.textDirectoryTokeniser.Property = function (line) {
- // split into name/value pair
- var left = dojo.string.trim(line.substring(0, line.indexOf(':')));
- var right = dojo.string.trim(line.substr(line.indexOf(':') + 1));
-
- // seperate name and paramters
- var parameters = dojo.string.splitEscaped(left,';');
- this.name = parameters[0]
- parameters.splice(0, 1);
-
- // parse paramters
- this.params = [];
- for (var i = 0; i < parameters.length; i++) {
- var arr = parameters[i].split("=");
- var key = dojo.string.trim(arr[0].toUpperCase());
-
- if (arr.length == 1) { this.params.push([key]); continue; }
-
- var values = dojo.string.splitEscaped(arr[1],',');
- for (var j = 0; j < values.length; j++) {
- if (dojo.string.trim(values[j]) != '') {
- this.params.push([key, dojo.string.trim(values[j])]);
- }
- }
- }
-
- // seperate group
- if (this.name.indexOf('.') > 0) {
- var arr = this.name.split('.');
- this.group = arr[0];
- this.name = arr[1];
- }
-
- // don't do any parsing, leave to implementation
- this.value = right;
-}
-
-
-// tokeniser, parses into an array of properties.
-dojo.textDirectoryTokeniser.tokenise = function (text) {
- // normlize to one propterty per line and parse
- nText = dojo.string.normalizeNewlines(text,"\n");
- nText = nText.replace(/\n[ \t]/g, '');
- nText = nText.replace(/\x00/g, '');
-
- var lines = nText.split("\n");
- var properties = []
-
- for (var i = 0; i < lines.length; i++) {
- if (dojo.string.trim(lines[i]) == '') { continue; }
- var prop = new dojo.textDirectoryTokeniser.Property(lines[i]);
- properties.push(prop);
- }
- return properties;
-}
+dojo.require("dojo.cal.textDirectory");
+dojo.deprecate("dojo.text.textDirectory", "use dojo.cal.textDirectory", "0.5");
Modified: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/undo/Manager.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/undo/Manager.js?view=diff&rev=474551&r1=474550&r2=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/undo/Manager.js (original)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/undo/Manager.js Mon Nov 13 14:54:45 2006
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2004-2005, The Dojo Foundation
+ Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
@@ -9,83 +9,192 @@
*/
dojo.provide("dojo.undo.Manager");
+dojo.require("dojo.lang.common");
-dojo.undo.Manager = function () {
+dojo.undo.Manager = function(parent) {
+ this.clear();
+ this._parent = parent;
+};
+dojo.extend(dojo.undo.Manager, {
+ _parent: null,
+ _undoStack: null,
+ _redoStack: null,
+ _currentManager: null,
- this._undoStack = [];
- this._redoStack = [];
+ canUndo: false,
+ canRedo: false,
+
+ isUndoing: false,
+ isRedoing: false,
- this._undoRegistrationLevel = 0;
-}
+ // these events allow you to hook in and update your code (UI?) as necessary
+ onUndo: function(manager, item) {},
+ onRedo: function(manager, item) {},
+
+ // fired when you do *any* undo action, which means you'll have one for every item
+ // in a transaction. this is usually only useful for debugging
+ onUndoAny: function(manager, item) {},
+ onRedoAny: function(manager, item) {},
+
+ _updateStatus: function() {
+ this.canUndo = this._undoStack.length > 0;
+ this.canRedo = this._redoStack.length > 0;
+ },
-dojo.undo.Manager.prototype = {
+ clear: function() {
+ this._undoStack = [];
+ this._redoStack = [];
+ this._currentManager = this;
-//Registering undo operations
- //registerUndoWithTarget:selector:object:
- prepareWithInvocationTarget: function () {},
- forwardInvocation: function () {},
+ this.isUndoing = false;
+ this.isRedoing = false;
-//Checking undo ability
- canUndo: false,
- canRedo: false,
+ this._updateStatus();
+ },
+
+ undo: function() {
+ if(!this.canUndo) { return false; }
+
+ this.endAllTransactions();
-//Performing undo and redo
- undo: function () {},
- undoNestedGroup: function () {},
- redo: function () {},
+ this.isUndoing = true;
+ var top = this._undoStack.pop();
+ if(top instanceof dojo.undo.Manager){
+ top.undoAll();
+ }else{
+ top.undo();
+ }
+ if(top.redo){
+ this._redoStack.push(top);
+ }
+ this.isUndoing = false;
-//Limiting the undo stack
- setLevelsOfUndo: function (levels) {
- this.levelsOfUndo = levels;
- if (levels != 0 && this._undoStack.length > levels) {
- this._undoStack.splice(levels, this._undoStack.length - levels);
+ this._updateStatus();
+ this.onUndo(this, top);
+ if(!(top instanceof dojo.undo.Manager)) {
+ this.getTop().onUndoAny(this, top);
}
+ return true;
},
- levelsOfUndo: 0,
-//Creating undo groups
- beginUndoGrouping: function () {},
- endUndoGrouping: function () {},
- enableUndoRegistration: function () {
- if (++this._undoRegistrationLevel >= 0) {
- this._undoRegistrationLevel = 0;
- this.isUndoRegistrationEnabled = true;
+ redo: function() {
+ if(!this.canRedo){ return false; }
+
+ this.isRedoing = true;
+ var top = this._redoStack.pop();
+ if(top instanceof dojo.undo.Manager) {
+ top.redoAll();
+ }else{
+ top.redo();
+ }
+ this._undoStack.push(top);
+ this.isRedoing = false;
+
+ this._updateStatus();
+ this.onRedo(this, top);
+ if(!(top instanceof dojo.undo.Manager)){
+ this.getTop().onRedoAny(this, top);
}
+ return true;
},
- groupsByEvent: true,
- setGroupsByEvent: function (bool) { this.groupsByEvent = bool; },
- groupingLevel: 0,
-//Disabling undo
- disableUndoRegistration = function () {
- this.isUndoRegistrationEnabled = false;
- this._undoRegistrationLevel--;
+ undoAll: function() {
+ while(this._undoStack.length > 0) {
+ this.undo();
+ }
},
- isUndoRegistrationEnabled: true,
-//Checking whether undo or redo is being performed
- isUndoing: false,
- isRedoing: false,
+ redoAll: function() {
+ while(this._redoStack.length > 0) {
+ this.redo();
+ }
+ },
-//Clearing undo operations
- removeAllActions: function () {
- this._undoStack = [];
+ push: function(undo, redo /* optional */, description /* optional */) {
+ if(!undo) { return; }
+
+ if(this._currentManager == this) {
+ this._undoStack.push({
+ undo: undo,
+ redo: redo,
+ description: description
+ });
+ } else {
+ this._currentManager.push.apply(this._currentManager, arguments);
+ }
+ // adding a new undo-able item clears out the redo stack
this._redoStack = [];
+ this._updateStatus();
+ },
+
+ concat: function(manager) {
+ if ( !manager ) { return; }
+
+ if (this._currentManager == this ) {
+ for(var x=0; x < manager._undoStack.length; x++) {
+ this._undoStack.push(manager._undoStack[x]);
+ }
+ // adding a new undo-able item clears out the redo stack
+ if (manager._undoStack.length > 0) {
+ this._redoStack = [];
+ }
+ this._updateStatus();
+ } else {
+ this._currentManager.concat.apply(this._currentManager, arguments);
+ }
},
- removeAllActionsWithTarget: function (target) {},
-//Setting and getting the action name
- setActionName: function () {},
- redoActionName: null,
- undoActionName: null,
-
-//Getting and localizing menu item title
- redoMenuItemTitle: null,
- undoMenuItemTitle: null,
- redoMenuTitleForUndoActionName: function () {},
- undoMenuTitleForUndoActionName: function () {},
-
-//Working with run loops
- runLoopModes: [],
- setRunLoopModes: function () {}
-}
\ No newline at end of file
+ beginTransaction: function(description /* optional */) {
+ if(this._currentManager == this) {
+ var mgr = new dojo.undo.Manager(this);
+ mgr.description = description ? description : "";
+ this._undoStack.push(mgr);
+ this._currentManager = mgr;
+ return mgr;
+ } else {
+ //for nested transactions need to make sure the top level _currentManager is set
+ this._currentManager = this._currentManager.beginTransaction.apply(this._currentManager, arguments);
+ }
+ },
+
+ endTransaction: function(flatten /* optional */) {
+ if(this._currentManager == this) {
+ if(this._parent) {
+ this._parent._currentManager = this._parent;
+ // don't leave empty transactions hangin' around
+ if(this._undoStack.length == 0 || flatten) {
+ var idx = dojo.lang.find(this._parent._undoStack, this);
+ if (idx >= 0) {
+ this._parent._undoStack.splice(idx, 1);
+ //add the current transaction to parents undo stack
+ if (flatten) {
+ for(var x=0; x < this._undoStack.length; x++){
+ this._parent._undoStack.splice(idx++, 0, this._undoStack[x]);
+ }
+ this._updateStatus();
+ }
+ }
+ }
+ return this._parent;
+ }
+ } else {
+ //for nested transactions need to make sure the top level _currentManager is set
+ this._currentManager = this._currentManager.endTransaction.apply(this._currentManager, arguments);
+ }
+ },
+
+ endAllTransactions: function() {
+ while(this._currentManager != this) {
+ this.endTransaction();
+ }
+ },
+
+ // find the top parent of an undo manager
+ getTop: function() {
+ if(this._parent) {
+ return this._parent.getTop();
+ } else {
+ return this;
+ }
+ }
+});
Added: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/undo/__package__.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/undo/__package__.js?view=auto&rev=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/undo/__package__.js (added)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/undo/__package__.js Mon Nov 13 14:54:45 2006
@@ -0,0 +1,12 @@
+/*
+ Copyright (c) 2004-2006, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.require("dojo.undo.Manager");
+dojo.provide("dojo.undo.*");
Propchange: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/undo/__package__.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/undo/browser.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/undo/browser.js?view=auto&rev=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/undo/browser.js (added)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/undo/browser.js Mon Nov 13 14:54:45 2006
@@ -0,0 +1,309 @@
+/*
+ Copyright (c) 2004-2006, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.undo.browser");
+dojo.require("dojo.io.common");
+
+try{
+ if((!djConfig["preventBackButtonFix"])&&(!dojo.hostenv.post_load_)){
+ document.write("<iframe style='border: 0px; width: 1px; height: 1px; position: absolute; bottom: 0px; right: 0px; visibility: visible;' name='djhistory' id='djhistory' src='"+(dojo.hostenv.getBaseScriptUri()+'iframe_history.html')+"'></iframe>");
+ }
+}catch(e){/* squelch */}
+
+if(dojo.render.html.opera){
+ dojo.debug("Opera is not supported with dojo.undo.browser, so back/forward detection will not work.");
+}
+
+/* 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.
+ */
+
+dojo.undo.browser = {
+ initialHref: window.location.href,
+ initialHash: window.location.hash,
+
+ moveForward: false,
+ historyStack: [],
+ forwardStack: [],
+ historyIframe: null,
+ bookmarkAnchor: null,
+ locationTimer: null,
+
+ /**
+ * setInitialState sets the state object and back callback for the very first page that is loaded.
+ * It is recommended that you call this method as part of an event listener that is registered via
+ * dojo.addOnLoad().
+ */
+ setInitialState: function(args){
+ this.initialState = this._createState(this.initialHref, args, this.initialHash);
+ },
+
+ //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.
+ /**
+ * addToHistory takes one argument, and it is an object that defines the following functions:
+ * - 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
+ *
+ * Full example:
+ *
+ * dojo.undo.browser.addToHistory({
+ * back: function() { alert('back pressed'); },
+ * forward: function() { alert('forward pressed'); },
+ * changeUrl: true
+ * });
+ */
+ addToHistory: function(args){
+ //If addToHistory is called, then that means we prune the
+ //forward stack -- the user went back, then wanted to
+ //start a new forward path.
+ this.forwardStack = [];
+
+ var hash = null;
+ var url = null;
+ if(!this.historyIframe){
+ this.historyIframe = window.frames["djhistory"];
+ }
+ if(!this.bookmarkAnchor){
+ this.bookmarkAnchor = document.createElement("a");
+ dojo.body().appendChild(this.bookmarkAnchor);
+ this.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.undo.browser's behavior is the same in all browsers.
+ if(this.historyStack.length == 0 && this.initialState.urlHash == hash){
+ this.initialState = this._createState(url, args, hash);
+ return;
+ }else if(this.historyStack.length > 0 && this.historyStack[this.historyStack.length - 1].urlHash == hash){
+ this.historyStack[this.historyStack.length - 1] = this._createState(url, args, hash);
+ return;
+ }
+
+ this.changingUrl = true;
+ setTimeout("window.location.href = '"+hash+"'; dojo.undo.browser.changingUrl = false;", 1);
+ this.bookmarkAnchor.href = hash;
+
+ if(dojo.render.html.ie){
+ url = this._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(window.location.hash != ""){
+ setTimeout("window.location.href = '"+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(window.location.hash != ""){
+ window.location.href = 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.render.html.moz){
+ // start the timer
+ if(!this.locationTimer){
+ this.locationTimer = setInterval("dojo.undo.browser.checkLocation();", 200);
+ }
+ }
+ }else{
+ url = this._loadIframeHistory();
+ }
+
+ this.historyStack.push(this._createState(url, args, hash));
+ },
+
+ checkLocation: function(){
+ if (!this.changingUrl){
+ var hsl = this.historyStack.length;
+
+ if((window.location.hash == this.initialHash||window.location.href == this.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);
+ this.handleBackButton();
+ return;
+ }
+
+ // first check to see if we could have gone forward. We always halt on
+ // a no-hash item.
+ if(this.forwardStack.length > 0){
+ if(this.forwardStack[this.forwardStack.length-1].urlHash == window.location.hash){
+ this.handleForwardButton();
+ return;
+ }
+ }
+
+ // ok, that didn't work, try someplace back in the history stack
+ if((hsl >= 2)&&(this.historyStack[hsl-2])){
+ if(this.historyStack[hsl-2].urlHash==window.location.hash){
+ this.handleBackButton();
+ return;
+ }
+ }
+ }
+ },
+
+ iframeLoaded: function(evt, ifrLoc){
+ if(!dojo.render.html.opera){
+ var query = this._getUrlQuery(ifrLoc.href);
+ if(query == null){
+ // alert("iframeLoaded");
+ // we hit the end of the history, so we should go back
+ if(this.historyStack.length == 1){
+ this.handleBackButton();
+ }
+ return;
+ }
+ if(this.moveForward){
+ // we were expecting it, so it's not either a forward or backward movement
+ this.moveForward = false;
+ return;
+ }
+
+ //Check the back stack first, since it is more likely.
+ //Note that only one step back or forward is supported.
+ if(this.historyStack.length >= 2 && query == this._getUrlQuery(this.historyStack[this.historyStack.length-2].url)){
+ this.handleBackButton();
+ }
+ else if(this.forwardStack.length > 0 && query == this._getUrlQuery(this.forwardStack[this.forwardStack.length-1].url)){
+ this.handleForwardButton();
+ }
+ }
+ },
+
+ handleBackButton: function(){
+ //The "current" page is always at the top of the history stack.
+ var current = this.historyStack.pop();
+ if(!current){ return; }
+ var last = this.historyStack[this.historyStack.length-1];
+ if(!last && this.historyStack.length == 0){
+ last = this.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");
+ }
+ }
+ this.forwardStack.push(current);
+ },
+
+ handleForwardButton: function(){
+ var last = this.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");
+ }
+ this.historyStack.push(last);
+ },
+
+ _createState: function(url, args, hash){
+ return {"url": url, "kwArgs": args, "urlHash": hash};
+ },
+
+ _getUrlQuery: function(url){
+ var segments = url.split("?");
+ if (segments.length < 2){
+ return null;
+ }
+ else{
+ return segments[1];
+ }
+ },
+
+ _loadIframeHistory: function(){
+ var url = dojo.hostenv.getBaseScriptUri()+"iframe_history.html?"+(new Date()).getTime();
+ this.moveForward = true;
+ dojo.io.setIFrameSrc(this.historyIframe, url, false);
+ return url;
+ }
+}
Propchange: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/undo/browser.js
------------------------------------------------------------------------------
svn:eol-style = native
Modified: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uri/Uri.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uri/Uri.js?view=diff&rev=474551&r1=474550&r2=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uri/Uri.js (original)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uri/Uri.js Mon Nov 13 14:54:45 2006
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2004-2005, The Dojo Foundation
+ Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
@@ -11,23 +11,26 @@
dojo.provide("dojo.uri.Uri");
dojo.uri = new function() {
- this.joinPath = function() {
- // DEPRECATED: use the dojo.uri.Uri object instead
- var arr = [];
- for(var i = 0; i < arguments.length; i++) { arr.push(arguments[i]); }
- return arr.join("/").replace(/\/{2,}/g, "/").replace(/((https*|ftps*):)/i, "$1/");
+ this.dojoUri = function (/*dojo.uri.Uri||String*/uri) {
+ // summary: returns a Uri object resolved relative to the dojo root
+ return new dojo.uri.Uri(dojo.hostenv.getBaseScriptUri(), uri);
}
- this.dojoUri = function (uri) {
- // returns a Uri object resolved relative to the dojo root
- return new dojo.uri.Uri(dojo.hostenv.getBaseScriptUri(), uri);
+ this.moduleUri = function(/*String*/module, /*dojo.uri.Uri||String*/uri){
+ // summary: returns a Uri object relative to a (top-level) module
+ // description: Examples: dojo.uri.moduleUri("dojo","Editor"), or dojo.uri.moduleUri("acme","someWidget")
+ var loc = dojo.hostenv.getModulePrefix(module);
+ if(!loc){return null;}
+ if(loc.lastIndexOf("/") != loc.length-1){loc += "/";}
+ return new dojo.uri.Uri(dojo.hostenv.getBaseScriptUri()+loc,uri);
}
-
- this.Uri = function (/*uri1, uri2, [...]*/) {
- // An object representing a Uri.
- // Each argument is evaluated in order relative to the next until
- // a conanical uri is producued. To get an absolute Uri relative
- // to the current document use
+
+ this.Uri = function (/*dojo.uri.Uri||String...*/) {
+ // summary: Constructor to create an object representing a URI.
+ // description:
+ // Each argument is evaluated in order relative to the next until
+ // a canonical uri is produced. To get an absolute Uri relative
+ // to the current document use
// new dojo.uri.Uri(document.baseURI, uri)
// TODO: support for IPv6, see RFC 2732
@@ -41,8 +44,7 @@
var relobj = new dojo.uri.Uri(arguments[i].toString());
var uriobj = new dojo.uri.Uri(uri.toString());
- if (relobj.path == "" && relobj.scheme == null &&
- relobj.authority == null && relobj.query == null) {
+ if ((relobj.path=="")&&(relobj.scheme==null)&&(relobj.authority==null)&&(relobj.query==null)) {
if (relobj.fragment != null) { uriobj.fragment = relobj.fragment; }
relobj = uriobj;
} else if (relobj.scheme == null) {
@@ -84,7 +86,7 @@
// break the uri into its main components
var regexp = "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$";
- var r = this.uri.match(new RegExp(regexp));
+ var r = this.uri.match(new RegExp(regexp));
this.scheme = r[2] || (r[1] ? "" : null);
this.authority = r[4] || (r[3] ? "" : null);
Modified: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uri/__package__.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uri/__package__.js?view=diff&rev=474551&r1=474550&r2=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uri/__package__.js (original)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uri/__package__.js Mon Nov 13 14:54:45 2006
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2004-2005, The Dojo Foundation
+ Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
@@ -8,7 +8,7 @@
http://dojotoolkit.org/community/licensing.shtml
*/
-dojo.hostenv.conditionalLoadModule({
- common: ["dojo.uri.Uri", false, false]
+dojo.kwCompoundRequire({
+ common: [["dojo.uri.Uri", false, false]]
});
-dojo.hostenv.moduleLoaded("dojo.uri.*");
+dojo.provide("dojo.uri.*");
Added: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/LightweightGenerator.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/LightweightGenerator.js?view=auto&rev=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/LightweightGenerator.js (added)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/LightweightGenerator.js Mon Nov 13 14:54:45 2006
@@ -0,0 +1,73 @@
+/*
+ Copyright (c) 2004-2006, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.uuid.LightweightGenerator");
+
+/*
+ * summary:
+ * The LightweightGenerator is intended to be small and fast,
+ * but not necessarily good.
+ *
+ * description:
+ * Small: The LightweightGenerator has a small footprint.
+ * Once comments are stripped, it's only about 25 lines of
+ * code, and it doesn't dojo.require() any other packages.
+ *
+ * Fast: The LightweightGenerator can generate lots of new
+ * UUIDs fairly quickly (at least, more quickly than the other
+ * dojo UUID generators).
+ *
+ * Not necessarily good: We use Math.random() as our source
+ * of randomness, which may or may not provide much randomness.
+ */
+
+dojo.uuid.LightweightGenerator = new function() {
+ var HEX_RADIX = 16;
+
+ function _generateRandomEightCharacterHexString() {
+ // Make random32bitNumber be a randomly generated floating point number
+ // between 0 and (4,294,967,296 - 1), inclusive.
+ var random32bitNumber = Math.floor( (Math.random() % 1) * Math.pow(2, 32) );
+ var eightCharacterHexString = random32bitNumber.toString(HEX_RADIX);
+ while (eightCharacterHexString.length < 8) {
+ eightCharacterHexString = "0" + eightCharacterHexString;
+ }
+ return eightCharacterHexString; // for example: "3B12F1DF"
+ }
+
+ this.generate = function(/* constructor? */ returnType) {
+ // summary:
+ // This function generates random UUIDs, meaning "version 4" UUIDs.
+ // description:
+ // A typical generated value would be something like this:
+ // "3b12f1df-5232-4804-897e-917bf397618a"
+ // returnType: The type of object to return. Usually String or dojo.uuid.Uuid
+
+ // examples:
+ // var string = dojo.uuid.LightweightGenerator.generate();
+ // var string = dojo.uuid.LightweightGenerator.generate(String);
+ // var uuid = dojo.uuid.LightweightGenerator.generate(dojo.uuid.Uuid);
+ var hyphen = "-";
+ var versionCodeForRandomlyGeneratedUuids = "4"; // 8 == binary2hex("0100")
+ var variantCodeForDCEUuids = "8"; // 8 == binary2hex("1000")
+ var a = _generateRandomEightCharacterHexString();
+ var b = _generateRandomEightCharacterHexString();
+ b = b.substring(0, 4) + hyphen + versionCodeForRandomlyGeneratedUuids + b.substring(5, 8);
+ var c = _generateRandomEightCharacterHexString();
+ c = variantCodeForDCEUuids + c.substring(1, 4) + hyphen + c.substring(4, 8);
+ var d = _generateRandomEightCharacterHexString();
+ var returnValue = a + hyphen + b + hyphen + c + d;
+ returnValue = returnValue.toLowerCase();
+ if (returnType && (returnType != String)) {
+ returnValue = new returnType(returnValue);
+ }
+ return returnValue;
+ };
+}();
Propchange: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/LightweightGenerator.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/NameBasedGenerator.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/NameBasedGenerator.js?view=auto&rev=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/NameBasedGenerator.js (added)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/NameBasedGenerator.js Mon Nov 13 14:54:45 2006
@@ -0,0 +1,38 @@
+/*
+ Copyright (c) 2004-2006, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.uuid.NameBasedGenerator");
+
+dojo.uuid.NameBasedGenerator = new function() {
+ this.generate = function(/* constructor? */ returnType) {
+ // summary:
+ // This function generates name-based UUIDs, meaning "version 3"
+ // and "version 5" UUIDs.
+ // returnType: The type of object to return. Usually String or dojo.uuid.Uuid
+
+ // examples:
+ // var string = dojo.uuid.NameBasedGenerator.generate();
+ // var string = dojo.uuid.NameBasedGenerator.generate(String);
+ // var uuid = dojo.uuid.NameBasedGenerator.generate(dojo.uuid.Uuid);
+
+ dojo.unimplemented('dojo.uuid.NameBasedGenerator.generate');
+
+ // FIXME:
+ // For an algorithm to generate name-based UUIDs,
+ // see sections 4.3 of RFC 4122:
+ // http://www.ietf.org/rfc/rfc4122.txt
+
+ var returnValue = "00000000-0000-0000-0000-000000000000"; // FIXME
+ if (returnType && (returnType != String)) {
+ returnValue = new returnType(returnValue);
+ }
+ return returnValue; // object
+ };
+}();
\ No newline at end of file
Propchange: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/NameBasedGenerator.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/NilGenerator.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/NilGenerator.js?view=auto&rev=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/NilGenerator.js (added)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/NilGenerator.js Mon Nov 13 14:54:45 2006
@@ -0,0 +1,32 @@
+/*
+ Copyright (c) 2004-2006, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.uuid.NilGenerator");
+
+dojo.uuid.NilGenerator = new function() {
+ this.generate = function(/* constructor? */ returnType) {
+ // summary:
+ // This function returns the Nil UUID: "00000000-0000-0000-0000-000000000000".
+ // description:
+ // The Nil UUID is described in section 4.1.7 of
+ // RFC 4122: http://www.ietf.org/rfc/rfc4122.txt
+ // returnType: The type of object to return. Usually String or dojo.uuid.Uuid
+
+ // examples:
+ // var string = dojo.uuid.NilGenerator.generate();
+ // var string = dojo.uuid.NilGenerator.generate(String);
+ // var uuid = dojo.uuid.NilGenerator.generate(dojo.uuid.Uuid);
+ var returnValue = "00000000-0000-0000-0000-000000000000";
+ if (returnType && (returnType != String)) {
+ returnValue = new returnType(returnValue);
+ }
+ return returnValue; // object
+ };
+}();
\ No newline at end of file
Propchange: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/NilGenerator.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/RandomGenerator.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/RandomGenerator.js?view=auto&rev=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/RandomGenerator.js (added)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/RandomGenerator.js Mon Nov 13 14:54:45 2006
@@ -0,0 +1,39 @@
+/*
+ Copyright (c) 2004-2006, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.uuid.RandomGenerator");
+
+dojo.uuid.RandomGenerator = new function() {
+ this.generate = function(/* constructor? */ returnType) {
+ // summary:
+ // This function generates random UUIDs, meaning "version 4" UUIDs.
+ // description:
+ // A typical generated value would be something like this:
+ // "3b12f1df-5232-4804-897e-917bf397618a"
+ // returnType: The type of object to return. Usually String or dojo.uuid.Uuid
+
+ // examples:
+ // var string = dojo.uuid.RandomGenerator.generate();
+ // var string = dojo.uuid.RandomGenerator.generate(String);
+ // var uuid = dojo.uuid.RandomGenerator.generate(dojo.uuid.Uuid);
+
+ dojo.unimplemented('dojo.uuid.RandomGenerator.generate');
+ // FIXME:
+ // For an algorithm to generate a random UUID, see
+ // sections 4.4 and 4.5 of RFC 4122:
+ // http://www.ietf.org/rfc/rfc4122.txt
+
+ var returnValue = "00000000-0000-0000-0000-000000000000"; // FIXME
+ if (returnType && (returnType != String)) {
+ returnValue = new returnType(returnValue);
+ }
+ return returnValue; // object
+ };
+}();
Propchange: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/RandomGenerator.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/TimeBasedGenerator.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/TimeBasedGenerator.js?view=auto&rev=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/TimeBasedGenerator.js (added)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/TimeBasedGenerator.js Mon Nov 13 14:54:45 2006
@@ -0,0 +1,355 @@
+/*
+ Copyright (c) 2004-2006, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.uuid.TimeBasedGenerator");
+dojo.require("dojo.lang.common");
+dojo.require("dojo.lang.type");
+dojo.require("dojo.lang.assert");
+
+dojo.uuid.TimeBasedGenerator = new function() {
+
+ // --------------------------------------------------
+ // Public constants:
+ // Number of hours between October 15, 1582 and January 1, 1970:
+ this.GREGORIAN_CHANGE_OFFSET_IN_HOURS = 3394248;
+ // Number of seconds between October 15, 1582 and January 1, 1970:
+ // this.GREGORIAN_CHANGE_OFFSET_IN_SECONDS = 12219292800;
+
+ // --------------------------------------------------
+ // Private variables:
+ var _uuidPseudoNodeString = null;
+ var _uuidClockSeqString = null;
+ var _dateValueOfPreviousUuid = null;
+ var _nextIntraMillisecondIncrement = 0;
+ var _cachedMillisecondsBetween1582and1970 = null;
+ var _cachedHundredNanosecondIntervalsPerMillisecond = null;
+ var _uniformNode = null;
+
+ // --------------------------------------------------
+ // Private constants:
+ var HEX_RADIX = 16;
+
+ function _carry(/* array */ arrayA) {
+ // summary:
+ // Given an array which holds a 64-bit number broken into 4 16-bit
+ // elements, this method carries any excess bits (greater than 16-bits)
+ // from each array element into the next.
+ // arrayA: An array with 4 elements, each of which is a 16-bit number.
+ arrayA[2] += arrayA[3] >>> 16;
+ arrayA[3] &= 0xFFFF;
+ arrayA[1] += arrayA[2] >>> 16;
+ arrayA[2] &= 0xFFFF;
+ arrayA[0] += arrayA[1] >>> 16;
+ arrayA[1] &= 0xFFFF;
+ dojo.lang.assert((arrayA[0] >>> 16) === 0);
+ }
+
+ function _get64bitArrayFromFloat(/* float */ x) {
+ // summary:
+ // Given a floating point number, this method returns an array which
+ // holds a 64-bit number broken into 4 16-bit elements.
+ var result = new Array(0, 0, 0, 0);
+ result[3] = x % 0x10000;
+ x -= result[3];
+ x /= 0x10000;
+ result[2] = x % 0x10000;
+ x -= result[2];
+ x /= 0x10000;
+ result[1] = x % 0x10000;
+ x -= result[1];
+ x /= 0x10000;
+ result[0] = x;
+ return result; // Array with 4 elements, each of which is a 16-bit number.
+ }
+
+ function _addTwo64bitArrays(/* array */ arrayA, /* array */ arrayB) {
+ // summary:
+ // Takes two arrays, each of which holds a 64-bit number broken into 4
+ // 16-bit elements, and returns a new array that holds a 64-bit number
+ // that is the sum of the two original numbers.
+ // arrayA: An array with 4 elements, each of which is a 16-bit number.
+ // arrayB: An array with 4 elements, each of which is a 16-bit number.
+ dojo.lang.assertType(arrayA, Array);
+ dojo.lang.assertType(arrayB, Array);
+ dojo.lang.assert(arrayA.length == 4);
+ dojo.lang.assert(arrayB.length == 4);
+
+ var result = new Array(0, 0, 0, 0);
+ result[3] = arrayA[3] + arrayB[3];
+ result[2] = arrayA[2] + arrayB[2];
+ result[1] = arrayA[1] + arrayB[1];
+ result[0] = arrayA[0] + arrayB[0];
+ _carry(result);
+ return result; // Array with 4 elements, each of which is a 16-bit number.
+ }
+
+ function _multiplyTwo64bitArrays(/* array */ arrayA, /* array */ arrayB) {
+ // summary:
+ // Takes two arrays, each of which holds a 64-bit number broken into 4
+ // 16-bit elements, and returns a new array that holds a 64-bit number
+ // that is the product of the two original numbers.
+ // arrayA: An array with 4 elements, each of which is a 16-bit number.
+ // arrayB: An array with 4 elements, each of which is a 16-bit number.
+ dojo.lang.assertType(arrayA, Array);
+ dojo.lang.assertType(arrayB, Array);
+ dojo.lang.assert(arrayA.length == 4);
+ dojo.lang.assert(arrayB.length == 4);
+
+ var overflow = false;
+ if (arrayA[0] * arrayB[0] !== 0) { overflow = true; }
+ if (arrayA[0] * arrayB[1] !== 0) { overflow = true; }
+ if (arrayA[0] * arrayB[2] !== 0) { overflow = true; }
+ if (arrayA[1] * arrayB[0] !== 0) { overflow = true; }
+ if (arrayA[1] * arrayB[1] !== 0) { overflow = true; }
+ if (arrayA[2] * arrayB[0] !== 0) { overflow = true; }
+ dojo.lang.assert(!overflow);
+
+ var result = new Array(0, 0, 0, 0);
+ result[0] += arrayA[0] * arrayB[3];
+ _carry(result);
+ result[0] += arrayA[1] * arrayB[2];
+ _carry(result);
+ result[0] += arrayA[2] * arrayB[1];
+ _carry(result);
+ result[0] += arrayA[3] * arrayB[0];
+ _carry(result);
+ result[1] += arrayA[1] * arrayB[3];
+ _carry(result);
+ result[1] += arrayA[2] * arrayB[2];
+ _carry(result);
+ result[1] += arrayA[3] * arrayB[1];
+ _carry(result);
+ result[2] += arrayA[2] * arrayB[3];
+ _carry(result);
+ result[2] += arrayA[3] * arrayB[2];
+ _carry(result);
+ result[3] += arrayA[3] * arrayB[3];
+ _carry(result);
+ return result; // Array with 4 elements, each of which is a 16-bit number.
+ }
+
+ function _padWithLeadingZeros(/* string */ string, /* int */ desiredLength) {
+ // summary:
+ // Pads a string with leading zeros and returns the result.
+ // string: A string to add padding to.
+ // desiredLength: The number of characters the return string should have.
+
+ // examples:
+ // result = _padWithLeadingZeros("abc", 6);
+ // dojo.lang.assert(result == "000abc");
+ while (string.length < desiredLength) {
+ string = "0" + string;
+ }
+ return string; // string
+ }
+
+ function _generateRandomEightCharacterHexString() {
+ // summary:
+ // Returns a randomly generated 8-character string of hex digits.
+
+ // FIXME: This probably isn't a very high quality random number.
+
+ // Make random32bitNumber be a randomly generated floating point number
+ // between 0 and (4,294,967,296 - 1), inclusive.
+ var random32bitNumber = Math.floor( (Math.random() % 1) * Math.pow(2, 32) );
+
+ var eightCharacterString = random32bitNumber.toString(HEX_RADIX);
+ while (eightCharacterString.length < 8) {
+ eightCharacterString = "0" + eightCharacterString;
+ }
+ return eightCharacterString; // String (an 8-character hex string)
+ }
+
+ function _generateUuidString(/* string? */ node) {
+ // summary:
+ // Generates a time-based UUID, meaning a version 1 UUID.
+ // description:
+ // JavaScript code running in a browser doesn't have access to the
+ // IEEE 802.3 address of the computer, so if a node value isn't
+ // supplied, we generate a random pseudonode value instead.
+ // node: An optional 12-character string to use as the node in the new UUID.
+ dojo.lang.assertType(node, String, {optional: true});
+ if (node) {
+ dojo.lang.assert(node.length == 12);
+ } else {
+ if (_uniformNode) {
+ node = _uniformNode;
+ } else {
+ if (!_uuidPseudoNodeString) {
+ var pseudoNodeIndicatorBit = 0x8000;
+ var random15bitNumber = Math.floor( (Math.random() % 1) * Math.pow(2, 15) );
+ var leftmost4HexCharacters = (pseudoNodeIndicatorBit | random15bitNumber).toString(HEX_RADIX);
+ _uuidPseudoNodeString = leftmost4HexCharacters + _generateRandomEightCharacterHexString();
+ }
+ node = _uuidPseudoNodeString;
+ }
+ }
+ if (!_uuidClockSeqString) {
+ var variantCodeForDCEUuids = 0x8000; // 10--------------, i.e. uses only first two of 16 bits.
+ var random14bitNumber = Math.floor( (Math.random() % 1) * Math.pow(2, 14) );
+ _uuidClockSeqString = (variantCodeForDCEUuids | random14bitNumber).toString(HEX_RADIX);
+ }
+
+ // Maybe we should think about trying to make the code more readable to
+ // newcomers by creating a class called "WholeNumber" that encapsulates
+ // the methods and data structures for working with these arrays that
+ // hold 4 16-bit numbers? And then these variables below have names
+ // like "wholeSecondsPerHour" rather than "arraySecondsPerHour"?
+ var now = new Date();
+ var millisecondsSince1970 = now.valueOf(); // milliseconds since midnight 01 January, 1970 UTC.
+ var nowArray = _get64bitArrayFromFloat(millisecondsSince1970);
+ if (!_cachedMillisecondsBetween1582and1970) {
+ var arraySecondsPerHour = _get64bitArrayFromFloat(60 * 60);
+ var arrayHoursBetween1582and1970 = _get64bitArrayFromFloat(dojo.uuid.TimeBasedGenerator.GREGORIAN_CHANGE_OFFSET_IN_HOURS);
+ var arraySecondsBetween1582and1970 = _multiplyTwo64bitArrays(arrayHoursBetween1582and1970, arraySecondsPerHour);
+ var arrayMillisecondsPerSecond = _get64bitArrayFromFloat(1000);
+ _cachedMillisecondsBetween1582and1970 = _multiplyTwo64bitArrays(arraySecondsBetween1582and1970, arrayMillisecondsPerSecond);
+ _cachedHundredNanosecondIntervalsPerMillisecond = _get64bitArrayFromFloat(10000);
+ }
+ var arrayMillisecondsSince1970 = nowArray;
+ var arrayMillisecondsSince1582 = _addTwo64bitArrays(_cachedMillisecondsBetween1582and1970, arrayMillisecondsSince1970);
+ var arrayHundredNanosecondIntervalsSince1582 = _multiplyTwo64bitArrays(arrayMillisecondsSince1582, _cachedHundredNanosecondIntervalsPerMillisecond);
+
+ if (now.valueOf() == _dateValueOfPreviousUuid) {
+ arrayHundredNanosecondIntervalsSince1582[3] += _nextIntraMillisecondIncrement;
+ _carry(arrayHundredNanosecondIntervalsSince1582);
+ _nextIntraMillisecondIncrement += 1;
+ if (_nextIntraMillisecondIncrement == 10000) {
+ // If we've gotten to here, it means we've already generated 10,000
+ // UUIDs in this single millisecond, which is the most that the UUID
+ // timestamp field allows for. So now we'll just sit here and wait
+ // for a fraction of a millisecond, so as to ensure that the next
+ // time this method is called there will be a different millisecond
+ // value in the timestamp field.
+ while (now.valueOf() == _dateValueOfPreviousUuid) {
+ now = new Date();
+ }
+ }
+ } else {
+ _dateValueOfPreviousUuid = now.valueOf();
+ _nextIntraMillisecondIncrement = 1;
+ }
+
+ var hexTimeLowLeftHalf = arrayHundredNanosecondIntervalsSince1582[2].toString(HEX_RADIX);
+ var hexTimeLowRightHalf = arrayHundredNanosecondIntervalsSince1582[3].toString(HEX_RADIX);
+ var hexTimeLow = _padWithLeadingZeros(hexTimeLowLeftHalf, 4) + _padWithLeadingZeros(hexTimeLowRightHalf, 4);
+ var hexTimeMid = arrayHundredNanosecondIntervalsSince1582[1].toString(HEX_RADIX);
+ hexTimeMid = _padWithLeadingZeros(hexTimeMid, 4);
+ var hexTimeHigh = arrayHundredNanosecondIntervalsSince1582[0].toString(HEX_RADIX);
+ hexTimeHigh = _padWithLeadingZeros(hexTimeHigh, 3);
+ var hyphen = "-";
+ var versionCodeForTimeBasedUuids = "1"; // binary2hex("0001")
+ var resultUuid = hexTimeLow + hyphen + hexTimeMid + hyphen +
+ versionCodeForTimeBasedUuids + hexTimeHigh + hyphen +
+ _uuidClockSeqString + hyphen + node;
+ resultUuid = resultUuid.toLowerCase();
+ return resultUuid; // String (a 36 character string, which will look something like "b4308fb0-86cd-11da-a72b-0800200c9a66")
+ }
+
+ this.setNode = function(/* string? */ node) {
+ // summary:
+ // Sets the 'node' value that will be included in generated UUIDs.
+ // node: A 12-character hex string representing a pseudoNode or hardwareNode.
+ dojo.lang.assert((node === null) || (node.length == 12));
+ _uniformNode = node;
+ };
+
+ this.getNode = function() {
+ // summary:
+ // Returns the 'node' value that will be included in generated UUIDs.
+ return _uniformNode; // String (a 12-character hex string representing a pseudoNode or hardwareNode)
+ };
+
+ this.generate = function(/* misc? */ input) {
+ // summary:
+ // This function generates time-based UUIDs, meaning "version 1" UUIDs.
+ // description:
+ // For more info, see
+ // http://www.webdav.org/specs/draft-leach-uuids-guids-01.txt
+ // http://www.infonuovo.com/dma/csdocs/sketch/instidid.htm
+ // http://kruithof.xs4all.nl/uuid/uuidgen
+ // http://www.opengroup.org/onlinepubs/009629399/apdxa.htm#tagcjh_20
+ // http://jakarta.apache.org/commons/sandbox/id/apidocs/org/apache/commons/id/uuid/clock/Clock.html
+
+ // examples:
+ // var generate = dojo.uuid.TimeBasedGenerator.generate;
+ // var uuid; // an instance of dojo.uuid.Uuid
+ // var string; // a simple string literal
+ // string = generate();
+ // string = generate(String);
+ // uuid = generate(dojo.uuid.Uuid);
+ // string = generate("017bf397618a");
+ // string = generate({node: "017bf397618a"}); // hardwareNode
+ // string = generate({node: "f17bf397618a"}); // pseudoNode
+ // string = generate({hardwareNode: "017bf397618a"});
+ // string = generate({pseudoNode: "f17bf397618a"});
+ // string = generate({node: "017bf397618a", returnType: String});
+ // uuid = generate({node: "017bf397618a", returnType: dojo.uuid.Uuid});
+ // dojo.uuid.TimeBasedGenerator.setNode("017bf397618a");
+ // string = generate(); // the generated UUID has node == "017bf397618a"
+ // uuid = generate(dojo.uuid.Uuid); // the generated UUID has node == "017bf397618a"
+ var nodeString = null;
+ var returnType = null;
+
+ if (input) {
+ if (dojo.lang.isObject(input) && !dojo.lang.isBuiltIn(input)) {
+ // input: object {node: string, hardwareNode: string, pseudoNode: string}
+ // node: A 12-character hex string representing a pseudoNode or hardwareNode.
+ // hardwareNode: A 12-character hex string containing an IEEE 802.3 network node identificator.
+ // pseudoNode: A 12-character hex string representing a pseudoNode.
+ var namedParameters = input;
+ dojo.lang.assertValidKeywords(namedParameters, ["node", "hardwareNode", "pseudoNode", "returnType"]);
+ var node = namedParameters["node"];
+ var hardwareNode = namedParameters["hardwareNode"];
+ var pseudoNode = namedParameters["pseudoNode"];
+ nodeString = (node || pseudoNode || hardwareNode);
+ if (nodeString) {
+ var firstCharacter = nodeString.charAt(0);
+ var firstDigit = parseInt(firstCharacter, HEX_RADIX);
+ if (hardwareNode) {
+ dojo.lang.assert((firstDigit >= 0x0) && (firstDigit <= 0x7));
+ }
+ if (pseudoNode) {
+ dojo.lang.assert((firstDigit >= 0x8) && (firstDigit <= 0xF));
+ }
+ }
+ returnType = namedParameters["returnType"];
+ dojo.lang.assertType(returnType, Function, {optional: true});
+ } else {
+ if (dojo.lang.isString(input)) {
+ // input: string A 12-character hex string representing a pseudoNode or hardwareNode.
+ nodeString = input;
+ returnType = null;
+ } else {
+ if (dojo.lang.isFunction(input)) {
+ // input: constructor The type of object to return. Usually String or dojo.uuid.Uuid
+ nodeString = null;
+ returnType = input;
+ }
+ }
+ }
+ if (nodeString) {
+ dojo.lang.assert(nodeString.length == 12);
+ var integer = parseInt(nodeString, HEX_RADIX);
+ dojo.lang.assert(isFinite(integer));
+ }
+ dojo.lang.assertType(returnType, Function, {optional: true});
+ }
+
+ var uuidString = _generateUuidString(nodeString);
+ var returnValue;
+ if (returnType && (returnType != String)) {
+ returnValue = new returnType(uuidString);
+ } else {
+ returnValue = uuidString;
+ }
+ return returnValue; // object
+ };
+}();
Propchange: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/TimeBasedGenerator.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/Uuid.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/Uuid.js?view=auto&rev=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/Uuid.js (added)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/Uuid.js Mon Nov 13 14:54:45 2006
@@ -0,0 +1,379 @@
+/*
+ Copyright (c) 2004-2006, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.uuid.Uuid");
+dojo.require("dojo.lang.common");
+dojo.require("dojo.lang.assert");
+
+dojo.uuid.Uuid = function(/* string || generator */ input) {
+ // summary:
+ // This is the constructor for the Uuid class. The Uuid class offers
+ // methods for inspecting existing UUIDs.
+
+ // examples:
+ // var uuid;
+ // uuid = new dojo.uuid.Uuid("3b12f1df-5232-4804-897e-917bf397618a");
+ // uuid = new dojo.uuid.Uuid(); // "00000000-0000-0000-0000-000000000000"
+ // uuid = new dojo.uuid.Uuid(dojo.uuid.RandomGenerator);
+ // uuid = new dojo.uuid.Uuid(dojo.uuid.TimeBasedGenerator);
+ // dojo.uuid.Uuid.setGenerator(dojo.uuid.RandomGenerator);
+ // uuid = new dojo.uuid.Uuid();
+ // dojo.lang.assert(!uuid.isEqual(dojo.uuid.Uuid.NIL_UUID));
+ this._uuidString = dojo.uuid.Uuid.NIL_UUID;
+ if (input) {
+ if (dojo.lang.isString(input)) {
+ // input: string? A 36-character string that conforms to the UUID spec.
+ this._uuidString = input.toLowerCase();
+ dojo.lang.assert(this.isValid());
+ } else {
+ if (dojo.lang.isObject(input) && input.generate) {
+ // input: generator A UUID generator, such as dojo.uuid.TimeBasedGenerator.
+ var generator = input;
+ this._uuidString = generator.generate();
+ dojo.lang.assert(this.isValid());
+ } else {
+ // we got passed something other than a string
+ dojo.lang.assert(false, "The dojo.uuid.Uuid() constructor must be initializated with a UUID string.");
+ }
+ }
+ } else {
+ var ourGenerator = dojo.uuid.Uuid.getGenerator();
+ if (ourGenerator) {
+ this._uuidString = ourGenerator.generate();
+ dojo.lang.assert(this.isValid());
+ }
+ }
+};
+
+// -------------------------------------------------------------------
+// Public constants
+// -------------------------------------------------------------------
+dojo.uuid.Uuid.NIL_UUID = "00000000-0000-0000-0000-000000000000";
+dojo.uuid.Uuid.Version = {
+ UNKNOWN: 0,
+ TIME_BASED: 1,
+ DCE_SECURITY: 2,
+ NAME_BASED_MD5: 3,
+ RANDOM: 4,
+ NAME_BASED_SHA1: 5 };
+dojo.uuid.Uuid.Variant = {
+ NCS: "0",
+ DCE: "10",
+ MICROSOFT: "110",
+ UNKNOWN: "111" };
+dojo.uuid.Uuid.HEX_RADIX = 16;
+
+dojo.uuid.Uuid.compare = function(/* dojo.uuid.Uuid */ uuidOne, /* dojo.uuid.Uuid */ uuidTwo) {
+ // summary:
+ // Given two UUIDs to compare, this method returns 0, 1, or -1.
+ // description:
+ // This method is designed to be used by sorting routines, like the
+ // JavaScript built-in Array sort() method. This implementation is
+ // intended to match the sample implementation in IETF RFC 4122:
+ // http://www.ietf.org/rfc/rfc4122.txt
+ // uuidOne: Any object that has toString() method that returns a 36-character string that conforms to the UUID spec.
+ // uuidTwo: Any object that has toString() method that returns a 36-character string that conforms to the UUID spec.
+
+ // examples:
+ // var uuid;
+ // var generator = dojo.uuid.TimeBasedGenerator;
+ // var a = new dojo.uuid.Uuid(generator);
+ // var b = new dojo.uuid.Uuid(generator);
+ // var c = new dojo.uuid.Uuid(generator);
+ // var array = new Array(a, b, c);
+ // array.sort(dojo.uuid.Uuid.compare);
+ var uuidStringOne = uuidOne.toString();
+ var uuidStringTwo = uuidTwo.toString();
+ if (uuidStringOne > uuidStringTwo) return 1; // integer
+ if (uuidStringOne < uuidStringTwo) return -1; // integer
+ return 0; // integer (either 0, 1, or -1)
+};
+
+dojo.uuid.Uuid.setGenerator = function(/* generator? */ generator) {
+ // summary:
+ // Sets the default generator, which will be used by the
+ // "new dojo.uuid.Uuid()" constructor if no parameters
+ // are passed in.
+ // generator: A UUID generator, such as dojo.uuid.TimeBasedGenerator.
+ dojo.lang.assert(!generator || (dojo.lang.isObject(generator) && generator.generate));
+ dojo.uuid.Uuid._ourGenerator = generator;
+};
+
+dojo.uuid.Uuid.getGenerator = function() {
+ // summary:
+ // Returns the default generator. See setGenerator().
+ return dojo.uuid.Uuid._ourGenerator; // generator (A UUID generator, such as dojo.uuid.TimeBasedGenerator).
+};
+
+dojo.uuid.Uuid.prototype.toString = function(/* string? */format) {
+ // summary:
+ // By default this method returns a standard 36-character string representing
+ // the UUID, such as "3b12f1df-5232-4804-897e-917bf397618a". You can also
+ // pass in an optional format specifier to request the output in any of
+ // a half dozen slight variations.
+ // format: One of these strings: '{}', '()', '""', "''", 'urn', '!-'
+
+ // examples:
+ // var uuid = new dojo.uuid.Uuid(dojo.uuid.TimeBasedGenerator);
+ // var s;
+ // s = uuid.toString(); // eb529fec-6498-11d7-b236-000629ba5445
+ // s = uuid.toString('{}'); // {eb529fec-6498-11d7-b236-000629ba5445}
+ // s = uuid.toString('()'); // (eb529fec-6498-11d7-b236-000629ba5445)
+ // s = uuid.toString('""'); // "eb529fec-6498-11d7-b236-000629ba5445"
+ // s = uuid.toString("''"); // 'eb529fec-6498-11d7-b236-000629ba5445'
+ // s = uuid.toString('!-'); // eb529fec649811d7b236000629ba5445
+ // s = uuid.toString('urn'); // urn:uuid:eb529fec-6498-11d7-b236-000629ba5445
+ if (format) {
+ switch (format) {
+ case '{}':
+ return '{' + this._uuidString + '}';
+ break;
+ case '()':
+ return '(' + this._uuidString + ')';
+ break;
+ case '""':
+ return '"' + this._uuidString + '"';
+ break;
+ case "''":
+ return "'" + this._uuidString + "'";
+ break;
+ case 'urn':
+ return 'urn:uuid:' + this._uuidString;
+ break;
+ case '!-':
+ return this._uuidString.split('-').join('');
+ break;
+ default:
+ // we got passed something other than what we expected
+ dojo.lang.assert(false, "The toString() method of dojo.uuid.Uuid was passed a bogus format.");
+ }
+ } else {
+ return this._uuidString; // string
+ }
+};
+
+dojo.uuid.Uuid.prototype.compare = function(/* dojo.uuid.Uuid */ otherUuid) {
+ // summary:
+ // Compares this UUID to another UUID, and returns 0, 1, or -1.
+ // description:
+ // This implementation is intended to match the sample implementation
+ // in IETF RFC 4122: http://www.ietf.org/rfc/rfc4122.txt
+ // otherUuid: Any object that has toString() method that returns a 36-character string that conforms to the UUID spec.
+ return dojo.uuid.Uuid.compare(this, otherUuid); // integer (either 0, 1, or -1)
+};
+
+dojo.uuid.Uuid.prototype.isEqual = function(/* dojo.uuid.Uuid */ otherUuid) {
+ // summary:
+ // Returns true if this UUID is equal to the otherUuid, or false otherwise.
+ // otherUuid: Any object that has toString() method that returns a 36-character string that conforms to the UUID spec.
+ return (this.compare(otherUuid) == 0); // boolean
+};
+
+dojo.uuid.Uuid.prototype.isValid = function() {
+ // summary:
+ // Returns true if the UUID was initialized with a valid value.
+ try {
+ dojo.lang.assertType(this._uuidString, String);
+ dojo.lang.assert(this._uuidString.length == 36);
+ dojo.lang.assert(this._uuidString == this._uuidString.toLowerCase());
+ var arrayOfParts = this._uuidString.split("-");
+ dojo.lang.assert(arrayOfParts.length == 5);
+ dojo.lang.assert(arrayOfParts[0].length == 8);
+ dojo.lang.assert(arrayOfParts[1].length == 4);
+ dojo.lang.assert(arrayOfParts[2].length == 4);
+ dojo.lang.assert(arrayOfParts[3].length == 4);
+ dojo.lang.assert(arrayOfParts[4].length == 12);
+ for (var i in arrayOfParts) {
+ var part = arrayOfParts[i];
+ var integer = parseInt(part, dojo.uuid.Uuid.HEX_RADIX);
+ dojo.lang.assert(isFinite(integer));
+ }
+ return true; // boolean
+ } catch (e) {
+ return false; // boolean
+ }
+};
+
+dojo.uuid.Uuid.prototype.getVariant = function() {
+ // summary:
+ // Returns a variant code that indicates what type of UUID this is.
+ // Returns one of the enumerated dojo.uuid.Uuid.Variant values.
+
+ // example:
+ // var uuid = new dojo.uuid.Uuid("3b12f1df-5232-4804-897e-917bf397618a");
+ // var variant = uuid.getVariant();
+ // dojo.lang.assert(variant == dojo.uuid.Uuid.Variant.DCE);
+ // example:
+ // "3b12f1df-5232-4804-897e-917bf397618a"
+ // ^
+ // |
+ // (variant "10__" == DCE)
+ var variantCharacter = this._uuidString.charAt(19);
+ var variantNumber = parseInt(variantCharacter, dojo.uuid.Uuid.HEX_RADIX);
+ dojo.lang.assert((variantNumber >= 0) && (variantNumber <= 16));
+
+ if (!dojo.uuid.Uuid._ourVariantLookupTable) {
+ var Variant = dojo.uuid.Uuid.Variant;
+ var lookupTable = [];
+
+ lookupTable[0x0] = Variant.NCS; // 0000
+ lookupTable[0x1] = Variant.NCS; // 0001
+ lookupTable[0x2] = Variant.NCS; // 0010
+ lookupTable[0x3] = Variant.NCS; // 0011
+
+ lookupTable[0x4] = Variant.NCS; // 0100
+ lookupTable[0x5] = Variant.NCS; // 0101
+ lookupTable[0x6] = Variant.NCS; // 0110
+ lookupTable[0x7] = Variant.NCS; // 0111
+
+ lookupTable[0x8] = Variant.DCE; // 1000
+ lookupTable[0x9] = Variant.DCE; // 1001
+ lookupTable[0xA] = Variant.DCE; // 1010
+ lookupTable[0xB] = Variant.DCE; // 1011
+
+ lookupTable[0xC] = Variant.MICROSOFT; // 1100
+ lookupTable[0xD] = Variant.MICROSOFT; // 1101
+ lookupTable[0xE] = Variant.UNKNOWN; // 1110
+ lookupTable[0xF] = Variant.UNKNOWN; // 1111
+
+ dojo.uuid.Uuid._ourVariantLookupTable = lookupTable;
+ }
+
+ return dojo.uuid.Uuid._ourVariantLookupTable[variantNumber]; // dojo.uuid.Uuid.Variant
+};
+
+dojo.uuid.Uuid.prototype.getVersion = function() {
+ // summary:
+ // Returns a version number that indicates what type of UUID this is.
+ // Returns one of the enumerated dojo.uuid.Uuid.Version values.
+
+ // example:
+ // var uuid = new dojo.uuid.Uuid("b4308fb0-86cd-11da-a72b-0800200c9a66");
+ // var version = uuid.getVersion();
+ // dojo.lang.assert(version == dojo.uuid.Uuid.Version.TIME_BASED);
+ // exceptions:
+ // Throws an Error if this is not a DCE Variant UUID.
+ if (!this._versionNumber) {
+ var errorMessage = "Called getVersion() on a dojo.uuid.Uuid that was not a DCE Variant UUID.";
+ dojo.lang.assert(this.getVariant() == dojo.uuid.Uuid.Variant.DCE, errorMessage);
+
+ // "b4308fb0-86cd-11da-a72b-0800200c9a66"
+ // ^
+ // |
+ // (version 1 == TIME_BASED)
+ var versionCharacter = this._uuidString.charAt(14);
+ this._versionNumber = parseInt(versionCharacter, dojo.uuid.Uuid.HEX_RADIX);
+ }
+ return this._versionNumber; // dojo.uuid.Uuid.Version
+};
+
+dojo.uuid.Uuid.prototype.getNode = function() {
+ // summary:
+ // If this is a version 1 UUID (a time-based UUID), getNode() returns a
+ // 12-character string with the "node" or "pseudonode" portion of the UUID,
+ // which is the rightmost 12 characters.
+
+ // exceptions:
+ // Throws an Error if this is not a version 1 UUID.
+ if (!this._nodeString) {
+ var errorMessage = "Called getNode() on a dojo.uuid.Uuid that was not a TIME_BASED UUID.";
+ dojo.lang.assert(this.getVersion() == dojo.uuid.Uuid.Version.TIME_BASED, errorMessage);
+
+ var arrayOfStrings = this._uuidString.split('-');
+ this._nodeString = arrayOfStrings[4];
+ }
+ return this._nodeString; // String (a 12-character string, which will look something like "917bf397618a")
+};
+
+dojo.uuid.Uuid.prototype.getTimestamp = function(/* misc. */ returnType) {
+ // summary:
+ // If this is a version 1 UUID (a time-based UUID), this method returns
+ // the timestamp value encoded in the UUID. The caller can ask for the
+ // timestamp to be returned either as a JavaScript Date object or as a
+ // 15-character string of hex digits.
+ // returnType: Any of these five values: "string", String, "hex", "date", Date
+
+ // returns:
+ // Returns the timestamp value as a JavaScript Date object or a 15-character string of hex digits.
+ // examples:
+ // var uuid = new dojo.uuid.Uuid("b4308fb0-86cd-11da-a72b-0800200c9a66");
+ // var date, string, hexString;
+ // date = uuid.getTimestamp(); // returns a JavaScript Date
+ // date = uuid.getTimestamp(Date); //
+ // string = uuid.getTimestamp(String); // "Mon, 16 Jan 2006 20:21:41 GMT"
+ // hexString = uuid.getTimestamp("hex"); // "1da86cdb4308fb0"
+ // exceptions:
+ // Throws an Error if this is not a version 1 UUID.
+ var errorMessage = "Called getTimestamp() on a dojo.uuid.Uuid that was not a TIME_BASED UUID.";
+ dojo.lang.assert(this.getVersion() == dojo.uuid.Uuid.Version.TIME_BASED, errorMessage);
+
+ if (!returnType) {returnType = null};
+ switch (returnType) {
+ case "string":
+ case String:
+ return this.getTimestamp(Date).toUTCString(); // String (e.g. "Mon, 16 Jan 2006 20:21:41 GMT")
+ break;
+ case "hex":
+ // Return a 15-character string of hex digits containing the
+ // timestamp for this UUID, with the high-order bits first.
+ if (!this._timestampAsHexString) {
+ var arrayOfStrings = this._uuidString.split('-');
+ var hexTimeLow = arrayOfStrings[0];
+ var hexTimeMid = arrayOfStrings[1];
+ var hexTimeHigh = arrayOfStrings[2];
+
+ // Chop off the leading "1" character, which is the UUID
+ // version number for time-based UUIDs.
+ hexTimeHigh = hexTimeHigh.slice(1);
+
+ this._timestampAsHexString = hexTimeHigh + hexTimeMid + hexTimeLow;
+ dojo.lang.assert(this._timestampAsHexString.length == 15);
+ }
+ return this._timestampAsHexString; // String (e.g. "1da86cdb4308fb0")
+ break;
+ case null: // no returnType was specified, so default to Date
+ case "date":
+ case Date:
+ // Return a JavaScript Date object.
+ if (!this._timestampAsDate) {
+ var GREGORIAN_CHANGE_OFFSET_IN_HOURS = 3394248;
+
+ var arrayOfParts = this._uuidString.split('-');
+ var timeLow = parseInt(arrayOfParts[0], dojo.uuid.Uuid.HEX_RADIX);
+ var timeMid = parseInt(arrayOfParts[1], dojo.uuid.Uuid.HEX_RADIX);
+ var timeHigh = parseInt(arrayOfParts[2], dojo.uuid.Uuid.HEX_RADIX);
+ var hundredNanosecondIntervalsSince1582 = timeHigh & 0x0FFF;
+ hundredNanosecondIntervalsSince1582 <<= 16;
+ hundredNanosecondIntervalsSince1582 += timeMid;
+ // What we really want to do next is shift left 32 bits, but the
+ // result will be too big to fit in an int, so we'll multiply by 2^32,
+ // and the result will be a floating point approximation.
+ hundredNanosecondIntervalsSince1582 *= 0x100000000;
+ hundredNanosecondIntervalsSince1582 += timeLow;
+ var millisecondsSince1582 = hundredNanosecondIntervalsSince1582 / 10000;
+
+ // Again, this will be a floating point approximation.
+ // We can make things exact later if we need to.
+ var secondsPerHour = 60 * 60;
+ var hoursBetween1582and1970 = GREGORIAN_CHANGE_OFFSET_IN_HOURS;
+ var secondsBetween1582and1970 = hoursBetween1582and1970 * secondsPerHour;
+ var millisecondsBetween1582and1970 = secondsBetween1582and1970 * 1000;
+ var millisecondsSince1970 = millisecondsSince1582 - millisecondsBetween1582and1970;
+
+ this._timestampAsDate = new Date(millisecondsSince1970);
+ }
+ return this._timestampAsDate; // Date
+ break;
+ default:
+ // we got passed something other than a valid returnType
+ dojo.lang.assert(false, "The getTimestamp() method dojo.uuid.Uuid was passed a bogus returnType: " + returnType);
+ break;
+ }
+};
Propchange: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/Uuid.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/__package__.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/__package__.js?view=auto&rev=474551
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/__package__.js (added)
+++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/src/uuid/__package__.js Mon Nov 13 14:54:45 2006
@@ -0,0 +1,22 @@
+/*
+ Copyright (c) 2004-2006, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.kwCompoundRequire({
+ common: [
+ "dojo.uuid.Uuid",
+ "dojo.uuid.LightweightGenerator",
+ "dojo.uuid.RandomGenerator",
+ "dojo.uuid.TimeBasedGenerator",
+ "dojo.uuid.NameBasedGenerator",
+ "dojo.uuid.NilGenerator"
+ ]
+});
+dojo.provide("dojo.uuid.*");
+