[richfaces-svn-commits] JBoss Rich Faces SVN: r18322 - in root/sandbox/ui/inputs/inputnumberslider: src/main/config and 2 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Aug 2 12:52:46 EDT 2010


Author: konstantin.mishin
Date: 2010-08-02 12:52:45 -0400 (Mon, 02 Aug 2010)
New Revision: 18322

Modified:
   root/sandbox/ui/inputs/inputnumberslider/pom.xml
   root/sandbox/ui/inputs/inputnumberslider/src/main/config/faces-config.xml
   root/sandbox/ui/inputs/inputnumberslider/src/main/resources/META-INF/resources/inputNumberSlider.js
   root/sandbox/ui/inputs/inputnumberslider/src/main/templates/inputnumberslider.template.xml
Log:
RF-8983

Modified: root/sandbox/ui/inputs/inputnumberslider/pom.xml
===================================================================
--- root/sandbox/ui/inputs/inputnumberslider/pom.xml	2010-08-02 16:24:05 UTC (rev 18321)
+++ root/sandbox/ui/inputs/inputnumberslider/pom.xml	2010-08-02 16:52:45 UTC (rev 18322)
@@ -57,11 +57,11 @@
 			<groupId>org.richfaces.core</groupId>
 			<artifactId>richfaces-core-impl</artifactId>
 		</dependency>
-		<dependency>
+		<!--dependency>
 			<groupId>org.richfaces.cdk</groupId>
 			<artifactId>annotations</artifactId>
 			<scope>provided</scope>
-		</dependency>
+		</dependency-->
 
 		<dependency>
 			<groupId>${jsf2.api.groupid}</groupId>

Modified: root/sandbox/ui/inputs/inputnumberslider/src/main/config/faces-config.xml
===================================================================
--- root/sandbox/ui/inputs/inputnumberslider/src/main/config/faces-config.xml	2010-08-02 16:24:05 UTC (rev 18321)
+++ root/sandbox/ui/inputs/inputnumberslider/src/main/config/faces-config.xml	2010-08-02 16:52:45 UTC (rev 18322)
@@ -38,6 +38,20 @@
 			</property-extension>
 		</property>
 		<property>
+			<property-name>decreaseClass</property-name>
+			<property-class>java.lang.String</property-class>
+			<property-extension>
+				<cdk:generate>true</cdk:generate>
+			</property-extension>
+		</property>
+		<property>
+			<property-name>decreaseSelectedClass</property-name>
+			<property-class>java.lang.String</property-class>
+			<property-extension>
+				<cdk:generate>true</cdk:generate>
+			</property-extension>
+		</property>
+		<property>
 			<property-name>delay</property-name>
 			<property-class>int</property-class>
 			<default-value>200</default-value>
@@ -54,6 +68,34 @@
 			</property-extension>
 		</property>
 		<property>
+			<property-name>handleClass</property-name>
+			<property-class>java.lang.String</property-class>
+			<property-extension>
+				<cdk:generate>true</cdk:generate>
+			</property-extension>
+		</property>
+		<property>
+			<property-name>handleSelectedClass</property-name>
+			<property-class>java.lang.String</property-class>
+			<property-extension>
+				<cdk:generate>true</cdk:generate>
+			</property-extension>
+		</property>
+		<property>
+			<property-name>increaseClass</property-name>
+			<property-class>java.lang.String</property-class>
+			<property-extension>
+				<cdk:generate>true</cdk:generate>
+			</property-extension>
+		</property>
+		<property>
+			<property-name>increaseSelectedClass</property-name>
+			<property-class>java.lang.String</property-class>
+			<property-extension>
+				<cdk:generate>true</cdk:generate>
+			</property-extension>
+		</property>
+		<property>
 			<property-name>inputPosition</property-name>
 			<property-class>org.richfaces.renderkit.html.PositionType</property-class>
 			<default-value>PositionType.right</default-value>

Modified: root/sandbox/ui/inputs/inputnumberslider/src/main/resources/META-INF/resources/inputNumberSlider.js
===================================================================
--- root/sandbox/ui/inputs/inputnumberslider/src/main/resources/META-INF/resources/inputNumberSlider.js	2010-08-02 16:24:05 UTC (rev 18321)
+++ root/sandbox/ui/inputs/inputnumberslider/src/main/resources/META-INF/resources/inputNumberSlider.js	2010-08-02 16:52:45 UTC (rev 18322)
@@ -31,8 +31,15 @@
 	    minValue: 0,
 	    step: 1,
 	
-	    init: function (id, options) {
+	    decreaseSelectedClass: "rf-ins-db-s",
+	    handleSelectedClass: "rf-ins-h-s",
+	    increaseSelectedClass: "rf-ins-ib-s",
+
+	    init: function (id, options, selectedClasses) {
 			jQuery.extend(this, options);
+			for (var i in selectedClasses) {
+				this[i] += " " + selectedClasses[i];
+			}
 	        this.range = this.maxValue - this.minValue;
 	        this.id = id;
 	        this.element = jQuery(this.attachToDom());
@@ -99,7 +106,7 @@
 	    		component.setValue(Number(component.input.val()) - component.step);
 	    	}, this.delay);
 	    	jQuery(document).one("mouseup", true, jQuery.proxy(this.__clearInterval, this));
-	    	this.decrease.addClass("rf-ins-db-s");
+	    	this.decrease.addClass(this.decreaseSelectedClass);
 	    	event.preventDefault();
 	    },
 	    
@@ -109,16 +116,16 @@
 	    		component.setValue(Number(component.input.val()) + component.step);
 	    	}, this.delay);
 	    	jQuery(document).one("mouseup",jQuery.proxy(this.__clearInterval, this));
-	    	this.increase.addClass("rf-ins-ib-s");
+	    	this.increase.addClass(this.increaseSelectedClass);
 	    	event.preventDefault();
 	    },
 	    
 	    __clearInterval: function (event) {
 	    	window.clearInterval(this.intervalId);
-	    	if (event.data) { // increase
-	    		this.decrease.removeClass("rf-ins-db-s");
+	    	if (event.data) { // decrease
+	    		this.decrease.removeClass(this.decreaseSelectedClass);
 	    	} else {
-	    		this.increase.removeClass("rf-ins-ib-s");
+	    		this.increase.removeClass(this.increaseSelectedClass);
 	    	}
 	    },
 	    
@@ -128,7 +135,7 @@
 	    	var jQueryDocument = jQuery(document);
 	    	jQueryDocument.mousemove(jQuery.proxy(this.__mousemoveHandler, this));
 	    	jQueryDocument.one("mouseup", jQuery.proxy(this.__mouseupHandler, this));
-	    	this.handle.addClass("rf-ins-h-s");
+	    	this.handle.addClass(this.handleSelectedClass);
 	    	this.tooltip.show();
 	    },
 	    
@@ -140,7 +147,7 @@
 	    },
 	    
 	    __mouseupHandler: function () {
-	    	this.handle.removeClass("rf-ins-h-s");
+	    	this.handle.removeClass(this.handleSelectedClass);
 	    	this.tooltip.hide();
 	    	jQuery(document).unbind("mousemove", this.__mousemoveHandler);
 	    }

Modified: root/sandbox/ui/inputs/inputnumberslider/src/main/templates/inputnumberslider.template.xml
===================================================================
--- root/sandbox/ui/inputs/inputnumberslider/src/main/templates/inputnumberslider.template.xml	2010-08-02 16:24:05 UTC (rev 18321)
+++ root/sandbox/ui/inputs/inputnumberslider/src/main/templates/inputnumberslider.template.xml	2010-08-02 16:52:45 UTC (rev 18322)
@@ -51,7 +51,7 @@
 				</c:if>
 			</c:if>
 			<c:if test="#{component.attributes['showArrows']}">
-				<a class="rf-ins-db" href="javascript:void(0);" />
+				<a class="rf-ins-db #{component.attributes['decreaseClass']}" href="javascript:void(0);" />
 			</c:if>
 			<span class="rf-ins-ta">
 				<c:if test="#{component.attributes['showBoundaryValues']}">
@@ -59,11 +59,11 @@
 					<span class="rf-ins-mx">#{component.attributes['maxValue']}</span>
 				</c:if>
 				<span class="rf-ins-t #{component.attributes['trackClass']}">
-					<span class="rf-ins-h" />
+					<span class="rf-ins-h #{component.attributes['handleClass']}" />
 				</span>
 			</span>
 			<c:if test="#{component.attributes['showArrows']}">
-				<a class="rf-ins-ib" href="javascript:void(0);" />
+				<a class="rf-ins-ib #{component.attributes['increaseClass']}" href="javascript:void(0);" />
 			</c:if>
 			<c:if test="#{PositionType.valueOf('right') == component.attributes['inputPosition']
 				|| PositionType.valueOf('bottom') == component.attributes['inputPosition']}">
@@ -83,6 +83,10 @@
 				maxValue: #{component.attributes['maxValue']},
 				minValue: #{component.attributes['minValue']},
 				step: #{component.attributes['step']}
+			}, {
+				decreaseSelectedClass: '#{component.attributes['decreaseSelectedClass']}',
+				handleSelectedClass: '#{component.attributes['handleSelectedClass']}',
+				increaseSelectedClass: '#{component.attributes['increaseSelectedClass']}'
 			});</script>
 		</span>
 	</cc:implementation>



More information about the richfaces-svn-commits mailing list