You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by so...@apache.org on 2006/06/12 01:24:58 UTC

svn commit: r413547 [14/15] - in /lenya/branches/revolution/1.3.x: ./ src/java/org/apache/lenya/cms/cocoon/components/modules/input/ src/java/org/apache/lenya/cms/cocoon/components/source/ src/java/org/apache/lenya/cms/cocoon/components/source/impl/ sr...

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/OptionTransfer.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/OptionTransfer.js?rev=413547&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/OptionTransfer.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/OptionTransfer.js Sun Jun 11 16:24:48 2006
@@ -0,0 +1,187 @@
+// ===================================================================
+// Author: Matt Kruse <ma...@mattkruse.com>
+// WWW: http://www.mattkruse.com/
+//
+// NOTICE: You may use this code for any purpose, commercial or
+// private, without any further permission from the author. You may
+// remove this notice from your final code if you wish, however it is
+// appreciated by the author if at least my web site address is kept.
+//
+// You may *NOT* re-distribute this code in any way except through its
+// use. That means, you can include it in your product, or your web
+// site, or any other form where the code is actually being used. You
+// may not put the plain javascript up on your site for download or
+// include it in your javascript libraries for download. 
+// If you wish to share this code with others, please just point them
+// to the URL instead.
+// Please DO NOT link directly to my .js files from your site. Copy
+// the files to your server and use them there. Thank you.
+// ===================================================================
+
+/* 
+OptionTransfer.js
+Last Modified: 11/18/2002
+
+DESCRIPTION: This widget is used to easily and quickly create an interface
+where the user can transfer choices from one select box to another. For
+example, when selecting which columns to show or hide in search results.
+This object adds value by automatically storing the values that were added
+or removed from each list, as well as the state of the final list. 
+
+COMPATIBILITY: Should work on all Javascript-compliant browsers.
+
+USAGE:
+// Create a new OptionTransfer object. Pass it the field names of the left
+// select box and the right select box.
+var ot = new OptionTransfer("from","to");
+
+// Optionally tell the lists whether or not to auto-sort when options are 
+// moved. By default, the lists will be sorted.
+ot.setAutoSort(true);
+
+// Optionally set the delimiter to be used to separate values that are
+// stored in hidden fields for the added and removed options, as well as
+// final state of the lists. Defaults to a comma.
+ot.setDelimiter("|");
+
+// These functions assign the form fields which will store the state of
+// the lists. Each one is optional, so you can pick to only store the
+// new options which were transferred to the right list, for example.
+// Each function takes the name of a HIDDEN or TEXT input field.
+
+// Store list of options removed from left list into an input field
+ot.saveRemovedLeftOptions("removedLeft");
+// Store list of options removed from right list into an input field
+ot.saveRemovedRightOptions("removedRight");
+// Store list of options added to left list into an input field
+ot.saveAddedLeftOptions("addedLeft");
+// Store list of options radded to right list into an input field
+ot.saveAddedRightOptions("addedRight");
+// Store all options existing in the left list into an input field
+ot.saveNewLeftOptions("newLeft");
+// Store all options existing in the right list into an input field
+ot.saveNewRightOptions("newRight");
+
+// IMPORTANT: This step is required for the OptionTransfer object to work
+// correctly.
+// Add a call to the BODY onLoad="" tag of the page, and pass a reference to
+// the form which contains the select boxes and input fields.
+BODY onLoad="ot.init(document.forms[0])"
+
+// ADDING ACTIONS INTO YOUR PAGE
+// Finally, add calls to the object to move options back and forth, either
+// from links in your page or from double-clicking the options themselves.
+// See example page, and use the following methods:
+ot.transferRight();
+ot.transferAllRight();
+ot.transferLeft();
+ot.transferAllLeft();
+
+
+NOTES:
+1) Requires the functions in selectbox.js
+
+*/ 
+function OT_transferLeft() { moveSelectedOptions(this.right,this.left,this.autoSort); this.update(); }
+function OT_transferRight() { moveSelectedOptions(this.left,this.right,this.autoSort); this.update(); }
+function OT_transferAllLeft() { moveAllOptions(this.right,this.left,this.autoSort); this.update(); }
+function OT_transferAllRight() { moveAllOptions(this.left,this.right,this.autoSort); this.update(); }
+function OT_saveRemovedLeftOptions(f) { this.removedLeftField = f; }
+function OT_saveRemovedRightOptions(f) { this.removedRightField = f; }
+function OT_saveAddedLeftOptions(f) { this.addedLeftField = f; }
+function OT_saveAddedRightOptions(f) { this.addedRightField = f; }
+function OT_saveNewLeftOptions(f) { this.newLeftField = f; }
+function OT_saveNewRightOptions(f) { this.newRightField = f; }
+function OT_update() {
+	var removedLeft = new Object();
+	var removedRight = new Object();
+	var addedLeft = new Object();
+	var addedRight = new Object();
+	var newLeft = new Object();
+	var newRight = new Object();
+	for (var i=0;i<this.left.options.length;i++) {
+		var o=this.left.options[i];
+		newLeft[o.value]=1;
+		if (typeof(this.originalLeftValues[o.value])=="undefined") {
+			addedLeft[o.value]=1;
+			removedRight[o.value]=1;
+			}
+		}
+	for (var i=0;i<this.right.options.length;i++) {
+		var o=this.right.options[i];
+		newRight[o.value]=1;
+		if (typeof(this.originalRightValues[o.value])=="undefined") {
+			addedRight[o.value]=1;
+			removedLeft[o.value]=1;
+			}
+		}
+	if (this.removedLeftField!=null) { this.removedLeftField.value = OT_join(removedLeft,this.delimiter); }
+	if (this.removedRightField!=null) { this.removedRightField.value = OT_join(removedRight,this.delimiter); }
+	if (this.addedLeftField!=null) { this.addedLeftField.value = OT_join(addedLeft,this.delimiter); }
+	if (this.addedRightField!=null) { this.addedRightField.value = OT_join(addedRight,this.delimiter); }
+	if (this.newLeftField!=null) { this.newLeftField.value = OT_join(newLeft,this.delimiter); }
+	if (this.newRightField!=null) { this.newRightField.value = OT_join(newRight,this.delimiter); }
+	}
+function OT_join(o,delimiter) {
+	var val; var str="";
+	for(val in o){
+		if (str.length>0) { str=str+delimiter; }
+		str=str+val;
+		}
+	return str;
+	}
+function OT_setDelimiter(val) { this.delimiter=val; }
+function OT_setAutoSort(val) { this.autoSort=val; }
+function OT_init(theform) {
+	this.form = theform;
+	if(!theform[this.left]){alert("OptionTransfer init(): Left select list does not exist in form!");return false;}
+	if(!theform[this.right]){alert("OptionTransfer init(): Right select list does not exist in form!");return false;}
+	this.left=theform[this.left];
+	this.right=theform[this.right];
+	for(var i=0;i<this.left.options.length;i++) {
+		this.originalLeftValues[this.left.options[i].value]=1;
+		}
+	for(var i=0;i<this.right.options.length;i++) {
+		this.originalRightValues[this.right.options[i].value]=1;
+		}
+	if(this.removedLeftField!=null) { this.removedLeftField=theform[this.removedLeftField]; }
+	if(this.removedRightField!=null) { this.removedRightField=theform[this.removedRightField]; }
+	if(this.addedLeftField!=null) { this.addedLeftField=theform[this.addedLeftField]; }
+	if(this.addedRightField!=null) { this.addedRightField=theform[this.addedRightField]; }
+	if(this.newLeftField!=null) { this.newLeftField=theform[this.newLeftField]; }
+	if(this.newRightField!=null) { this.newRightField=theform[this.newRightField]; }
+	this.update();
+	}
+// -------------------------------------------------------------------
+// OptionTransfer()
+//  This is the object interface.
+// -------------------------------------------------------------------
+function OptionTransfer(l,r) {
+	this.form = null;
+	this.left=l;
+	this.right=r;
+	this.autoSort=true;
+	this.delimiter=",";
+	this.originalLeftValues = new Object();
+	this.originalRightValues = new Object();
+	this.removedLeftField = null;
+	this.removedRightField = null;
+	this.addedLeftField = null;
+	this.addedRightField = null;
+	this.newLeftField = null;
+	this.newRightField = null;
+	this.transferLeft=OT_transferLeft;
+	this.transferRight=OT_transferRight;
+	this.transferAllLeft=OT_transferAllLeft;
+	this.transferAllRight=OT_transferAllRight;
+	this.saveRemovedLeftOptions=OT_saveRemovedLeftOptions;
+	this.saveRemovedRightOptions=OT_saveRemovedRightOptions;
+	this.saveAddedLeftOptions=OT_saveAddedLeftOptions;
+	this.saveAddedRightOptions=OT_saveAddedRightOptions;
+	this.saveNewLeftOptions=OT_saveNewLeftOptions;
+	this.saveNewRightOptions=OT_saveNewRightOptions;
+	this.setDelimiter=OT_setDelimiter;
+	this.setAutoSort=OT_setAutoSort;
+	this.init=OT_init;
+	this.update=OT_update;
+	}

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/OptionTransfer.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/PopupWindow.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/PopupWindow.js?rev=413547&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/PopupWindow.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/PopupWindow.js Sun Jun 11 16:24:48 2006
@@ -0,0 +1,336 @@
+// ===================================================================
+// Author: Matt Kruse <ma...@mattkruse.com>
+// WWW: http://www.mattkruse.com/
+//
+// NOTICE: You may use this code for any purpose, commercial or
+// private, without any further permission from the author. You may
+// remove this notice from your final code if you wish, however it is
+// appreciated by the author if at least my web site address is kept.
+//
+// You may *NOT* re-distribute this code in any way except through its
+// use. That means, you can include it in your product, or your web
+// site, or any other form where the code is actually being used. You
+// may not put the plain javascript up on your site for download or
+// include it in your javascript libraries for download. 
+// If you wish to share this code with others, please just point them
+// to the URL instead.
+// Please DO NOT link directly to my .js files from your site. Copy
+// the files to your server and use them there. Thank you.
+// ===================================================================
+
+/* 
+PopupWindow.js
+Author: Matt Kruse
+Last modified: 02/16/04
+
+DESCRIPTION: This object allows you to easily and quickly popup a window
+in a certain place. The window can either be a DIV or a separate browser
+window.
+
+COMPATIBILITY: Works with Netscape 4.x, 6.x, IE 5.x on Windows. Some small
+positioning errors - usually with Window positioning - occur on the 
+Macintosh platform. Due to bugs in Netscape 4.x, populating the popup 
+window with <STYLE> tags may cause errors.
+
+USAGE:
+// Create an object for a WINDOW popup
+var win = new PopupWindow(); 
+
+// Create an object for a DIV window using the DIV named 'mydiv'
+var win = new PopupWindow('mydiv'); 
+
+// Set the window to automatically hide itself when the user clicks 
+// anywhere else on the page except the popup
+win.autoHide(); 
+
+// Show the window relative to the anchor name passed in
+win.showPopup(anchorname);
+
+// Hide the popup
+win.hidePopup();
+
+// Set the size of the popup window (only applies to WINDOW popups
+win.setSize(width,height);
+
+// Populate the contents of the popup window that will be shown. If you 
+// change the contents while it is displayed, you will need to refresh()
+win.populate(string);
+
+// set the URL of the window, rather than populating its contents
+// manually
+win.setUrl("http://www.site.com/");
+
+// Refresh the contents of the popup
+win.refresh();
+
+// Specify how many pixels to the right of the anchor the popup will appear
+win.offsetX = 50;
+
+// Specify how many pixels below the anchor the popup will appear
+win.offsetY = 100;
+
+NOTES:
+1) Requires the functions in AnchorPosition.js
+
+2) Your anchor tag MUST contain both NAME and ID attributes which are the 
+   same. For example:
+   <A NAME="test" ID="test"> </A>
+
+3) There must be at least a space between <A> </A> for IE5.5 to see the 
+   anchor tag correctly. Do not do <A></A> with no space.
+
+4) When a PopupWindow object is created, a handler for 'onmouseup' is
+   attached to any event handler you may have already defined. Do NOT define
+   an event handler for 'onmouseup' after you define a PopupWindow object or
+   the autoHide() will not work correctly.
+*/ 
+
+// Set the position of the popup window based on the anchor
+function PopupWindow_getXYPosition(anchorname) {
+	var coordinates;
+	if (this.type == "WINDOW") {
+		coordinates = getAnchorWindowPosition(anchorname);
+		}
+	else {
+		coordinates = getAnchorPosition(anchorname);
+		}
+	this.x = coordinates.x;
+	this.y = coordinates.y;
+	}
+// Set width/height of DIV/popup window
+function PopupWindow_setSize(width,height) {
+	this.width = width;
+	this.height = height;
+	}
+// Fill the window with contents
+function PopupWindow_populate(contents) {
+	this.contents = contents;
+	this.populated = false;
+	}
+// Set the URL to go to
+function PopupWindow_setUrl(url) {
+	this.url = url;
+	}
+// Set the window popup properties
+function PopupWindow_setWindowProperties(props) {
+	this.windowProperties = props;
+	}
+// Refresh the displayed contents of the popup
+function PopupWindow_refresh() {
+	if (this.divName != null) {
+		// refresh the DIV object
+		if (this.use_gebi) {
+			document.getElementById(this.divName).innerHTML = this.contents;
+			}
+		else if (this.use_css) { 
+			document.all[this.divName].innerHTML = this.contents;
+			}
+		else if (this.use_layers) { 
+			var d = document.layers[this.divName]; 
+			d.document.open();
+			d.document.writeln(this.contents);
+			d.document.close();
+			}
+		}
+	else {
+		if (this.popupWindow != null && !this.popupWindow.closed) {
+			if (this.url!="") {
+				this.popupWindow.location.href=this.url;
+				}
+			else {
+				this.popupWindow.document.open();
+				this.popupWindow.document.writeln(this.contents);
+				this.popupWindow.document.close();
+			}
+			this.popupWindow.focus();
+			}
+		}
+	}
+// Position and show the popup, relative to an anchor object
+function PopupWindow_showPopup(anchorname) {
+	this.getXYPosition(anchorname);
+	this.x += this.offsetX;
+	this.y += this.offsetY;
+	if (!this.populated && (this.contents != "")) {
+		this.populated = true;
+		this.refresh();
+		}
+	if (this.divName != null) {
+		// Show the DIV object
+		if (this.use_gebi) {
+			document.getElementById(this.divName).style.left = this.x + "px";
+			document.getElementById(this.divName).style.top = this.y + "px";
+			document.getElementById(this.divName).style.visibility = "visible";
+			}
+		else if (this.use_css) {
+			document.all[this.divName].style.left = this.x;
+			document.all[this.divName].style.top = this.y;
+			document.all[this.divName].style.visibility = "visible";
+			}
+		else if (this.use_layers) {
+			document.layers[this.divName].left = this.x;
+			document.layers[this.divName].top = this.y;
+			document.layers[this.divName].visibility = "visible";
+			}
+		}
+	else {
+		if (this.popupWindow == null || this.popupWindow.closed) {
+			// If the popup window will go off-screen, move it so it doesn't
+			if (this.x<0) { this.x=0; }
+			if (this.y<0) { this.y=0; }
+			if (screen && screen.availHeight) {
+				if ((this.y + this.height) > screen.availHeight) {
+					this.y = screen.availHeight - this.height;
+					}
+				}
+			if (screen && screen.availWidth) {
+				if ((this.x + this.width) > screen.availWidth) {
+					this.x = screen.availWidth - this.width;
+					}
+				}
+			var avoidAboutBlank = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled );
+			this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"");
+			}
+		this.refresh();
+		}
+	}
+// Hide the popup
+function PopupWindow_hidePopup() {
+	if (this.divName != null) {
+		if (this.use_gebi) {
+			document.getElementById(this.divName).style.visibility = "hidden";
+			}
+		else if (this.use_css) {
+			document.all[this.divName].style.visibility = "hidden";
+			}
+		else if (this.use_layers) {
+			document.layers[this.divName].visibility = "hidden";
+			}
+		}
+	else {
+		if (this.popupWindow && !this.popupWindow.closed) {
+			this.popupWindow.close();
+			this.popupWindow = null;
+			}
+		}
+	}
+// Pass an event and return whether or not it was the popup DIV that was clicked
+function PopupWindow_isClicked(e) {
+	if (this.divName != null) {
+		if (this.use_layers) {
+			var clickX = e.pageX;
+			var clickY = e.pageY;
+			var t = document.layers[this.divName];
+			if ((clickX > t.left) && (clickX < t.left+t.clip.width) && (clickY > t.top) && (clickY < t.top+t.clip.height)) {
+				return true;
+				}
+			else { return false; }
+			}
+		else if (document.all) { // Need to hard-code this to trap IE for error-handling
+			var t = window.event.srcElement;
+			while (t.parentElement != null) {
+				if (t.id==this.divName) {
+					return true;
+					}
+				t = t.parentElement;
+				}
+			return false;
+			}
+		else if (this.use_gebi && e) {
+			var t = e.originalTarget;
+			while (t.parentNode != null) {
+				if (t.id==this.divName) {
+					return true;
+					}
+				t = t.parentNode;
+				}
+			return false;
+			}
+		return false;
+		}
+	return false;
+	}
+
+// Check an onMouseDown event to see if we should hide
+function PopupWindow_hideIfNotClicked(e) {
+	if (this.autoHideEnabled && !this.isClicked(e)) {
+		this.hidePopup();
+		}
+	}
+// Call this to make the DIV disable automatically when mouse is clicked outside it
+function PopupWindow_autoHide() {
+	this.autoHideEnabled = true;
+	}
+// This global function checks all PopupWindow objects onmouseup to see if they should be hidden
+function PopupWindow_hidePopupWindows(e) {
+	for (var i=0; i<popupWindowObjects.length; i++) {
+		if (popupWindowObjects[i] != null) {
+			var p = popupWindowObjects[i];
+			p.hideIfNotClicked(e);
+			}
+		}
+	}
+// Run this immediately to attach the event listener
+function PopupWindow_attachListener() {
+	if (document.layers) {
+		document.captureEvents(Event.MOUSEUP);
+		}
+	window.popupWindowOldEventListener = document.onmouseup;
+	if (window.popupWindowOldEventListener != null) {
+		document.onmouseup = new Function("window.popupWindowOldEventListener(); PopupWindow_hidePopupWindows();");
+		}
+	else {
+		document.onmouseup = PopupWindow_hidePopupWindows;
+		}
+	}
+// CONSTRUCTOR for the PopupWindow object
+// Pass it a DIV name to use a DHTML popup, otherwise will default to window popup
+function PopupWindow() {
+	if (!window.popupWindowIndex) { window.popupWindowIndex = 0; }
+	if (!window.popupWindowObjects) { window.popupWindowObjects = new Array(); }
+	if (!window.listenerAttached) {
+		window.listenerAttached = true;
+		PopupWindow_attachListener();
+		}
+	this.index = popupWindowIndex++;
+	popupWindowObjects[this.index] = this;
+	this.divName = null;
+	this.popupWindow = null;
+	this.width=0;
+	this.height=0;
+	this.populated = false;
+	this.visible = false;
+	this.autoHideEnabled = false;
+	
+	this.contents = "";
+	this.url="";
+	this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";
+	if (arguments.length>0) {
+		this.type="DIV";
+		this.divName = arguments[0];
+		}
+	else {
+		this.type="WINDOW";
+		}
+	this.use_gebi = false;
+	this.use_css = false;
+	this.use_layers = false;
+	if (document.getElementById) { this.use_gebi = true; }
+	else if (document.all) { this.use_css = true; }
+	else if (document.layers) { this.use_layers = true; }
+	else { this.type = "WINDOW"; }
+	this.offsetX = 0;
+	this.offsetY = 0;
+	// Method mappings
+	this.getXYPosition = PopupWindow_getXYPosition;
+	this.populate = PopupWindow_populate;
+	this.setUrl = PopupWindow_setUrl;
+	this.setWindowProperties = PopupWindow_setWindowProperties;
+	this.refresh = PopupWindow_refresh;
+	this.showPopup = PopupWindow_showPopup;
+	this.hidePopup = PopupWindow_hidePopup;
+	this.setSize = PopupWindow_setSize;
+	this.isClicked = PopupWindow_isClicked;
+	this.autoHide = PopupWindow_autoHide;
+	this.hideIfNotClicked = PopupWindow_hideIfNotClicked;
+	}

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/PopupWindow.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/README.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/README.txt?rev=413547&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/README.txt (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/README.txt Sun Jun 11 16:24:48 2006
@@ -0,0 +1,3 @@
+This directory contains the original unpacked JS files that are combined and packed in "mattkruse-lib.js" for reference.
+
+If you add more scripts from this site, please add them here too.

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/date.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/date.js?rev=413547&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/date.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/date.js Sun Jun 11 16:24:48 2006
@@ -0,0 +1,335 @@
+// ===================================================================
+// Author: Matt Kruse <ma...@mattkruse.com>
+// WWW: http://www.mattkruse.com/
+//
+// NOTICE: You may use this code for any purpose, commercial or
+// private, without any further permission from the author. You may
+// remove this notice from your final code if you wish, however it is
+// appreciated by the author if at least my web site address is kept.
+//
+// You may *NOT* re-distribute this code in any way except through its
+// use. That means, you can include it in your product, or your web
+// site, or any other form where the code is actually being used. You
+// may not put the plain javascript up on your site for download or
+// include it in your javascript libraries for download. 
+// If you wish to share this code with others, please just point them
+// to the URL instead.
+// Please DO NOT link directly to my .js files from your site. Copy
+// the files to your server and use them there. Thank you.
+// ===================================================================
+
+// HISTORY
+// ------------------------------------------------------------------
+// May 17, 2003: Fixed bug in parseDate() for dates <1970
+// March 11, 2003: Added parseDate() function
+// March 11, 2003: Added "NNN" formatting option. Doesn't match up
+//                 perfectly with SimpleDateFormat formats, but 
+//                 backwards-compatability was required.
+
+// ------------------------------------------------------------------
+// These functions use the same 'format' strings as the 
+// java.text.SimpleDateFormat class, with minor exceptions.
+// The format string consists of the following abbreviations:
+// 
+// Field        | Full Form          | Short Form
+// -------------+--------------------+-----------------------
+// Year         | yyyy (4 digits)    | yy (2 digits), y (2 or 4 digits)
+// Month        | MMM (name or abbr.)| MM (2 digits), M (1 or 2 digits)
+//              | NNN (abbr.)        |
+// Day of Month | dd (2 digits)      | d (1 or 2 digits)
+// Day of Week  | EE (name)          | E (abbr)
+// Hour (1-12)  | hh (2 digits)      | h (1 or 2 digits)
+// Hour (0-23)  | HH (2 digits)      | H (1 or 2 digits)
+// Hour (0-11)  | KK (2 digits)      | K (1 or 2 digits)
+// Hour (1-24)  | kk (2 digits)      | k (1 or 2 digits)
+// Minute       | mm (2 digits)      | m (1 or 2 digits)
+// Second       | ss (2 digits)      | s (1 or 2 digits)
+// AM/PM        | a                  |
+//
+// NOTE THE DIFFERENCE BETWEEN MM and mm! Month=MM, not mm!
+// Examples:
+//  "MMM d, y" matches: January 01, 2000
+//                      Dec 1, 1900
+//                      Nov 20, 00
+//  "M/d/yy"   matches: 01/20/00
+//                      9/2/00
+//  "MMM dd, yyyy hh:mm:ssa" matches: "January 01, 2000 12:30:45AM"
+// ------------------------------------------------------------------
+
+var MONTH_NAMES=new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
+var DAY_NAMES=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sun','Mon','Tue','Wed','Thu','Fri','Sat');
+function LZ(x) {return(x<0||x>9?"":"0")+x}
+
+// ------------------------------------------------------------------
+// isDate ( date_string, format_string )
+// Returns true if date string matches format of format string and
+// is a valid date. Else returns false.
+// It is recommended that you trim whitespace around the value before
+// passing it to this function, as whitespace is NOT ignored!
+// ------------------------------------------------------------------
+function isDate(val,format) {
+	var date=getDateFromFormat(val,format);
+	if (date==0) { return false; }
+	return true;
+	}
+
+// -------------------------------------------------------------------
+// compareDates(date1,date1format,date2,date2format)
+//   Compare two date strings to see which is greater.
+//   Returns:
+//   1 if date1 is greater than date2
+//   0 if date2 is greater than date1 of if they are the same
+//  -1 if either of the dates is in an invalid format
+// -------------------------------------------------------------------
+function compareDates(date1,dateformat1,date2,dateformat2) {
+	var d1=getDateFromFormat(date1,dateformat1);
+	var d2=getDateFromFormat(date2,dateformat2);
+	if (d1==0 || d2==0) {
+		return -1;
+		}
+	else if (d1 > d2) {
+		return 1;
+		}
+	return 0;
+	}
+
+// ------------------------------------------------------------------
+// formatDate (date_object, format)
+// Returns a date in the output format specified.
+// The format string uses the same abbreviations as in getDateFromFormat()
+// ------------------------------------------------------------------
+function formatDate(date,format) {
+	format=format+"";
+	var result="";
+	var i_format=0;
+	var c="";
+	var token="";
+	var y=date.getYear()+"";
+	var M=date.getMonth()+1;
+	var d=date.getDate();
+	var E=date.getDay();
+	var H=date.getHours();
+	var m=date.getMinutes();
+	var s=date.getSeconds();
+	var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;
+	// Convert real date parts into formatted versions
+	var value=new Object();
+	if (y.length < 4) {y=""+(y-0+1900);}
+	value["y"]=""+y;
+	value["yyyy"]=y;
+	value["yy"]=y.substring(2,4);
+	value["M"]=M;
+	value["MM"]=LZ(M);
+	value["MMM"]=MONTH_NAMES[M-1];
+	value["NNN"]=MONTH_NAMES[M+11];
+	value["d"]=d;
+	value["dd"]=LZ(d);
+	value["E"]=DAY_NAMES[E+7];
+	value["EE"]=DAY_NAMES[E];
+	value["H"]=H;
+	value["HH"]=LZ(H);
+	if (H==0){value["h"]=12;}
+	else if (H>12){value["h"]=H-12;}
+	else {value["h"]=H;}
+	value["hh"]=LZ(value["h"]);
+	if (H>11){value["K"]=H-12;} else {value["K"]=H;}
+	value["k"]=H+1;
+	value["KK"]=LZ(value["K"]);
+	value["kk"]=LZ(value["k"]);
+	if (H > 11) { value["a"]="PM"; }
+	else { value["a"]="AM"; }
+	value["m"]=m;
+	value["mm"]=LZ(m);
+	value["s"]=s;
+	value["ss"]=LZ(s);
+	while (i_format < format.length) {
+		c=format.charAt(i_format);
+		token="";
+		while ((format.charAt(i_format)==c) && (i_format < format.length)) {
+			token += format.charAt(i_format++);
+			}
+		if (value[token] != null) { result=result + value[token]; }
+		else { result=result + token; }
+		}
+	return result;
+	}
+	
+// ------------------------------------------------------------------
+// Utility functions for parsing in getDateFromFormat()
+// ------------------------------------------------------------------
+function _isInteger(val) {
+	var digits="1234567890";
+	for (var i=0; i < val.length; i++) {
+		if (digits.indexOf(val.charAt(i))==-1) { return false; }
+		}
+	return true;
+	}
+function _getInt(str,i,minlength,maxlength) {
+	for (var x=maxlength; x>=minlength; x--) {
+		var token=str.substring(i,i+x);
+		if (token.length < minlength) { return null; }
+		if (_isInteger(token)) { return token; }
+		}
+	return null;
+	}
+	
+// ------------------------------------------------------------------
+// getDateFromFormat( date_string , format_string )
+//
+// This function takes a date string and a format string. It matches
+// If the date string matches the format string, it returns the 
+// getTime() of the date. If it does not match, it returns 0.
+// ------------------------------------------------------------------
+function getDateFromFormat(val,format) {
+	val=val+"";
+	format=format+"";
+	var i_val=0;
+	var i_format=0;
+	var c="";
+	var token="";
+	var token2="";
+	var x,y;
+	var now=new Date();
+	var year=now.getYear();
+	var month=now.getMonth()+1;
+	var date=1;
+	var hh=now.getHours();
+	var mm=now.getMinutes();
+	var ss=now.getSeconds();
+	var ampm="";
+	
+	while (i_format < format.length) {
+		// Get next token from format string
+		c=format.charAt(i_format);
+		token="";
+		while ((format.charAt(i_format)==c) && (i_format < format.length)) {
+			token += format.charAt(i_format++);
+			}
+		// Extract contents of value based on format token
+		if (token=="yyyy" || token=="yy" || token=="y") {
+			if (token=="yyyy") { x=4;y=4; }
+			if (token=="yy")   { x=2;y=2; }
+			if (token=="y")    { x=2;y=4; }
+			year=_getInt(val,i_val,x,y);
+			if (year==null) { return 0; }
+			i_val += year.length;
+			if (year.length==2) {
+				if (year > 70) { year=1900+(year-0); }
+				else { year=2000+(year-0); }
+				}
+			}
+		else if (token=="MMM"||token=="NNN"){
+			month=0;
+			for (var i=0; i<MONTH_NAMES.length; i++) {
+				var month_name=MONTH_NAMES[i];
+				if (val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()) {
+					if (token=="MMM"||(token=="NNN"&&i>11)) {
+						month=i+1;
+						if (month>12) { month -= 12; }
+						i_val += month_name.length;
+						break;
+						}
+					}
+				}
+			if ((month < 1)||(month>12)){return 0;}
+			}
+		else if (token=="EE"||token=="E"){
+			for (var i=0; i<DAY_NAMES.length; i++) {
+				var day_name=DAY_NAMES[i];
+				if (val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()) {
+					i_val += day_name.length;
+					break;
+					}
+				}
+			}
+		else if (token=="MM"||token=="M") {
+			month=_getInt(val,i_val,token.length,2);
+			if(month==null||(month<1)||(month>12)){return 0;}
+			i_val+=month.length;}
+		else if (token=="dd"||token=="d") {
+			date=_getInt(val,i_val,token.length,2);
+			if(date==null||(date<1)||(date>31)){return 0;}
+			i_val+=date.length;}
+		else if (token=="hh"||token=="h") {
+			hh=_getInt(val,i_val,token.length,2);
+			if(hh==null||(hh<1)||(hh>12)){return 0;}
+			i_val+=hh.length;}
+		else if (token=="HH"||token=="H") {
+			hh=_getInt(val,i_val,token.length,2);
+			if(hh==null||(hh<0)||(hh>23)){return 0;}
+			i_val+=hh.length;}
+		else if (token=="KK"||token=="K") {
+			hh=_getInt(val,i_val,token.length,2);
+			if(hh==null||(hh<0)||(hh>11)){return 0;}
+			i_val+=hh.length;}
+		else if (token=="kk"||token=="k") {
+			hh=_getInt(val,i_val,token.length,2);
+			if(hh==null||(hh<1)||(hh>24)){return 0;}
+			i_val+=hh.length;hh--;}
+		else if (token=="mm"||token=="m") {
+			mm=_getInt(val,i_val,token.length,2);
+			if(mm==null||(mm<0)||(mm>59)){return 0;}
+			i_val+=mm.length;}
+		else if (token=="ss"||token=="s") {
+			ss=_getInt(val,i_val,token.length,2);
+			if(ss==null||(ss<0)||(ss>59)){return 0;}
+			i_val+=ss.length;}
+		else if (token=="a") {
+			if (val.substring(i_val,i_val+2).toLowerCase()=="am") {ampm="AM";}
+			else if (val.substring(i_val,i_val+2).toLowerCase()=="pm") {ampm="PM";}
+			else {return 0;}
+			i_val+=2;}
+		else {
+			if (val.substring(i_val,i_val+token.length)!=token) {return 0;}
+			else {i_val+=token.length;}
+			}
+		}
+	// If there are any trailing characters left in the value, it doesn't match
+	if (i_val != val.length) { return 0; }
+	// Is date valid for month?
+	if (month==2) {
+		// Check for leap year
+		if ( ( (year%4==0)&&(year%100 != 0) ) || (year%400==0) ) { // leap year
+			if (date > 29){ return 0; }
+			}
+		else { if (date > 28) { return 0; } }
+		}
+	if ((month==4)||(month==6)||(month==9)||(month==11)) {
+		if (date > 30) { return 0; }
+		}
+	// Correct hours value
+	if (hh<12 && ampm=="PM") { hh=hh-0+12; }
+	else if (hh>11 && ampm=="AM") { hh-=12; }
+	var newdate=new Date(year,month-1,date,hh,mm,ss);
+	return newdate.getTime();
+	}
+
+// ------------------------------------------------------------------
+// parseDate( date_string [, prefer_euro_format] )
+//
+// This function takes a date string and tries to match it to a
+// number of possible date formats to get the value. It will try to
+// match against the following international formats, in this order:
+// y-M-d   MMM d, y   MMM d,y   y-MMM-d   d-MMM-y  MMM d
+// M/d/y   M-d-y      M.d.y     MMM-d     M/d      M-d
+// d/M/y   d-M-y      d.M.y     d-MMM     d/M      d-M
+// A second argument may be passed to instruct the method to search
+// for formats like d/M/y (european format) before M/d/y (American).
+// Returns a Date object or null if no patterns match.
+// ------------------------------------------------------------------
+function parseDate(val) {
+	var preferEuro=(arguments.length==2)?arguments[1]:false;
+	generalFormats=new Array('y-M-d','MMM d, y','MMM d,y','y-MMM-d','d-MMM-y','MMM d');
+	monthFirst=new Array('M/d/y','M-d-y','M.d.y','MMM-d','M/d','M-d');
+	dateFirst =new Array('d/M/y','d-M-y','d.M.y','d-MMM','d/M','d-M');
+	var checkList=new Array('generalFormats',preferEuro?'dateFirst':'monthFirst',preferEuro?'monthFirst':'dateFirst');
+	var d=null;
+	for (var i=0; i<checkList.length; i++) {
+		var l=window[checkList[i]];
+		for (var j=0; j<l.length; j++) {
+			d=getDateFromFormat(val,l[j]);
+			if (d!=0) { return new Date(d); }
+			}
+		}
+	return null;
+	}

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/date.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/selectbox.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/selectbox.js?rev=413547&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/selectbox.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/selectbox.js Sun Jun 11 16:24:48 2006
@@ -0,0 +1,315 @@
+// ===================================================================
+// Author: Matt Kruse <ma...@mattkruse.com>
+// WWW: http://www.mattkruse.com/
+//
+// NOTICE: You may use this code for any purpose, commercial or
+// private, without any further permission from the author. You may
+// remove this notice from your final code if you wish, however it is
+// appreciated by the author if at least my web site address is kept.
+//
+// You may *NOT* re-distribute this code in any way except through its
+// use. That means, you can include it in your product, or your web
+// site, or any other form where the code is actually being used. You
+// may not put the plain javascript up on your site for download or
+// include it in your javascript libraries for download. 
+// If you wish to share this code with others, please just point them
+// to the URL instead.
+// Please DO NOT link directly to my .js files from your site. Copy
+// the files to your server and use them there. Thank you.
+// ===================================================================
+
+// HISTORY
+// ------------------------------------------------------------------
+// June 12, 2003: Modified up and down functions to support more than
+//                selected option
+/*
+DESCRIPTION: These are general functions to deal with and manipulate
+select boxes. Also see the OptionTransfer library to more easily 
+handle transferring options between two lists
+
+COMPATIBILITY: These are fairly basic functions - they should work on
+all browsers that support Javascript.
+*/
+
+// -------------------------------------------------------------------
+// selectUnselectMatchingOptions(select_object,regex,select/unselect,true/false)
+//  This is a general function used by the select functions below, to
+//  avoid code duplication
+// -------------------------------------------------------------------
+function selectUnselectMatchingOptions(obj,regex,which,only) {
+	if (window.RegExp) {
+		if (which == "select") {
+			var selected1=true;
+			var selected2=false;
+			}
+		else if (which == "unselect") {
+			var selected1=false;
+			var selected2=true;
+			}
+		else {
+			return;
+			}
+		var re = new RegExp(regex);
+		for (var i=0; i<obj.options.length; i++) {
+			if (re.test(obj.options[i].text)) {
+				obj.options[i].selected = selected1;
+				}
+			else {
+				if (only == true) {
+					obj.options[i].selected = selected2;
+					}
+				}
+			}
+		}
+	}
+		
+// -------------------------------------------------------------------
+// selectMatchingOptions(select_object,regex)
+//  This function selects all options that match the regular expression
+//  passed in. Currently-selected options will not be changed.
+// -------------------------------------------------------------------
+function selectMatchingOptions(obj,regex) {
+	selectUnselectMatchingOptions(obj,regex,"select",false);
+	}
+// -------------------------------------------------------------------
+// selectOnlyMatchingOptions(select_object,regex)
+//  This function selects all options that match the regular expression
+//  passed in. Selected options that don't match will be un-selected.
+// -------------------------------------------------------------------
+function selectOnlyMatchingOptions(obj,regex) {
+	selectUnselectMatchingOptions(obj,regex,"select",true);
+	}
+// -------------------------------------------------------------------
+// unSelectMatchingOptions(select_object,regex)
+//  This function Unselects all options that match the regular expression
+//  passed in. 
+// -------------------------------------------------------------------
+function unSelectMatchingOptions(obj,regex) {
+	selectUnselectMatchingOptions(obj,regex,"unselect",false);
+	}
+	
+// -------------------------------------------------------------------
+// sortSelect(select_object)
+//   Pass this function a SELECT object and the options will be sorted
+//   by their text (display) values
+// -------------------------------------------------------------------
+function sortSelect(obj) {
+	var o = new Array();
+	if (obj.options==null) { return; }
+	for (var i=0; i<obj.options.length; i++) {
+		o[o.length] = new Option( obj.options[i].text, obj.options[i].value, obj.options[i].defaultSelected, obj.options[i].selected) ;
+		}
+	if (o.length==0) { return; }
+	o = o.sort( 
+		function(a,b) { 
+			if ((a.text+"") < (b.text+"")) { return -1; }
+			if ((a.text+"") > (b.text+"")) { return 1; }
+			return 0;
+			} 
+		);
+
+	for (var i=0; i<o.length; i++) {
+		obj.options[i] = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected);
+		}
+	}
+
+// -------------------------------------------------------------------
+// selectAllOptions(select_object)
+//  This function takes a select box and selects all options (in a 
+//  multiple select object). This is used when passing values between
+//  two select boxes. Select all options in the right box before 
+//  submitting the form so the values will be sent to the server.
+// -------------------------------------------------------------------
+function selectAllOptions(obj) {
+	for (var i=0; i<obj.options.length; i++) {
+		obj.options[i].selected = true;
+		}
+	}
+	
+// -------------------------------------------------------------------
+// moveSelectedOptions(select_object,select_object[,autosort(true/false)[,regex]])
+//  This function moves options between select boxes. Works best with
+//  multi-select boxes to create the common Windows control effect.
+//  Passes all selected values from the first object to the second
+//  object and re-sorts each box.
+//  If a third argument of 'false' is passed, then the lists are not
+//  sorted after the move.
+//  If a fourth string argument is passed, this will function as a
+//  Regular Expression to match against the TEXT or the options. If 
+//  the text of an option matches the pattern, it will NOT be moved.
+//  It will be treated as an unmoveable option.
+//  You can also put this into the <SELECT> object as follows:
+//    onDblClick="moveSelectedOptions(this,this.form.target)
+//  This way, when the user double-clicks on a value in one box, it
+//  will be transferred to the other (in browsers that support the 
+//  onDblClick() event handler).
+// -------------------------------------------------------------------
+function moveSelectedOptions(from,to) {
+	// Unselect matching options, if required
+	if (arguments.length>3) {
+		var regex = arguments[3];
+		if (regex != "") {
+			unSelectMatchingOptions(from,regex);
+			}
+		}
+	// Move them over
+	for (var i=0; i<from.options.length; i++) {
+		var o = from.options[i];
+		if (o.selected) {
+			to.options[to.options.length] = new Option( o.text, o.value, false, false);
+			}
+		}
+	// Delete them from original
+	for (var i=(from.options.length-1); i>=0; i--) {
+		var o = from.options[i];
+		if (o.selected) {
+			from.options[i] = null;
+			}
+		}
+	if ((arguments.length<3) || (arguments[2]==true)) {
+		sortSelect(from);
+		sortSelect(to);
+		}
+	from.selectedIndex = -1;
+	to.selectedIndex = -1;
+	}
+
+// -------------------------------------------------------------------
+// copySelectedOptions(select_object,select_object[,autosort(true/false)])
+//  This function copies options between select boxes instead of 
+//  moving items. Duplicates in the target list are not allowed.
+// -------------------------------------------------------------------
+function copySelectedOptions(from,to) {
+	var options = new Object();
+	for (var i=0; i<to.options.length; i++) {
+		options[to.options[i].value] = to.options[i].text;
+		}
+	for (var i=0; i<from.options.length; i++) {
+		var o = from.options[i];
+		if (o.selected) {
+			if (options[o.value] == null || options[o.value] == "undefined" || options[o.value]!=o.text) {
+				to.options[to.options.length] = new Option( o.text, o.value, false, false);
+				}
+			}
+		}
+	if ((arguments.length<3) || (arguments[2]==true)) {
+		sortSelect(to);
+		}
+	from.selectedIndex = -1;
+	to.selectedIndex = -1;
+	}
+
+// -------------------------------------------------------------------
+// moveAllOptions(select_object,select_object[,autosort(true/false)[,regex]])
+//  Move all options from one select box to another.
+// -------------------------------------------------------------------
+function moveAllOptions(from,to) {
+	selectAllOptions(from);
+	if (arguments.length==2) {
+		moveSelectedOptions(from,to);
+		}
+	else if (arguments.length==3) {
+		moveSelectedOptions(from,to,arguments[2]);
+		}
+	else if (arguments.length==4) {
+		moveSelectedOptions(from,to,arguments[2],arguments[3]);
+		}
+	}
+
+// -------------------------------------------------------------------
+// copyAllOptions(select_object,select_object[,autosort(true/false)])
+//  Copy all options from one select box to another, instead of
+//  removing items. Duplicates in the target list are not allowed.
+// -------------------------------------------------------------------
+function copyAllOptions(from,to) {
+	selectAllOptions(from);
+	if (arguments.length==2) {
+		copySelectedOptions(from,to);
+		}
+	else if (arguments.length==3) {
+		copySelectedOptions(from,to,arguments[2]);
+		}
+	}
+
+// -------------------------------------------------------------------
+// swapOptions(select_object,option1,option2)
+//  Swap positions of two options in a select list
+// -------------------------------------------------------------------
+function swapOptions(obj,i,j) {
+	var o = obj.options;
+	var i_selected = o[i].selected;
+	var j_selected = o[j].selected;
+	var temp = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected);
+	var temp2= new Option(o[j].text, o[j].value, o[j].defaultSelected, o[j].selected);
+	o[i] = temp2;
+	o[j] = temp;
+	o[i].selected = j_selected;
+	o[j].selected = i_selected;
+	}
+	
+// -------------------------------------------------------------------
+// moveOptionUp(select_object)
+//  Move selected option in a select list up one
+// -------------------------------------------------------------------
+function moveOptionUp(obj) {
+	for (i=0; i<obj.options.length; i++) {
+		if (obj.options[i].selected) {
+			if (i != 0 && !obj.options[i-1].selected) {
+				swapOptions(obj,i,i-1);
+				obj.options[i-1].selected = true;
+				}
+			}
+		}
+	}
+
+// -------------------------------------------------------------------
+// moveOptionDown(select_object)
+//  Move selected option in a select list down one
+// -------------------------------------------------------------------
+function moveOptionDown(obj) {
+	for (i=obj.options.length-1; i>=0; i--) {
+		if (obj.options[i].selected) {
+			if (i != (obj.options.length-1) && ! obj.options[i+1].selected) {
+				swapOptions(obj,i,i+1);
+				obj.options[i+1].selected = true;
+				}
+			}
+		}
+	}
+
+// -------------------------------------------------------------------
+// removeSelectedOptions(select_object)
+//  Remove all selected options from a list
+//  (Thanks to Gene Ninestein)
+// -------------------------------------------------------------------
+function removeSelectedOptions(from) { 
+	for (var i=(from.options.length-1); i>=0; i--) { 
+		var o=from.options[i]; 
+		if (o.selected) { 
+			from.options[i] = null; 
+			} 
+		} 
+	from.selectedIndex = -1; 
+	} 
+
+// -------------------------------------------------------------------
+// removeAllOptions(select_object)
+//  Remove all options from a list
+// -------------------------------------------------------------------
+function removeAllOptions(from) { 
+	for (var i=(from.options.length-1); i>=0; i--) { 
+		from.options[i] = null; 
+		} 
+	from.selectedIndex = -1; 
+	} 
+
+// -------------------------------------------------------------------
+// addOption(select_object,display_text,value,selected)
+//  Add an option to a list
+// -------------------------------------------------------------------
+function addOption(obj,text,value,selected) {
+	if (obj!=null && obj.options!=null) {
+		obj.options[obj.options.length] = new Option(text, value, false, selected);
+		}
+	}
+

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/mattkruse-lib/selectbox.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/module.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/module.xml?rev=413547&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/module.xml (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/module.xml Sun Jun 11 16:24:48 2006
@@ -0,0 +1,32 @@
+<module id="form" name="Form">
+<version>1.3</version>
+<content>All</content>
+<description>Handles forms.</description>
+<usage>
+=== post.xsp
+Creates XML from POST data.
+<map:generate type="serverpages" src="module://form/post.xsp"/>
+
+=== formfixer.xsl
+Adds the language to the ACTION for i18n-compatible URLs with CForms.
+
+=== forms-samples-styling.xsl
+From the Cocoon "form" block.
+Adds formatting to a form
+
+=== XMAP Usage of formfixer.xsl and forms-sampling.xsl
+
+To Generate the Form:
+<map:generate src="CForms-Template.xml"/>
+<map:transform type="forms"/>
+<map:transform src="module://form/formfixer.xsl">
+   <map:parameter name="language" value="{page-envelope:document-language}"/>
+</map:transform>
+<map:transform src="module://form/forms-samples-styling.xsl"/>
+
+For Continuation:
+<map:match pattern="**/*_*.more">
+   <map:call continuation="{2}"/>
+</map:match>
+</usage>
+</module>
\ No newline at end of file

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/module.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/move_down.gif
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/move_down.gif?rev=413547&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/move_down.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/move_up.gif
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/move_up.gif?rev=413547&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/move_up.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/new.gif
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/new.gif?rev=413547&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/new.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/post.xsp
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/post.xsp?rev=413547&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/post.xsp (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/post.xsp Sun Jun 11 16:24:48 2006
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsp:page language="java" xmlns:xsp="http://apache.org/xsp" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsp:structure><xsp:include>java.util.*</xsp:include></xsp:structure>
+<form><xsp:logic>
+	Enumeration pns = request.getParameterNames();
+while(pns.hasMoreElements()){
+	String pn = (String) pns.nextElement(); 
+	String pv = request.getParameter(pn);
+</xsp:logic><field><xsp:attribute name="name"><xsp:expr>pn</xsp:expr></xsp:attribute><xsp:expr>pv</xsp:expr></field><xsp:logic>
+}
+</xsp:logic></form></xsp:page>

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/post.xsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/module.xmap?rev=413547&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/module.xmap (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/module.xmap Sun Jun 11 16:24:48 2006
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Homepage Module -->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+  <map:views>
+    <map:view name="debug" from-label="debug">
+       <map:serialize type="xml"/>
+    </map:view> 
+  </map:views>
+
+<!-- ************************************************************** -->
+   <map:pipelines>
+      <map:pipeline type="noncaching">
+         <map:match pattern="**">
+            <map:match pattern="**/">
+               <map:redirect-to uri="index.html"  session="false"/>
+            </map:match>
+            <!-- Get the current document -->
+            <map:match pattern="*/cocoon/**">
+               <map:aggregate element="cmsbody">
+                  <map:part src="cocoon://{page-envelope:publication-id}/session/info"/>
+                  <map:part src="cocoon://{page-envelope:publication-id}/navigation/breadcrumb{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{page-envelope:publication-id}/navigation/tabs{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{page-envelope:publication-id}/navigation/menu{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{page-envelope:publication-id}/navigation/search{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{page-envelope:publication-id}/xhtml/view/live/index_{page-envelope:document-language}.html"/>
+               </map:aggregate>
+               <map:transform type="i18n" label="debug">
+                  <map:parameter name="locale" value="{page-envelope:document-language}"/>
+               </map:transform>
+               <map:transform src="module:///page2xhtml.xsl" label="debug">
+                 <map:parameter name="root" value="{page-envelope:context-prefix}/{page-envelope:publication-id}/live"/>
+                 <map:parameter name="url" value="{2}"/>
+                 <map:parameter name="document-id" value="{page-envelope:document-id}"/>
+                 <map:parameter name="document-name" value="{page-envelope:document-name}"/>
+                 <map:parameter name="document-type" value="{page-envelope:document-type}"/>
+                 <map:parameter name="language" value="{page-envelope:document-language}"/>
+                 <map:parameter name="querystring" value="{request:queryString}"/>
+               </map:transform>
+               <map:transform type="i18n" label="debug">
+                  <map:parameter name="locale" value="{page-envelope:document-language}"/>
+               </map:transform>
+               <map:serialize type="html"/>
+             </map:match>
+<!-- HACK: Could not get just language from locale -->
+            <map:match pattern="*/index_*_*.*">
+                <map:redirect-to uri="index_{2}.{4}"  session="false"/>
+            </map:match>
+            <map:match pattern="*/index_*.*">
+<!-- Valid URL -->
+               <map:act type="resource-exists" src="module://cache">
+                  <map:mount uri-prefix="" src="module://cache/module.xmap"/> 
+                  <map:serialize type="html"/>
+               </map:act>
+               <map:generate src="cocoon:/{module:module}/cocoon/{page-envelope:publication-id}/{page-envelope:document-type}/view/{page-envelope:area}/index_{page-envelope:document-language}.xml"/>
+               <map:serialize type="html"/>
+            </map:match>
+<!-- Default: Add Language -->
+        <map:select type="parameter">
+           <map:parameter name="parameter-selector-test" value="{request:locale}"/>
+           <map:when test="">
+           </map:when>
+           <map:otherwise>
+             <map:redirect-to uri="index_{request:locale}.html"  session="false"/>
+<!-- BROKEN  <map:redirect-to uri="index_{session:substring({request:locale},1, 2)}.html"  session="false"/> -->
+          </map:otherwise>
+        </map:select>
+         <map:select type="parameter">
+             <map:parameter name="parameter-selector-test" value="{page-envelope:default-language}"/>
+             <map:when test="">
+             </map:when>
+             <map:otherwise>
+                <map:redirect-to uri="index_{page-envelope:default-language}.html"  session="false"/>
+              </map:otherwise>
+           </map:select>
+           <map:redirect-to uri="index_en.html" session="false"/>
+         </map:match>
+      </map:pipeline>
+   </map:pipelines>
+</map:sitemap>

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/module.xmap
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/page2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/page2xhtml.xsl?rev=413547&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/page2xhtml.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/page2xhtml.xsl Sun Jun 11 16:24:48 2006
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  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.
+-->
+
+<!-- $Id: page2xhtml.xsl 170255 2005-05-15 19:58:26Z gregor $ -->
+
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:xhtml="http://www.w3.org/1999/xhtml"
+    xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
+    xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" 
+    xmlns:dc="http://purl.org/dc/elements/1.1/"
+    xmlns:dcterms="http://purl.org/dc/terms/"
+    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+    exclude-result-prefixes="page xhtml"
+    >
+    
+    
+<!-- {context-prefix}/{publication-id}/{area} -->
+<xsl:param name="root"/>
+
+<xsl:param name="document-id"/>
+
+<!-- i.e. doctypes/xhtml-document -->
+<xsl:param name="document-type"/>
+
+<!-- The rquest url i.e. /lenya/doctypes/xhtml-document_en.html -->
+<xsl:param name="url"/>
+
+<xsl:param name="language"/>
+
+
+<xsl:template match="cmsbody">
+  <html>
+    <head>
+      <link rel="stylesheet" href="{$root}/css/page.css" type="text/css"/>
+      <meta content="Apache Lenya" name="generator"/>
+      <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
+      <title><xsl:value-of select="//lenya:meta/dc:title"/></title>
+    </head>	
+    <body>
+      <div id="page">
+      <table width="100%" cellpadding="0" cellspacing="0" border="0">
+        <tr>
+          <td id="publication-title">
+            <xsl:choose>
+              <xsl:when test="$language = 'de'">
+	        Willkommen zur Default Publikation!
+              </xsl:when>
+              <xsl:otherwise>
+	        Welcome to the Default Publication!
+              </xsl:otherwise>
+	    </xsl:choose>
+          </td>
+          <td id="project-logo"><img src="{$root}/images/project-logo.png" alt="project logo"/></td>
+        </tr>
+      </table>
+      <xsl:apply-templates select="xhtml:div[@id = 'tabs']"/>
+      <table width="100%" border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td valign="top">
+            <xsl:apply-templates select="xhtml:div[@id = 'menu']"/>
+          </td>
+          <td valign="top">
+            <div id="main">
+              <xsl:apply-templates select="xhtml:div[@id = 'breadcrumb']"/>
+              <xsl:apply-templates select="xhtml:div[@id = 'search']"/>
+              <xsl:apply-templates select="xhtml:html/xhtml:div[@id = 'body']"/>
+            </div>
+          </td>
+        </tr>
+        <tr>
+          <td colspan="2" valign="top">
+            <div id="footer">
+              <xsl:apply-templates select="lenya:meta/dcterms:modified"/>
+              <xsl:apply-templates select="lenya:meta/dc:publisher"/>
+            </div>
+          </td>
+        </tr>
+      </table>
+      </div>
+    </body>
+  </html>
+</xsl:template>
+
+<xsl:template match="dcterms:modified">
+  <xsl:variable name="date"><xsl:value-of select="."/></xsl:variable>
+  <i18n:text>last_published</i18n:text>:
+    <xsl:if test="$date!=''">
+    <i18n:date-time src-pattern="yyyy-MM-dd HH:mm:ss" pattern="EEE, d MMM yyyy HH:mm:ss z" value="{$date}"/> 
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="dc:publisher">
+  <xsl:variable name="user"><xsl:value-of select="."/></xsl:variable>
+  <xsl:variable name="user-id"><xsl:value-of select="substring-before($user,'|')"/></xsl:variable>
+  <xsl:variable name="rest"><xsl:value-of select="substring-after($user,'|')"/></xsl:variable>
+  <xsl:variable name="user-name"><xsl:value-of select="substring-before($rest,'|')"/></xsl:variable>
+  <xsl:variable name="user-email"><xsl:value-of select="substring-after($rest,'|')"/></xsl:variable>
+
+  <xsl:if test="$user != ''">
+    <xsl:choose>
+      <xsl:when test="$user-email != ''">
+      / <a>
+          <xsl:attribute name="href"><xsl:value-of select="concat('mailto:',$user-email)"/></xsl:attribute> 
+          <xsl:value-of select="$user-name"/>
+        </a>
+      </xsl:when>
+      <xsl:otherwise>
+       / <xsl:value-of select="$user-name"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="@*|node()" priority="-1">
+  <xsl:copy>
+    <xsl:apply-templates select="@*|node()"/>
+  </xsl:copy>
+</xsl:template>
+
+
+</xsl:stylesheet> 

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/page2xhtml.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/module.xmap?rev=413547&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/module.xmap (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/module.xmap Sun Jun 11 16:24:48 2006
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Live Module -->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+  <map:views>
+    <map:view name="debug" from-label="debug">
+       <map:serialize type="xml"/>
+    </map:view> 
+  </map:views>
+<!-- ************************************************************** -->
+   <map:pipelines>
+      <map:pipeline type="noncaching">
+         <map:match pattern="**">
+               <map:match pattern="*">
+                  <map:redirect-to uri="{1}/index.html"  session="false"/>
+               </map:match>
+               <map:match pattern="**/">
+                  <map:redirect-to uri="index.html"  session="false"/>
+               </map:match>
+               <map:match pattern="**/index*">
+                  <map:act type="resource-exists" src="module://homepage">
+                     <map:mount uri-prefix="" src="module://homepage/module.xmap"/> 
+                     <map:serialize type="html"/>
+                  </map:act>
+               </map:match>
+            <!-- Get the current document -->
+            <map:match pattern="*/cocoon/live/**">
+               <map:aggregate element="cmsbody">
+                  <map:part src="cocoon://{page-envelope:publication-id}/session/info"/>
+                  <map:part src="cocoon://{page-envelope:publication-id}/navigation/breadcrumb{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{page-envelope:publication-id}/navigation/tabs{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{page-envelope:publication-id}/navigation/menu{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{page-envelope:publication-id}/navigation/search{page-envelope:document-id}_{page-envelope:document-language}"/>
+<!--  WORK: Get doctype from Resource -->
+                  <map:part src="cocoon://{page-envelope:publication-id}/xhtml/view/live/{2}"/>
+               </map:aggregate>
+               <map:transform type="i18n" label="debug">
+                  <map:parameter name="locale" value="{page-envelope:document-language}"/>
+               </map:transform>
+               <map:transform src="module:///page2xhtml.xsl" label="debug">
+                 <map:parameter name="root" value="{page-envelope:context-prefix}/{page-envelope:publication-id}/live"/>
+                 <map:parameter name="url" value="{2}"/>
+                 <map:parameter name="document-id" value="{page-envelope:document-id}"/>
+                 <map:parameter name="document-name" value="{page-envelope:document-name}"/>
+<!--  WORK: Get doctype from Resource -->
+                 <map:parameter name="document-type" value="xhtml"/>
+                 <map:parameter name="language" value="{page-envelope:document-language}"/>
+                 <map:parameter name="querystring" value="{request:queryString}"/>
+               </map:transform>
+               <map:transform type="i18n" label="debug">
+                  <map:parameter name="locale" value="{page-envelope:document-language}"/>
+               </map:transform>
+               <map:serialize type="html"/>
+            </map:match>
+<!--Default -->
+            <map:act type="resource-exists" src="module://cache">
+               <map:mount uri-prefix="" src="module://cache/module.xmap"/> 
+               <map:serialize type="html"/>
+            </map:act>
+            <map:generate src="cocoon:/{module:module}/cocoon/{1}"/>
+            <map:serialize type="html"/>
+         </map:match>
+      </map:pipeline>
+   </map:pipelines>
+</map:sitemap>

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/module.xmap
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/page2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/page2xhtml.xsl?rev=413547&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/page2xhtml.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/page2xhtml.xsl Sun Jun 11 16:24:48 2006
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  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.
+-->
+
+<!-- $Id: page2xhtml.xsl 170255 2005-05-15 19:58:26Z gregor $ -->
+
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:xhtml="http://www.w3.org/1999/xhtml"
+    xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
+    xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" 
+    xmlns:dc="http://purl.org/dc/elements/1.1/"
+    xmlns:dcterms="http://purl.org/dc/terms/"
+    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+    exclude-result-prefixes="page xhtml"
+    >
+    
+    
+<!-- {context-prefix}/{publication-id}/{area} -->
+<xsl:param name="root"/>
+
+<xsl:param name="document-id"/>
+
+<!-- i.e. doctypes/xhtml-document -->
+<xsl:param name="document-type"/>
+
+<!-- The rquest url i.e. /lenya/doctypes/xhtml-document_en.html -->
+<xsl:param name="url"/>
+
+<xsl:param name="language"/>
+
+
+<xsl:template match="cmsbody">
+  <html>
+    <head>
+      <link rel="stylesheet" href="{$root}/css/page.css" type="text/css"/>
+      <meta content="Apache Lenya" name="generator"/>
+      <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
+      <title><xsl:value-of select="//lenya:meta/dc:title"/></title>
+    </head>	
+    <body>
+      <div id="page">
+      <table width="100%" cellpadding="0" cellspacing="0" border="0">
+        <tr>
+          <td id="publication-title">
+            <xsl:choose>
+              <xsl:when test="$language = 'de'">
+	        Willkommen zur Default Publikation!
+              </xsl:when>
+              <xsl:otherwise>
+	        Welcome to the Default Publication!
+              </xsl:otherwise>
+	    </xsl:choose>
+          </td>
+          <td id="project-logo"><img src="{$root}/images/project-logo.png" alt="project logo"/></td>
+        </tr>
+      </table>
+      <xsl:apply-templates select="xhtml:div[@id = 'tabs']"/>
+      <table width="100%" border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td valign="top">
+            <xsl:apply-templates select="xhtml:div[@id = 'menu']"/>
+          </td>
+          <td valign="top">
+            <div id="main">
+              <xsl:apply-templates select="xhtml:div[@id = 'breadcrumb']"/>
+              <xsl:apply-templates select="xhtml:div[@id = 'search']"/>
+              <xsl:apply-templates select="xhtml:div[@id = 'body']"/>
+            </div>
+          </td>
+        </tr>
+        <tr>
+          <td colspan="2" valign="top">
+            <div id="footer">
+              <xsl:apply-templates select="lenya:meta/dcterms:modified"/>
+              <xsl:apply-templates select="lenya:meta/dc:publisher"/>
+            </div>
+          </td>
+        </tr>
+      </table>
+      </div>
+    </body>
+  </html>
+</xsl:template>
+
+<xsl:template match="dcterms:modified">
+  <xsl:variable name="date"><xsl:value-of select="."/></xsl:variable>
+  <i18n:text>last_published</i18n:text>:
+    <xsl:if test="$date!=''">
+    <i18n:date-time src-pattern="yyyy-MM-dd HH:mm:ss" pattern="EEE, d MMM yyyy HH:mm:ss z" value="{$date}"/> 
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="dc:publisher">
+  <xsl:variable name="user"><xsl:value-of select="."/></xsl:variable>
+  <xsl:variable name="user-id"><xsl:value-of select="substring-before($user,'|')"/></xsl:variable>
+  <xsl:variable name="rest"><xsl:value-of select="substring-after($user,'|')"/></xsl:variable>
+  <xsl:variable name="user-name"><xsl:value-of select="substring-before($rest,'|')"/></xsl:variable>
+  <xsl:variable name="user-email"><xsl:value-of select="substring-after($rest,'|')"/></xsl:variable>
+
+  <xsl:if test="$user != ''">
+    <xsl:choose>
+      <xsl:when test="$user-email != ''">
+      / <a>
+          <xsl:attribute name="href"><xsl:value-of select="concat('mailto:',$user-email)"/></xsl:attribute> 
+          <xsl:value-of select="$user-name"/>
+        </a>
+      </xsl:when>
+      <xsl:otherwise>
+       / <xsl:value-of select="$user-name"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="@*|node()" priority="-1">
+  <xsl:copy>
+    <xsl:apply-templates select="@*|node()"/>
+  </xsl:copy>
+</xsl:template>
+
+
+</xsl:stylesheet> 

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/page2xhtml.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/admin-menu.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/admin-menu.xsl?rev=413547&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/admin-menu.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/admin-menu.xsl Sun Jun 11 16:24:48 2006
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:nav="http://apache.org/cocoon/lenya/navigation/1.0"
+    xmlns="http://www.w3.org/1999/xhtml"
+    exclude-result-prefixes="nav"
+    >
+    
+<xsl:import href="menu.xsl"/>
+
+</xsl:stylesheet> 

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/admin-menu.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/breadcrumb.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/breadcrumb.xsl?rev=413547&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/breadcrumb.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/breadcrumb.xsl Sun Jun 11 16:24:48 2006
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  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.
+-->
+
+<!-- $Id: breadcrumb.xsl 42703 2004-03-13 12:57:53Z gregor $ -->
+
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:nav="http://apache.org/cocoon/lenya/navigation/1.0"
+    xmlns="http://www.w3.org/1999/xhtml"
+    exclude-result-prefixes="nav"
+    >
+    
+<xsl:template match="nav:site">
+  <div id="breadcrumb">
+    <xsl:apply-templates select="nav:node"/>
+</div>
+</xsl:template>
+
+
+<xsl:template match="nav:node">
+  
+  <xsl:if test="descendant-or-self::nav:node[@current = 'true']">
+    <xsl:call-template name="separator"/>
+    <xsl:call-template name="step"/>
+    <xsl:apply-templates select="nav:node"/>
+  </xsl:if>
+  
+</xsl:template>
+
+
+<xsl:template name="step">
+  <xsl:choose>
+    <xsl:when test="@current = 'true'">
+      <xsl:apply-templates select="nav:label"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <a href="{@href}"><xsl:apply-templates select="nav:label"/></a>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+    
+<xsl:template match="nav:label">
+  <xsl:value-of select="."/>
+</xsl:template>
+
+
+<xsl:template name="separator">
+  &#x00BB;
+</xsl:template>
+
+
+<xsl:template match="@*|node()">
+  <xsl:copy>
+    <xsl:apply-templates select="@*|node()"/>
+  </xsl:copy>
+</xsl:template>
+
+
+</xsl:stylesheet> 

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/breadcrumb.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/menu.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/menu.xsl?rev=413547&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/menu.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/menu.xsl Sun Jun 11 16:24:48 2006
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:nav="http://apache.org/cocoon/lenya/navigation/1.0"
+    xmlns="http://www.w3.org/1999/xhtml"
+    exclude-result-prefixes="nav"
+    >
+    
+<xsl:template match="nav:site">
+  <div id="menu">
+    <xsl:apply-templates select="nav:node"/>
+  </div>
+</xsl:template>
+
+<xsl:template match="nav:node[@visibleinnav = 'false']"/>
+
+<xsl:template match="nav:node">
+  <xsl:choose>
+    <xsl:when test="descendant-or-self::nav:node[@current = 'true']">
+      <div class="menublock-selected" level="{count(ancestor-or-self::nav:node)}">
+        <xsl:call-template name="item"/>
+        <xsl:apply-templates select="nav:node"/>
+      </div>
+    </xsl:when>
+    <xsl:otherwise>
+      <div class="menublock" level="{count(ancestor-or-self::nav:node)}">
+        <xsl:call-template name="item"/>
+<!--        <xsl:apply-templates select="nav:node"/> -->
+      </div>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+
+<xsl:template name="item">
+      <xsl:choose>
+         <xsl:when test="@current = 'true'">
+           <xsl:call-template name="item-selected"/>
+         </xsl:when>
+         <xsl:otherwise>
+           <xsl:call-template name="item-default"/>
+         </xsl:otherwise>
+       </xsl:choose>
+</xsl:template>
+
+
+<xsl:template name="item-default">
+  <div class="menuitem" level="{count(ancestor-or-self::nav:node)}" id="{@id}">
+    <a href="{@fullhref}"><xsl:apply-templates select="nav:label"/></a>
+  </div>
+</xsl:template>
+    
+    
+<xsl:template name="item-selected">
+  <div class="menuitem-selected" level="{count(ancestor-or-self::nav:node)}" id="{@id}">
+    <xsl:apply-templates select="nav:label"/>
+  </div>
+</xsl:template>
+
+
+<xsl:template match="nav:label">
+  <xsl:value-of select="."/>
+</xsl:template>
+    
+    
+<xsl:template match="@*|node()">
+  <xsl:copy>
+    <xsl:apply-templates select="@*|node()"/>
+  </xsl:copy>
+</xsl:template>
+
+
+</xsl:stylesheet> 

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/menu.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xmap?rev=413547&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xmap (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xmap Sun Jun 11 16:24:48 2006
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+This sitemap creates default navigation components.
+-->
+
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+  <!-- =========================== Components ================================ -->
+
+  <map:components>
+  <map:views>
+    <map:view name="nav" from-label="nav">
+       <map:serialize type="xml"/>
+    </map:view> 
+  </map:views>
+  </map:components>
+
+
+  <!-- =========================== Pipelines ================================ -->
+  
+  <map:resources>
+    
+    <map:resource name="finish">
+      <map:transform src="module://{stylesheet}">
+        <map:parameter name="url" value="{url}"/>
+        <map:parameter name="root" value="{page-envelope:context-prefix}/{page-envelope:publication-id}/{page-envelope:area}/"/>
+        <map:parameter name="area" value="{page-envelope:area}"/>
+        <map:parameter name="chosenlanguage" value="{page-envelope:document-language}"/>
+        <map:parameter name="defaultlanguage" value="{page-envelope:document-language}"/>
+        <map:parameter name="breadcrumbprefix" value="{page-envelope:breadcrumb-prefix}"/>
+      </map:transform>             
+      <map:serialize type="xml"/>      
+    </map:resource>
+  </map:resources>
+  
+  <map:pipelines>
+    <map:pipeline>
+   <map:match pattern="**">
+    <!-- pattern: {pub-id}/admin/{nav-element}/{url}.xml -->
+<!-- Not tested -->
+    <map:match pattern="admin/*/**.xml">
+      <map:generate src="cocoon:/{page-envelope:publication-id}/admin/sitetree/{2}.xml"/>
+      <map:call resource="finish">
+        <map:parameter name="stylesheet" value="/admin-{page-envelope:area}.xsl"/>
+      </map:call>
+    </map:match>
+<!-- REMOVE publication -->
+      <map:match pattern="{page-envelope:publication-id}/**">
+         <map:generate src="cocoon:/{1}"/>
+         <map:serialize type="xml"/>      
+      </map:match>
+<!-- REMOVE navigation -->
+      <map:match pattern="{module:module}/**">
+        <map:generate src="cocoon:/{1}"/>
+         <map:serialize type="xml"/>      
+      </map:match>
+<!-- REMOVE .xml -->
+       <map:match pattern="**.xml">
+         <map:generate src="cocoon:/{1}"/>
+         <map:serialize type="xml"/>   
+      </map:match>
+<!-- REMOVE .html -->
+       <map:match pattern="**.html">
+         <map:generate src="cocoon:/{1}"/>
+         <map:serialize type="xml"/>   
+      </map:match>
+<!-- Sitetree -->
+       <map:match pattern="sitetree/**">
+         <map:generate src="module:///../../content/{page-envelope:area}/sitetree.xml"/>
+         <map:transform type="i18n">      
+            <map:parameter name="locale" value="{page-envelope:document-language}"/>
+         </map:transform>
+         <map:call resource="finish">
+           <map:parameter name="stylesheet" value="/sitetree2nav.xsl"/>
+           <map:parameter name="url" value="{1}.html"/>
+         </map:call>
+      </map:match>
+<!-- Nav -->
+      <map:match pattern="*/**">
+<!-- Navigation Module XMAP -->
+         <map:act type="resource-exists" src="module:///module://{1}/navigation.xmap">
+            <map:mount uri-prefix="" src="module:///module://{1}/navigation.xmap"/> 
+            <map:serialize type="xml"/>
+        </map:act>
+<!-- Navigation Module XSL -->
+         <map:act type="resource-exists" src="module:///module://{1}/navigation.xsl">
+            <map:generate src="module:///cocoon:/sitetree/{2}"/>
+            <map:call resource="finish">
+              <map:parameter name="stylesheet" value="{../1}/navigation.xsl"/>
+              <map:parameter name="url" value="{../2}.html"/>
+            </map:call>
+        </map:act>
+<!-- Navigation XSL -->
+        <map:generate src="module:///cocoon:/sitetree/{2}"/>
+        <map:call resource="finish">
+           <map:parameter name="stylesheet" value="/{1}.xsl"/>
+           <map:parameter name="url" value="{2}.html"/>
+        </map:call>
+      </map:match>
+<!-- Default -->
+   </map:match>
+    </map:pipeline>
+  </map:pipelines>
+</map:sitemap>

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xmap
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xml?rev=413547&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xml (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xml Sun Jun 11 16:24:48 2006
@@ -0,0 +1,5 @@
+<module id="navigation" name="Navigation">
+<version>1.3</version>
+<content>Hierarchical</content>
+<description>Handles backwards-compatible navigation framework for hierarchical storage.</description>
+</module>
\ No newline at end of file

Propchange: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xml
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org