[richfaces-svn-commits] JBoss Rich Faces SVN: r18664 - in trunk/ui/output/ui/src/main: templates and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Aug 16 10:13:03 EDT 2010


Author: amarkhel
Date: 2010-08-16 10:13:03 -0400 (Mon, 16 Aug 2010)
New Revision: 18664

Modified:
   trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
   trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelBorders.js
   trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelSizer.js
   trunk/ui/output/ui/src/main/templates/popupPanel.template.xml
Log:
RF-9062, RF-9006

Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js	2010-08-16 14:12:05 UTC (rev 18663)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js	2010-08-16 14:13:03 UTC (rev 18664)
@@ -10,11 +10,11 @@
 	{
 		if (typeof element.onselectstart!="undefined") //IE
 		{
-			jQuery(element).bind( 'selectstart', selectionEventHandler);
+			$(richfaces.getDomElement(element)).bind( 'selectstart', selectionEventHandler);
 		}
 		else //All other (ie: Opera)
 		{
-			jQuery(element).bind( 'mousedown', selectionEventHandler);
+			$(richfaces.getDomElement(element)).bind( 'mousedown', selectionEventHandler);
 		}
 	}
 
@@ -22,11 +22,11 @@
 	{
 		if (typeof element.onselectstart!="undefined") //IE
 		{
-			jQuery(element).unbind( 'selectstart', selectionEventHandler);
+			$(richfaces.getDomElement(element)).unbind( 'selectstart', selectionEventHandler);
 		}
 		else //All other (ie: Opera)
 		{
-			jQuery(element).unbind( 'mousedown', selectionEventHandler);
+			$(richfaces.getDomElement(element)).unbind( 'mousedown', selectionEventHandler);
 		}
 	}
 		
@@ -35,10 +35,9 @@
     	$super.constructor.call(this,id);
     	this.markerId = id;
     	this.attachToDom(id);
-    	id = "#" + id;
     	this.options = options; 
 
-		this.id = $(id);
+		this.id = $(richfaces.getDomElement(id));
 		this.minWidth = this.getMinimumSize(this.options.minWidth);
 		this.minHeight = this.getMinimumSize(this.options.minHeight);
 		this.maxWidth = this.options.maxWidth;
@@ -47,15 +46,14 @@
 
 		this.baseZIndex = this.options.zindex ? this.options.zindex : 100;
 		
-		this.div = id;
-		this.cdiv = id + "_container";
-		this.contentDiv = id + "_content";
-		this.shadowDiv = id + "_shadow";
-		this.scrollerDiv = id + "_content_scroller"
+		this.div = $(richfaces.getDomElement(id));
+		this.cdiv = $(richfaces.getDomElement(id + "_container"));
+		this.contentDiv = $(richfaces.getDomElement(id + "_content"));
+		this.shadowDiv = $(richfaces.getDomElement(id + "_shadow"));
+		this.scrollerDiv = $(richfaces.getDomElement(id + "_content_scroller"));
 
 		this.borders = new Array();
-		this.firstHref = id + "FirstHref";
-		this.lastHref = id + "LastHref";
+		this.firstHref = $(richfaces.getDomElement(id + "FirstHref"));
 		if (this.options.resizeable) {
 			this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerN", this, "N-resize", richfaces.ui.PopupPanel.Sizer.N));
 			this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerE", this, "E-resize", richfaces.ui.PopupPanel.Sizer.E));
@@ -68,10 +66,10 @@
 			this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerSW", this, "SW-resize", richfaces.ui.PopupPanel.Sizer.SW));
 		}
 
-		if (this.options.moveable && $(id + "_header")) {
+		if (this.options.moveable && richfaces.getDomElement(id + "_header")) {
 			this.header = new richfaces.ui.PopupPanel.Border(id + "_header", this, "move", richfaces.ui.PopupPanel.Sizer.Header);
 		} else{
-			$(id + "_header").css('cursor', 'default');
+			$(richfaces.getDomElement(id + "_header")).css('cursor', 'default');
 		}
 
     };
@@ -102,24 +100,24 @@
 			},
 			
 			getLeft : function (){
-				return $(this.cdiv).css('left');
+				return this.cdiv.css('left');
 			},
 			
 			getTop : function (){
-				return $(this.cdiv).css('top');
+				return this.cdiv.css('top');
 			},
 			
 			getInitialSize : function(){
 				if(this.options.autosized){
 					return 15;
 				} else{
-					return $(this.div + "_header_content").height();
+					return $(richfaces.getDomElement(this.markerId + "_header_content")).height();
 				}
 			},
 			
 			getContentElement: function() {
 				if (!this._contentElement) {
-					this._contentElement =  $(this.cdiv);
+					this._contentElement =  this.cdiv;
 				}
 
 				return this._contentElement;
@@ -149,8 +147,8 @@
 				this.borders = null;
 
 				if (this.domReattached) {
-					var element = this.id;
-					var parent = $(element).parent();
+					var element = this.div;
+					var parent = element.parent();
 					if (parent) {
 						parent.remove(element);
 					}
@@ -186,27 +184,27 @@
 	
 			setLeft: function(pos) {
 				if(!isNaN(pos)){
-					$(this.cdiv).css('left', pos + "px");
+					this.cdiv.css('left', pos + "px");
 					var depth = this.options.shadowDepth ? this.options.shadowDepth : 2;
-					$(this.shadowDiv).css('left', pos + depth  + "px");
+					this.shadowDiv.css('left', pos + depth  + "px");
 				}
 			},
 
 			setTop: function(pos) {
 				if(!isNaN(pos)){
-					$(this.cdiv).css('top', pos + "px");
+					this.cdiv.css('top', pos + "px");
 					var depth = this.options.shadowDepth ? this.options.shadowDepth : 2;
-					$(this.shadowDiv).css('top', pos + depth +"px");
+					this.shadowDiv.css('top', pos + depth +"px");
 				}
 			},
 
 			show: function(event, opts) {
 				if(!this.shown && this.invokeEvent("beforeshow",event,null,element)) {
 					this.preventFocus();
-					var element = this.id;
+					var element = this.div;
 			
 	        		if (!this.domReattached) {
-						this.parent = $(element).parent();
+						this.parent = element.parent();
 				
 						var domElementAttachment;
 						if (opts) {
@@ -232,7 +230,7 @@
 							element.insertBefore(newParent.firstChild);
 							this.domReattached = true;
 						} else {
-							$(this.parent).show();
+							this.parent.show();
 						}
 					}
 	
@@ -279,9 +277,9 @@
 						if (options.width > this.maxWidth) {
 							options.width = this.maxWidth;
 						}
-						$(eContentElt).css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
-						$(this.shadowDiv).css('width', options.width + 4 + (/px/.test(options.width) ? '' : 'px'));
-						$(this.scrollerDiv).css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
+						$(richfaces.getDomElement(eContentElt)).css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
+						this.shadowDiv.css('width', options.width + 4 + (/px/.test(options.width) ? '' : 'px'));
+						this.scrollerDiv.css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
 						
 						
 					}
@@ -293,10 +291,10 @@
 						if (options.height > this.maxHeight) {
 							options.height = this.maxHeight;
 						}
-						$(eContentElt).css('height', options.height + (/px/.test(options.height) ? '' : 'px'));
-						$(this.shadowDiv).css('height', options.height + 4 + (/px/.test(options.height) ? '' : 'px'));
-						var headerHeight = $(this.div +"_header")[0] ? $(this.div +"_header")[0].clientHeight : 0;
-						$(this.scrollerDiv).css('height', options.height - headerHeight + (/px/.test(options.height) ? '' : 'px'));
+						$(richfaces.getDomElement(eContentElt)).css('height', options.height + (/px/.test(options.height) ? '' : 'px'));
+						this.shadowDiv.css('height', options.height + 4 + (/px/.test(options.height) ? '' : 'px'));
+						var headerHeight = $(richfaces.getDomElement(this.div +"_header"))[0] ? $(richfaces.getDomElement(this.div +"_header"))[0].clientHeight : 0;
+						this.scrollerDiv.css('height', options.height - headerHeight + (/px/.test(options.height) ? '' : 'px'));
 						
 						
 					}
@@ -305,16 +303,16 @@
 	                        		this.iframe = this.markerId + "IFrame";
 	            		$("<iframe src=\"javascript:''\" frameborder=\"0\" scrolling=\"no\" id=\"" + this.iframe + "\" " +								
 						"class=\"rf-pp-if\" style=\"width:" +this.options.width + "px; height:" + this.options.height + "px;\">" +
-						"</iframe>").insertBefore($(':first-child', $(this.cdiv))[0]);
+						"</iframe>").insertBefore($(':first-child', this.cdiv)[0]);
 				
-						eIframe = jQuery("#"+this.iframe); 
+						eIframe = $(richfaces.getDomElement(this.iframe)); 
 	
-						$(eIframe).bind('load', this.initIframe);
+						eIframe.bind('load', this.initIframe);
 						this.eIframe = eIframe;
 					}
 					element.mpSet = true;
 	
-					var eDiv = $(this.div);
+					var eDiv = this.div;
 	
 					if (options.left) {
 						var _left;
@@ -351,10 +349,10 @@
 					}
 
 					var opacity = options.shadowOpacity ? options.shadowOpacity : 0.1;
-					$(this.shadowDiv).css('opacity', opacity);
-					$(this.shadowDiv).css('filter ', 'alpha(opacity='+opacity*100 +');');
-	    			$(element).css('visibility', '');
-	    			$(element).css('display', 'block');
+					this.shadowDiv.css('opacity', opacity);
+					this.shadowDiv.css('filter ', 'alpha(opacity='+opacity*100 +');');
+	    			element.css('visibility', '');
+	    			element.css('display', 'block');
 	    			var event = {};
 	    			event.parameters = opts || {};
 	    			this.shown = true;
@@ -433,7 +431,7 @@
 			var popup = this;
 			if (this.firstOutside) {
 			
-				jQuery(this.firstOutside).bind("focus", {popup: popup}, this.firstOnfocus); 
+				$(richfaces.getDomElement(this.firstOutside)).bind("focus", {popup: popup}, this.firstOnfocus); 
 			}
 		}
 	},
@@ -443,7 +441,7 @@
 			this.processAllFocusElements(document, this.restoreTabindexes);
 		
 			if (this.firstOutside) {
-				jQuery(this.firstOutside).unbind("focus", this.firstOnfocus);
+				$(richfaces.getDomElement(this.firstOutside)).unbind("focus", this.firstOnfocus);
 				this.firstOutside = null;
 			}
 		}
@@ -465,7 +463,7 @@
 					this.currentMinHeight = undefined; 
 					this.currentMinWidth = undefined;			
 	
-					$(this.id).hide();
+					this.id.hide();
 	
 					if (this.parent) {
 						if (this.domReattached) {
@@ -475,7 +473,7 @@
 
 							this.domReattached = false;
 						} else {
-							$(this.parent).hide();
+							this.parent.hide();
 						}
 					}
 			
@@ -498,7 +496,7 @@
 			},
 
 			getStyle: function(elt, name) {
-				return parseInt($(elt).css(name).replace("px", ""), 10);
+				return parseInt($(richfaces.getDomElement(elt)).css(name).replace("px", ""), 10);
 			},
 	
 			doResizeOrMove: function(diff) {
@@ -628,14 +626,16 @@
 					cssHash.top = newPos + 'px';
 					shadowHash.top = newPos + shadowDepth + "px";
 				}
-				$(eContentElt).css(cssHashWH);
-				$(this.scrollerDiv).css(scrollerHashWH);
-				if(this.eIframe)$(this.eIframe).css(scrollerHashWH);
-				$(this.shadowDiv).css(shadowHashWH);
+				eContentElt.css(cssHashWH);
+				this.scrollerDiv.css(scrollerHashWH);
+				if(this.eIframe){
+					this.eIframe.css(scrollerHashWH);
+				}
+				this.shadowDiv.css(shadowHashWH);
 
-				$(eCdiv).css(cssHash);
-				$(this.shadowDiv).css(shadowHash);
-				//if(this.eIframe)$(this.eIframe).css(cssHash);
+				eCdiv.css(cssHash);
+				this.shadowDiv.css(shadowHash);
+
 				$.extend(this.userOptions, cssHash);
 				$.extend(this.userOptions, cssHashWH);
 				var w = this.width();
@@ -672,10 +672,10 @@
 			
 			moveTo : function (top, left){
 				var shadowDepth = this.options.shadowDepth? this.options.shadowDepth: 4;
-				$(this.cdiv).css('top', top);
-				$(this.cdiv).css('left', left);
-				$(this.shadowDiv).css('top', top + shadowDepth);
-				$(this.shadowDiv).css('left', left + shadowDepth);
+				this.cdiv.css('top', top);
+				this.cdiv.css('left', left);
+				this.shadowDiv.css('top', top + shadowDepth);
+				this.shadowDiv.css('left', left + shadowDepth);
 			},
 			
 			move : function (dx, dy){

Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelBorders.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelBorders.js	2010-08-16 14:12:05 UTC (rev 18663)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelBorders.js	2010-08-16 14:13:03 UTC (rev 18664)
@@ -6,10 +6,10 @@
     	
     	$super.constructor.call(this,id);
     	
-    	var element = jQuery(id);
-		jQuery(element).css('cursor',cursor);
+    	this.element = $(richfaces.getDomElement(id));
+		this.element.css('cursor',cursor);
 		var border = this;
-		jQuery(this.id).bind( 'mousedown', {border:border},this.startDrag);
+		this.element.bind( 'mousedown', {border:border},this.startDrag);
 
 		this.modalPanel = modalPanel;
 		this.sizer = sizer;
@@ -28,20 +28,21 @@
 			{
 				if (this.doingDrag)
 				{
-					jQuery(document).unbind( 'mousemove', this.doDrag); 
-					jQuery(document).unbind( 'mouseup', this.endDrag); 
+					$(document).unbind( 'mousemove', this.doDrag); 
+					$(document).unbind( 'mouseup', this.endDrag); 
 				}
 		
-				jQuery(this.id).unbind( 'mousedown', this.startDrag);
+				this.element.unbind( 'mousedown', this.startDrag);
+				this.element = null;
 				this.modalPanel=null;
 			},
 		
 			show: function() {
-				jQuery(this.id).show();
+				this.element.show();
 			},
 		
 			hide: function() {
-				jQuery(this.id).hide();
+				this.element.hide();
 			},
 		
 			startDrag: function(event) {
@@ -50,12 +51,8 @@
 		
 				border.dragX = event.clientX;
 				border.dragY = event.clientY;
-				jQuery(document).bind( 'mousemove',{border:border}, border.doDrag);
-				jQuery(document).bind( 'mouseup',{border:border}, border.endDrag);
-				
-				//var eCursorDiv = jQuery(border.modalPanel.cDiv);
-				//jQuery(eCursorDiv).css('cursor', jQuery(border.id).css('cursor'));
-				//jQuery(eCursorDiv).css('zIndex', 10);
+				$(document).bind( 'mousemove',{border:border}, border.doDrag);
+				$(document).bind( 'mouseup',{border:border}, border.endDrag);
 			
 				border.modalPanel.startDrag(border);
 				
@@ -111,7 +108,7 @@
 					var diff = border.sizer.prototype.doDiff(dx, dy);//TODO
 					var doResize;
 					
-					var element = jQuery(border.modalPanel.cdiv);
+					var element = border.modalPanel.cdiv;
 					
 					if (diff.deltaWidth || diff.deltaHeight) {
 						doResize = border.modalPanel.invokeEvent("resize",event,null,element);
@@ -153,8 +150,8 @@
 				var border = event.data.border;
 				border.doingDrag = undefined;
 		
-				jQuery(document).unbind( 'mousemove', border.doDrag); 
-				jQuery(document).unbind( 'mouseup', border.endDrag); 
+				$(document).unbind( 'mousemove', border.doDrag); 
+				$(document).unbind( 'mouseup', border.endDrag); 
 		
 				border.modalPanel.endDrag(border);
 				
@@ -165,7 +162,7 @@
 			},
 		
 			doPosition: function() {
-				this.sizer.prototype.doPosition(this.modalPanel, jQuery(this.id));	//TODO remove prototype
+				this.sizer.prototype.doPosition(this.modalPanel, this.element);	//TODO remove prototype
 			} 
 	    }
     

Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelSizer.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelSizer.js	2010-08-16 14:12:05 UTC (rev 18663)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelSizer.js	2010-08-16 14:13:03 UTC (rev 18664)
@@ -18,7 +18,7 @@
 			doSetupSize: function (modalPanel, elt) {
 				var width = 0;
 				var height = 0;
-		
+				var element = $(richfaces.getDomElement(elt));
 				var reductionData = modalPanel.reductionData;
 				
 				if (reductionData) {
@@ -34,15 +34,15 @@
 				if (width > 0) {
 					if (elt.clientWidth > width) {
 						if (!elt.reducedWidth) {
-							elt.reducedWidth = jQuery(elt).css('width');
+							elt.reducedWidth = element.css('width');
 						}
-						jQuery(elt).css('width', width + 'px');
+						element.css('width', width + 'px');
 					} else if (width < 4 && elt.reducedWidth == 4 + 'px') {
-						jQuery(elt).css('width', width + 'px');
+						element.css('width', width + 'px');
 					}
 				} else {
 					if (elt.reducedWidth) {
-						jQuery(elt).css('width', elt.reducedWidth);
+						element.css('width', elt.reducedWidth);
 						elt.reducedWidth = undefined;
 					}
 				}
@@ -50,24 +50,25 @@
 				if (height > 0) {
 					if (elt.clientHeight > height) {
 						if (!elt.reducedHeight) {
-							elt.reducedHeight = jQuery(elt).css('height');
+							elt.reducedHeight = element.css('height');
 						}
 						elt.style.height = height + 'px';
 					} else if (height < 4 && elt.reducedHeight == 4 + 'px') {
-						jQuery(elt).css('height', height + 'px');
+						element.css('height', height + 'px');
 					}
 				} else {
 					if (elt.reducedHeight) {
-						jQuery(elt).css('height', elt.reducedHeight);
+						element.css('height', elt.reducedHeight);
 						elt.reducedHeight = undefined;
 					}
 				}
 			},
 			
 			doSetupPosition: function (modalPanel, elt, left, top) {
+			var element = $(richfaces.getDomElement(elt));
 				if(!isNaN(left) && !isNaN(top)){
-					jQuery(elt).css('left', left + 'px');
-					jQuery(elt).css('top', top + 'px');
+					element.css('left', left + 'px');
+					element.css('top', top + 'px');
 				}
 			},
 		
@@ -106,7 +107,8 @@
         	name: "richfaces.ui.PopupPanel.Sizer.N",
         	
         	doPosition : function (popupPanel, elt) {
-				jQuery(elt).css('width',popupPanel.width() + 'px');
+			var element = $(richfaces.getDomElement(elt));
+				element.css('width',popupPanel.width() + 'px');
 				this.doSetupPosition(popupPanel, elt, 0, 0);
 			},
 			
@@ -163,7 +165,8 @@
         	name: "richfaces.ui.PopupPanel.Sizer.E",
         	
         	doPosition : function (popupPanel, elt) {
-				jQuery(elt).css('height', popupPanel.height() + 'px');
+			var element = $(richfaces.getDomElement(elt));
+				element.css('height', popupPanel.height() + 'px');
 				this.doSetupPosition(popupPanel, elt, popupPanel.width() - elt.clientWidth, 0);
 			},
 			
@@ -202,7 +205,8 @@
         	name: "richfaces.ui.PopupPanel.Sizer.S",
         	
         	doPosition : function (popupPanel, elt) {
-				jQuery(elt).css('width', popupPanel.width() + 'px');
+			var element = $(richfaces.getDomElement(elt));
+				element.css('width', popupPanel.width() + 'px');
 				this.doSetupPosition(popupPanel, elt, 0, popupPanel.height() - elt.clientHeight);
 			},
 			
@@ -243,7 +247,8 @@
         	name: "richfaces.ui.PopupPanel.Sizer.W",
         	
         	doPosition : function (popupPanel, elt) {
-				jQuery(elt).css('height', popupPanel.height() + 'px');
+			var element = $(richfaces.getDomElement(elt));
+				element.css('height', popupPanel.height() + 'px');
 				this.doSetupPosition(popupPanel, elt, 0, 0);
 			},
 			

Modified: trunk/ui/output/ui/src/main/templates/popupPanel.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/popupPanel.template.xml	2010-08-16 14:12:05 UTC (rev 18663)
+++ trunk/ui/output/ui/src/main/templates/popupPanel.template.xml	2010-08-16 14:13:03 UTC (rev 18664)
@@ -32,7 +32,7 @@
 	<div id="#{clientId}_shadow" style="position: #{component.attributes['followByScroll'] ? 'fixed' : 'absolute'};" class="rf-pp-shw"/>
 	<div id="#{clientId}_container" style="position: #{component.attributes['followByScroll'] ? 'fixed' : 'absolute'};" cdk:passThroughWithExclusions="id style class styleClass" class="rf-pp-cr #{component.attributes['styleClass']}">
 
-		<c:if test="(#{component.getFacet('header')!=null and component.getFacet('header').rendered})">
+		<c:if test="#{component.getFacet('header')!=null and component.getFacet('header').rendered}">
 		<div id="#{clientId}_header" class="rf-pp-h #{component.attributes['headerClass']}" >
 			<div id="#{clientId}_header_content" class="rf-pp-h-ct">
 				<cdk:call expression="renderHeaderFacet(facesContext, component)"/>



More information about the richfaces-svn-commits mailing list