<p dir="ltr"><br>
Le 30 sept. 2014 17:19, &quot;Esteban A. Maringolo&quot; &lt;<a href="mailto:emaringolo@gmail.com">emaringolo@gmail.com</a>&gt; a écrit :<br>
&gt;<br>
&gt; IMHO JSIfThenElse should be the name of decoration class, and replace<br>
&gt; all the references to it by JSTernary or similar.<br>
&gt;<br>
&gt; But feel free to change it to whatever you like the most, I&#39;m fine as<br>
&gt; long as there is a way to define a JS if/then/else statement using<br>
&gt; decorators.</p>
<p dir="ltr">Is there anyone having Cliff notes of the JS classes ? </p>
<p dir="ltr">It is actually quite hard to figure out how to make them all work together.</p>
<p dir="ltr">Phil<br>
&gt;<br>
&gt; Regards!<br>
&gt;<br>
&gt;<br>
&gt; Esteban A. Maringolo<br>
&gt;<br>
&gt;<br>
&gt; 2014-09-30 12:14 GMT-03:00 Johan Brichau &lt;<a href="mailto:johan@inceptive.be">johan@inceptive.be</a>&gt;:<br>
&gt; &gt; Esteban,<br>
&gt; &gt;<br>
&gt; &gt; As a short note, I forgot to reply that I was a tad confused by the naming<br>
&gt; &gt; of the method.<br>
&gt; &gt; I would prefer to have something like #classicalthen: else: where the<br>
&gt; &gt; pattern stays &lt;condition&gt; &lt;then&gt; &lt;else&gt;, while your suggestion transforms it<br>
&gt; &gt; to &lt;then&gt; &lt;condition&gt; &lt;else&gt;<br>
&gt; &gt;<br>
&gt; &gt; So, then we are down to choosing a name, which is probably why you ended up<br>
&gt; &gt; with #condition: else:<br>
&gt; &gt;<br>
&gt; &gt; Johan<br>
&gt; &gt;<br>
&gt; &gt; On 30 Sep 2014, at 16:48, Johan Brichau &lt;<a href="mailto:johan@inceptive.be">johan@inceptive.be</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; Hi Esteban,<br>
&gt; &gt;<br>
&gt; &gt; I picked up your request and was going to look at it but ran out of time.<br>
&gt; &gt; The best idea is to create a ticket on<br>
&gt; &gt; <a href="https://code.google.com/p/seaside/issues/list">https://code.google.com/p/seaside/issues/list</a><br>
&gt; &gt;<br>
&gt; &gt; thanks<br>
&gt; &gt; Johan<br>
&gt; &gt;<br>
&gt; &gt; On 30 Sep 2014, at 15:24, Esteban A. Maringolo &lt;<a href="mailto:emaringolo@gmail.com">emaringolo@gmail.com</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; No replies to this request in a week.<br>
&gt; &gt; Can I have write access to the repo?<br>
&gt; &gt;<br>
&gt; &gt; Who is the principal maintainer of Seaside?<br>
&gt; &gt;<br>
&gt; &gt; Esteban A. Maringolo<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; 2014-09-22 17:21 GMT-03:00 Esteban A. Maringolo &lt;<a href="mailto:emaringolo@gmail.com">emaringolo@gmail.com</a>&gt;:<br>
&gt; &gt;<br>
&gt; &gt; I was trying to implement a classical &quot;if {...} else {...}&quot; object using<br>
&gt; &gt; JSDecorations.<br>
&gt; &gt; Then I found there is a JSCondition, but there is no way to describe an<br>
&gt; &gt; &quot;else&quot; statement.<br>
&gt; &gt;<br>
&gt; &gt; Also there is an JSIfThenElse decoration, but it is implemented as a ternary<br>
&gt; &gt; operator (x ? y : z) instead of &#39;if(x){ y} else {z}&#39;<br>
&gt; &gt;<br>
&gt; &gt; So I added an extension to JSObject, named #condition:else: and also a<br>
&gt; &gt; JSConditionElse decoration which produces the expected output.<br>
&gt; &gt;<br>
&gt; &gt; Can this be added to the main trunk of the Javascript-Core package?<br>
&gt; &gt;<br>
&gt; &gt; The changes are attached.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; With these modifications I was able to transform this Javascript:<br>
&gt; &gt;    $(&#39;#ajaxId tbody&#39;).on( &#39;click&#39;, &#39;tr&#39;, function () {<br>
&gt; &gt;        if ( $(this).hasClass(&#39;selected&#39;) ) {<br>
&gt; &gt;            $(this).removeClass(&#39;selected&#39;);<br>
&gt; &gt;        }<br>
&gt; &gt;        else {<br>
&gt; &gt;            $(&#39;#ajaxId tr.selected&#39;).removeClass(&#39;selected&#39;);<br>
&gt; &gt;            $(this).addClass(&#39;selected&#39;);<br>
&gt; &gt;        }<br>
&gt; &gt;    } );<br>
&gt; &gt;<br>
&gt; &gt; Into this:<br>
&gt; &gt;<br>
&gt; &gt; | selClass |<br>
&gt; &gt; selClass := &#39;selected&#39;.<br>
&gt; &gt; ^ (html jQuery: &#39;#&#39; , self ajaxId , &#39; tbody&#39;)<br>
&gt; &gt; on: &#39;click&#39;<br>
&gt; &gt; selector: &#39;tr&#39;<br>
&gt; &gt; do:<br>
&gt; &gt; ((html jQuery this removeClass: selClass)<br>
&gt; &gt; condition: (html jQuery this hasClass: selClass)<br>
&gt; &gt; else:<br>
&gt; &gt; (JSScript new<br>
&gt; &gt; add: ((html jQuery: &#39;#&#39; , self ajaxId , &#39; tr.&#39; , selClass) removeClass:<br>
&gt; &gt; selClass);<br>
&gt; &gt; add: (html jQuery this addClass: selClass);<br>
&gt; &gt; yourself))<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Esteban A. Maringolo<br>
&gt; &gt;<br>
&gt; &gt; ps: An alternative solution would be to modify the JSIfThenElse, but this<br>
&gt; &gt; would require adding returns to the trueStatement and falseStatement of this<br>
&gt; &gt; class.<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; seaside-dev mailing list<br>
&gt; &gt; <a href="mailto:seaside-dev@lists.squeakfoundation.org">seaside-dev@lists.squeakfoundation.org</a><br>
&gt; &gt; <a href="http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev">http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; seaside-dev mailing list<br>
&gt; &gt; <a href="mailto:seaside-dev@lists.squeakfoundation.org">seaside-dev@lists.squeakfoundation.org</a><br>
&gt; &gt; <a href="http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev">http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev</a><br>
&gt; &gt;<br>
&gt; _______________________________________________<br>
&gt; seaside-dev mailing list<br>
&gt; <a href="mailto:seaside-dev@lists.squeakfoundation.org">seaside-dev@lists.squeakfoundation.org</a><br>
&gt; <a href="http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev">http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev</a><br>
</p>