[richfaces-svn-commits] JBoss Rich Faces SVN: r2156 - in trunk: ui/effect/src/main/resources/org/richfaces/renderkit/html/script and 1 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Aug 8 13:21:00 EDT 2007


Author: SergeySmirnov
Date: 2007-08-08 13:21:00 -0400 (Wed, 08 Aug 2007)
New Revision: 2156

Modified:
   trunk/samples/effect-sample/src/main/webapp/effect.xhtml
   trunk/ui/effect/src/main/resources/org/richfaces/renderkit/html/script/processEffect.js
   trunk/ui/effect/src/main/templates/effect.jspx
Log:
'on' removal for effect name. ability to add observer to object like window

Modified: trunk/samples/effect-sample/src/main/webapp/effect.xhtml
===================================================================
--- trunk/samples/effect-sample/src/main/webapp/effect.xhtml	2007-08-08 17:20:56 UTC (rev 2155)
+++ trunk/samples/effect-sample/src/main/webapp/effect.xhtml	2007-08-08 17:21:00 UTC (rev 2156)
@@ -72,7 +72,8 @@
 
 	<div id="dpanel" style="width:100px;height:100px;background-color:lightgreen">&nbsp;</div>	
 
-	<e:effect event="click" for="dpanel" type="Fade" params="duration:0.8, id:'my'" />
+	<e:effect event="onclick" for="dpanel" type="Fade" params="duration:0.8, id:'my'" />
+	<e:effect event="load" for="window" type="Fade" params="duration:0.8" />
 
          <div style="margin:10px;"><a href='javascript:void(0)'
           onclick='new Effect["Opacity"]( document.getElementById("mynewpanel"),{duration:0.8, from:1.0, to:0.2} );'>Click for Demo!</a><br /></div>

Modified: trunk/ui/effect/src/main/resources/org/richfaces/renderkit/html/script/processEffect.js
===================================================================
--- trunk/ui/effect/src/main/resources/org/richfaces/renderkit/html/script/processEffect.js	2007-08-08 17:20:56 UTC (rev 2155)
+++ trunk/ui/effect/src/main/resources/org/richfaces/renderkit/html/script/processEffect.js	2007-08-08 17:21:00 UTC (rev 2156)
@@ -5,7 +5,11 @@
 "var h=Object.extend(param.evalJSON(), aparam);"+
 "new Effect[h.type||etype]($(h.id||cid),h);");
 
+Richfaces.effectEventOnOut = new Function("ename",
+"return ename.substr(0,2)=='on'?ename.substr(2):ename;");
 
+
+
 /*
 Richfaces.addEffectObserve= new Function("oid", "oevent","otype","oparams","useCapture",
 "var funcpart='{}';"+

Modified: trunk/ui/effect/src/main/templates/effect.jspx
===================================================================
--- trunk/ui/effect/src/main/templates/effect.jspx	2007-08-08 17:20:56 UTC (rev 2155)
+++ trunk/ui/effect/src/main/templates/effect.jspx	2007-08-08 17:21:00 UTC (rev 2156)
@@ -52,8 +52,9 @@
 <c:if test="#{needsObserver}">
 <script type="text/javascript" x:passThruWithExclusions="name,type,for">
  //<![CDATA[
-var pm ="{"+"#{params}"+"}";
-Event.observe($('#{forid}'),'#{event}', Function("Richfaces.processEffect('#{forid}','#{type}',{},pm );"),false);
+var pm ="{"+"#{params}"+"}";var ename = Richfaces.effectEventOnOut('#{event}');
+var obj= typeof #{forid} == "object"? #{forid}:$('#{forid}');
+Event.observe(obj,ename, Function("Richfaces.processEffect('#{forid}','#{type}',{},pm );"),{#{params}}.useCapture||false);
 //]]>
 </script>
 </c:if>




More information about the richfaces-svn-commits mailing list