[richfaces-svn-commits] JBoss Rich Faces SVN: r4422 - in trunk: ui/calendar/src/main/resources/org/richfaces/renderkit/html/css and 2 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Dec 3 09:16:46 EST 2007


Author: pyaschenko
Date: 2007-12-03 09:16:46 -0500 (Mon, 03 Dec 2007)
New Revision: 4422

Removed:
   trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/JQuerySpinBtn.xcss
   trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/spinbtn_updn.gif
Modified:
   trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/json/json-dom.js
   trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss
   trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
   trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
RF-1192
some optimization

Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/json/json-dom.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/json/json-dom.js	2007-12-03 14:14:17 UTC (rev 4421)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/json/json-dom.js	2007-12-03 14:16:46 UTC (rev 4422)
@@ -72,8 +72,7 @@
 		if (attrValue) 
 			html += " "+(i=='className'?'class':i)+'="'+this.xmlEscape(attrValue)+'"';
 	}
-	if(inner == "") html+= "/>";
-	else html+= ">"+inner+"</"+this.tag+">";
+	html+= ">"+inner+"</"+this.tag+">";
 	return html;
 };
 

Deleted: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/JQuerySpinBtn.xcss
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/JQuerySpinBtn.xcss	2007-12-03 14:14:17 UTC (rev 4421)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/JQuerySpinBtn.xcss	2007-12-03 14:16:46 UTC (rev 4422)
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<f:template xmlns:f='http:/jsf.exadel.com/template'
-   xmlns:u='http:/jsf.exadel.com/template/util'
-   xmlns="http://www.w3.org/1999/xhtml" >
-   <f:verbatim><![CDATA[
-/*
-	Styles to make ordinary <INPUT type="text"/> look like a spinbutton/spinbox control.
-	Use with JQuerySpinBtn.js to provide the spin functionality by reacting to mouse etc.
-	(Requires a reference to the JQuery library found at http://jquery.com/src/latest/)
-	(Hats-off to John Resig for creating the excellent JQuery library. It is fab.)
-
-	This control is achieved with no extra html markup whatsoever and uses unobtrusive javascript.
-
-	Written by George Adamson, Software Unity (george.jquery at softwareunity.com) September 2006.
-	Big improvements added by Mark Gibson, (mgibson at designlinks.net) September 2006.
-
-	Do contact me with comments and suggestions but please don't ask for support.
-	As much as I'd love to help with specific problems I have plenty to get on with already!
-
-	Go ahead and use it in your own projects. This code is provided 'as is'.
-	Sure I've tested in heaps of ways. Its good for me, but you use it at your own risk.
-	SoftwareUnity and I are certainly not responsible if your computer sets fire to the sofa,
-	hacks into the pentagon, hijacks a plane or gives you any kind of hassle whatsoever.
-
-	If you'd like your spin-button image in a different place then you'll need to alter both
-	the CSS below and the javascript isMouseOverUpDn() function to accommodate the new position.
-	You could even have left and right buttons either side of the textbox.
-*/
-
-INPUT.spin-button {
-	padding-right:20px;					/* Padding pevents text from covering the up/dn img. Works better in Firefox but also causes textbox to widen by 20px. Arrows can go wonky in IE when text is too long. Perhaps it could be fixed with script that monitored the horiz-scroll position? */
-	background-repeat:no-repeat;		/* Warning: Img may disappear in Firefox if you use 'background-attachment:fixed' ! */
-	background-position:100% 0%;
-}
-
-INPUT.spin-button.up {					/* Change button img when mouse is over the UP-arrow */
-	cursor:pointer;
-	background-position:100% -18px;		/* 18px matches height of 2 visible buttons */
-}
-INPUT.spin-button.down {				/* Change button img when mouse is over the DOWN-arrow */
-	cursor:pointer;
-	background-position:100% -36px;		/* 36px matches height of 2x2 visible buttons */
-}
-   ]]>
-   </f:verbatim>
-   	<u:selector name="INPUT.spin-button">
-		<u:style name="background-image">
-			<f:resource f:key="/org/richfaces/renderkit/html/css/spinbtn_updn.gif" />
-		</u:style>
-	</u:selector>
-   
-</f:template>

Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss	2007-12-03 14:14:17 UTC (rev 4421)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss	2007-12-03 14:16:46 UTC (rev 4422)
@@ -94,29 +94,20 @@
 	border: 0px;
 	padding: 0px 0px 0px 3px;
 	background: none transparent scroll repeat 0% 0%;
-	margin: 0px;
 }
 
 .rich-calendar-spinner-input-container {
-	padding: 0px;
-	margin: 0px;
 	background-position: left top;
 	background-repeat: repeat-x;
 	border: 1px solid;
-	
-	width: 99%;
 }
 
 .rich-calendar-spinner-buttons {
 	border-width: 1px;
 	border-style: solid;
-	padding: 0px;
-	margin: 0px;
 	background-position: left top;
 	background-repeat: repeat-x;
 	font-size: 0px;
-
-	width: 1%;
 }
 
 ]]>
@@ -292,12 +283,12 @@
 		<u:style name="background" skin="additionalBackgroundColor"/>
 		<u:style name="border" value="1px solid"/>
 		<u:style name="border-color" skin="panelBorderColor"/>
-
-		<u:style name="width" value="1%"/>
-		<u:style name="z-index" value="2"/>
 		<u:style name="position" value="relative"/>
 	</u:selector>
 
+	<u:selector name=".rich-calendar-time-layout-container">
+	</u:selector>
+
 	<u:selector name=".rich-calendar-time-layout, .rich-calendar-time-layout input">
 		<u:style name="font-size" skin="generalSizeFont"/>
 		<u:style name="font-family" skin="generalFamilyFont"/>
@@ -305,7 +296,6 @@
 
 	<u:selector name=".rich-calendar-time-layout-fields">
 		<u:style name="padding" value="7px 7px 5px 7px"/>
-		<u:style name="text-align" value="center"/>
 		<u:style name="white-space" value="nowrap"/>
 	</u:selector>
 
@@ -392,13 +382,11 @@
     	<u:style name="border-right-color" skin="subBorderColor" />
 	</u:selector>
 
-	<u:selector name=".rich-calendar-time-editor-shadow">
-		<u:style name="background" skin="additionalBackgroundColor"/>
-
-		<u:style name="z-index" value="1"/>
+	<u:selector name=".rich-calendar-time-layout-shadow">
+	    <u:style name="background-color" skin="shadowBackgroundColor" />
+    	<u:style name="opacity" value="0.3" />
+		<u:style name="filter" value="alpha(opacity=30)"/>    	
 		<u:style name="position" value="absolute"/>
-
-		<u:style name="opacity" value="0.3"/>
-		<u:style name="filter" value="alpha(opacity=30)"/>
 	</u:selector>
+
 </f:template>

Deleted: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/spinbtn_updn.gif
===================================================================
(Binary files differ)

Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js	2007-12-03 14:14:17 UTC (rev 4421)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js	2007-12-03 14:16:46 UTC (rev 4422)
@@ -531,8 +531,8 @@
 		this.TIME_EDITOR_ID = this.id+'TimeEditor';
 		this.TIME_EDITOR_SHADOW_ID = this.id+'TimeEditorShadow';
 
-		this.TIME_EDITOR_PANEL_ID = this.id+'TimeEditorPanel';
-		this.TIME_EDITOR_PANEL_SHADOW_ID = this.id+'TimeEditorPanelShadow';
+		this.TIME_EDITOR_LAYOUT_ID = this.id+'TimeEditorLayout';
+		this.TIME_EDITOR_LAYOUT_SHADOW_ID = this.id+'TimeEditorLayoutShadow';
 		
 		//this.popupIntervalId=null;
 		
@@ -667,8 +667,8 @@
 	createTimeEditor: function(element)
 	{
 		var element = $(this.id);
-		var htmlBegin = '<div id="'+this.TIME_EDITOR_SHADOW_ID+'" class="rich-calendar-time-shadow" style="position:absolute; display:none;"></div><table border="0" cellpadding="0" cellspacing="0" id="'+this.TIME_EDITOR_ID+'" style="position:absolute; display:none;"><tbody><tr><td align="center">';
-		var htmlEndn = '</td></tr></tbody></table>';
+		var htmlBegin = '<div id="'+this.TIME_EDITOR_SHADOW_ID+'" class="rich-calendar-time-shadow" style="position:absolute; display:none;"></div><table border="0" cellpadding="0" cellspacing="0" id="'+this.TIME_EDITOR_ID+'" style="position:absolute; display:none;"><tbody><tr><td class="rich-calendar-time-layout-container" align="center"><div style="position:relative; width:100%">';
+		var htmlEndn = '</div></td></tr></tbody></table>';
 		new Insertion.After(element, htmlBegin+this.evaluateMarkup(CalendarView.timeEditor, this.calendarContext));
 		var te_shadow = $(this.TIME_EDITOR_SHADOW_ID);
 		var te = $(this.TIME_EDITOR_ID);
@@ -693,7 +693,7 @@
 	},
 	
 	createSpinnerTable: function(id) {
-		return '<td><table cellspacing="0" cellpadding="0" border="0"><tbody><tr>'+
+		return '<table cellspacing="0" cellpadding="0" border="0"><tbody><tr>'+
 					'<td class="rich-calendar-spinner-input-container">'+
 						'<input id="' + id + '" class="rich-calendar-spinner-input" type="text" />'+
 					'</td>'+	
@@ -713,7 +713,7 @@
 							'</td></tr>'+
 						'</tbody></table>'+
 					'</td>'+
-				'</tr></tbody></table></td>';
+				'</tr></tbody></table>';
 	},
 	
 	setTimeProperties: function() {
@@ -774,15 +774,17 @@
 		this.timePatternHtml = timePattern.replace(/(^|[^\\Hhm])(H{1,2}|h{1,2}|m{2}|a)/g,
 			function($1,$2,$3) {
 				switch ($3) {
-		            case 'a'  : return ($2 ? '<td>'+$2+'</td>' : '')+calendar.createSpinnerTable(id+'TimeSign');//'<input class="rich-calendar-time-input" id="'+id+'TimeSign"/>';
+		            case 'a'  : return ($2 ? '<td>'+$2+'</td>' : '')+'<td>'+calendar.createSpinnerTable(id+'TimeSign')+'</td>';//'<input class="rich-calendar-time-input" id="'+id+'TimeSign"/>';
 		            case 'H'  :
 		            case 'HH' :
 		            case 'h'  :
-		            case 'hh' : return ($2 ? '<td>'+$2+'</td>' : '')+calendar.createSpinnerTable(id+'TimeHours');//'<input class="rich-calendar-time-input" id="'+id+'TimeHours"/>';
-		            case 'mm' : return ($2 ? '<td>'+$2+'</td>' : '')+calendar.createSpinnerTable(id+'TimeMinutes');//'<input class="rich-calendar-time-input" id="'+id+'TimeMinutes"/>';
+		            case 'hh' : return ($2 ? '<td>'+$2+'</td>' : '')+'<td>'+calendar.createSpinnerTable(id+'TimeHours')+'</td>';//'<input class="rich-calendar-time-input" id="'+id+'TimeHours"/>';
+		            case 'mm' : return ($2 ? '<td>'+$2+'</td>' : '')+'<td>'+calendar.createSpinnerTable(id+'TimeMinutes')+'</td>';//'<input class="rich-calendar-time-input" id="'+id+'TimeMinutes"/>';
 				}
 			}
 		);
+		
+		this.timePatternHtml = '<table><tbody><tr>'+this.timePatternHtml+'</tr></tbody></table>';
   		
 		if (m && h)
 		{
@@ -1700,21 +1702,20 @@
 		var te = $(this.TIME_EDITOR_ID);
 		var te_shadow = $(this.TIME_EDITOR_SHADOW_ID);
 		
-		var dim = Richfaces.Calendar.getOffsetDimensions(element);
+		/*var dim = Richfaces.Calendar.getOffsetDimensions(element);
 		te.style.width = te_shadow.style.width = dim.width + 'px';
 		te.style.height = te_shadow.style.height = dim.height + 'px';
 		te.style.left = te_shadow.style.left = element.style.left;
-		te.style.top = te_shadow.style.top = element.style.top;
+		te.style.top = te_shadow.style.top = element.style.top;*/
+		
+		Element.clonePosition(te, element);
+		Element.clonePosition(te_shadow, element);
 
 		this.updateTimeEditor();
 		
 		te.show();
 		te_shadow.show();
-
-		var te_panel = $(this.TIME_EDITOR_PANEL_ID);
-		var te_panel_shadow = $(this.TIME_EDITOR_PANEL_SHADOW_ID);
-		
-		Element.clonePosition(te_panel_shadow, te_panel, {offsetLeft: 3, offsetTop: 3});
+		Element.clonePosition(this.TIME_EDITOR_LAYOUT_SHADOW_ID, this.TIME_EDITOR_LAYOUT_ID, {offsetLeft: 3, offsetTop: 3});
 	},
 	
 	hideTimeEditor: function(updateTime)
@@ -1865,16 +1866,18 @@
 	)];
 	
 CalendarView.timeEditor = [
-    new E('div', {'style': 'position: relative; width: 100%;'}, [                       
-        new E('table',{'id': function(context) { return context.calendar.TIME_EDITOR_PANEL_ID; }, 'border': '0', 'cellpadding': '0', 'cellspacing': '0', 'class': 'rich-calendar-time-layout'},
+
+        new E('div',{'id': function(context){return context.calendar.TIME_EDITOR_LAYOUT_SHADOW_ID}, 'class': 'rich-calendar-time-layout-shadow'},null),
+
+        new E('table',{'id': function(context){return context.calendar.TIME_EDITOR_LAYOUT_ID}, 'border': '0', 'cellpadding': '0', 'cellspacing': '0', 'class': 'rich-calendar-time-layout'},
 		[
 			new E('tbody',{},
 			[
 				new E('tr',{},
 				[
-					new E('td',{'class': 'rich-calendar-time-layout-fields', 'colspan': '2'},
+					new E('td',{'class': 'rich-calendar-time-layout-fields', 'colspan': '2', 'align': 'center'},
 					[
-						new E('table', null, [new E('tbody', null, [new E('tr', null, [new ET(function (context) { return Richfaces.evalMacro("timeEditorFields", context)})])])])
+						new ET(function (context) { return Richfaces.evalMacro("timeEditorFields", context)})
 					])
 				]),
 				new E('tr',{},
@@ -1896,15 +1899,8 @@
 					])
 				])
 			])
-		]),
-		
-		new E('div', 
-			{
-				'id':  function(context) { return context.calendar.TIME_EDITOR_PANEL_SHADOW_ID; },
-				'class': 'rich-calendar-time-editor-shadow'
-			} 
-		, null)
-	])];
+		]
+	)];
 
 CalendarView.dayList = [new ET(function (context) { return context.day})];
 CalendarView.weekNumber = [new ET(function (context) { return context.weekNumber})];

Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx	2007-12-03 14:14:17 UTC (rev 4421)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx	2007-12-03 14:16:46 UTC (rev 4422)
@@ -11,7 +11,7 @@
 	<f:clientid var="clientId" />
 	<h:scripts>new org.ajax4jsf.javascript.PrototypeScript(),new org.ajax4jsf.javascript.AjaxScript(),/org/richfaces/renderkit/html/scripts/events.js,/org/richfaces/renderkit/html/scripts/utils.js,/org/richfaces/renderkit/html/scripts/json/json-dom.js,/org/richfaces/renderkit/html/scripts/scriptaculous/effects.js,/org/richfaces/renderkit/html/scripts/jquery/jquery.js,/org/richfaces/renderkit/html/scripts/jquery/jquery.js,/org/richfaces/renderkit/html/scripts/JQuerySpinBtn.js,/org/richfaces/renderkit/html/scripts/calendar.js</h:scripts>
 
-	<h:styles>/org/richfaces/renderkit/html/css/JQuerySpinBtn.xcss,/org/richfaces/renderkit/html/css/calendar.xcss</h:styles>
+	<h:styles>/org/richfaces/renderkit/html/css/calendar.xcss</h:styles>
 
 	<f:call name="addPopupToAjaxRendered" />
 	




More information about the richfaces-svn-commits mailing list