Author: SergeySmirnov
Date: 2008-06-11 15:59:38 -0400 (Wed, 11 Jun 2008)
New Revision: 9009
Modified:
trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/index.jsp
trunk/sandbox/ui/hotKey/src/main/config/component/hotKey.xml
trunk/sandbox/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/hotKey.js
trunk/sandbox/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx
Log:
operation attribute is removed. Boolean for boolean is added
Modified: trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/index.jsp 2008-06-11
17:49:45 UTC (rev 9008)
+++ trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/index.jsp 2008-06-11
19:59:38 UTC (rev 9009)
@@ -8,13 +8,14 @@
</head>
<body>
<f:view>
- Alt-A is turned off and Alt-L is turned on just after whole page load
(refresh)<br/>
+ Alt+A and Alt+L are turned on when page is loaded<br/>
<sb:hotKey id="me" key="alt+a" timing="immediate"
handler="alert('alt+A is pressed')" />
- <sb:hotKey operation="remove" key="alt+a"
timing="onload" />
<sb:hotKey id="you" key="alt+l" timing="immediate"
handler="alert('alt+L is pressed')" />
<button onclick="${rich:component('me')}.invoke()">Turn Alt-A
On</button>
+ <button onclick="${rich:component('me')}.remove()">Turn Alt-A
Off</button>
+ <button onclick="${rich:component('you')}.invoke()">Turn Alt-L
On</button>
<button onclick="${rich:component('you')}.remove()">Turn Alt-L
Off</button>
</f:view>
Modified: trunk/sandbox/ui/hotKey/src/main/config/component/hotKey.xml
===================================================================
--- trunk/sandbox/ui/hotKey/src/main/config/component/hotKey.xml 2008-06-11 17:49:45 UTC
(rev 9008)
+++ trunk/sandbox/ui/hotKey/src/main/config/component/hotKey.xml 2008-06-11 19:59:38 UTC
(rev 9009)
@@ -36,13 +36,6 @@
<defaultvalue>""</defaultvalue>
</property>
<property>
- <name>operation</name>
- <classname>java.lang.String</classname>
- <description>
- </description>
- <defaultvalue>"add"</defaultvalue>
- </property>
- <property>
<name>timing</name>
<classname>java.lang.String</classname>
<description>
@@ -65,24 +58,21 @@
</property>
<property>
<name>propagete</name>
- <classname>java.lang.String</classname>
+ <classname>java.lang.Boolean</classname>
<description>
</description>
- <defaultvalue>""</defaultvalue>
</property>
<property>
<name>disableInInput</name>
- <classname>java.lang.String</classname>
+ <classname>java.lang.Boolean</classname>
<description>
</description>
- <defaultvalue>""</defaultvalue>
</property>
<property>
<name>checkParent</name>
- <classname>java.lang.String</classname>
+ <classname>java.lang.Boolean</classname>
<description>
</description>
- <defaultvalue>""</defaultvalue>
</property>
<property>
<name>handler</name>
Modified:
trunk/sandbox/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/hotKey.js
===================================================================
---
trunk/sandbox/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/hotKey.js 2008-06-11
17:49:45 UTC (rev 9008)
+++
trunk/sandbox/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/hotKey.js 2008-06-11
19:59:38 UTC (rev 9009)
@@ -9,10 +9,7 @@
document.getElementById(id).component = this;
this.invoke = function() {
- if ("add" == this.options.operation)
this.add(this.key, this.options, this.handler);
- else if ("remove" == this.options.operation)
- this.remove(this.key, this.options);
}
this.destroy = function() {
this.element.component = null;
Modified: trunk/sandbox/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx
===================================================================
--- trunk/sandbox/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx 2008-06-11
17:49:45 UTC (rev 9008)
+++ trunk/sandbox/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx 2008-06-11
19:59:38 UTC (rev 9009)
@@ -11,7 +11,6 @@
<f:clientid var="clientId"/>
<c:set var="key"
value="#{component.attributes['key']}"/>
- <c:set var="operation"
value="#{component.attributes['operation']}"/>
<c:set var="timing"
value="#{component.attributes['timing']}"/>
<c:set var="type"
value="#{component.attributes['type']}"/>
<c:set var="propagete"
value="#{component.attributes['propagete']}"/>
@@ -22,41 +21,38 @@
<h:scripts>/org/richfaces/renderkit/html/scripts/jquery/jquery.js,/org/richfaces/renderkit/html/scripts/jquery.hotkeys.js,/org/richfaces/renderkit/html/scripts/hotKey.js</h:scripts>
<jsp:scriptlet>
<![CDATA[
- StringBuffer options= new StringBuffer("{");
- String operation = (String) variables.getVariable("operation");
- options.append("operation:'");
- options.append(operation);
- options.append("'");
+ StringBuffer options = new StringBuffer("{");
+
+ String timing = (String) variables.getVariable("timing");
+ options.append("timing:'");
+ options.append(timing);
+ options.append("'");
+
String type = (String) variables.getVariable("type");
- if (!type.equals("")) {
+ if (! type.equals("")) {
options.append(",type:'");
options.append(type);
options.append("'");
}
String propagete = (String) variables.getVariable("propagete");
- if (!propagete.equals("")) {
+ if (propagete!=null) {
options.append(",propagete:");
options.append(propagete);
}
String disableInInput = (String) variables.getVariable("disableInInput");
- if (!propagete.equals("")) {
+ if (disableInInput!=null) {
options.append(",disableInInput:");
options.append(disableInInput);
}
String checkParent = (String) variables.getVariable("checkParent");
- if (!propagete.equals("")) {
+ if (checkParent!=null) {
options.append(",checkParent:");
options.append(checkParent);
}
- String timing = (String) variables.getVariable("timing");
- options.append(",timing:'");
- options.append(timing);
- options.append("'");
-
options.append("}");
variables.setVariable("options", options);