<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Esteban,</div><div><br></div>As a short note, I forgot to reply that I was a tad confused by the naming of the method.<div>I would prefer to have something like #classicalthen: else: where the pattern stays &lt;condition&gt; &lt;then&gt; &lt;else&gt;, while your suggestion transforms it to &lt;then&gt; &lt;condition&gt; &lt;else&gt;</div><div><br></div><div>So, then we are down to choosing a name, which is probably why you ended up with #condition: else:&nbsp;</div><div><br></div><div>Johan</div><div><br><div><div>On 30 Sep 2014, at 16:48, Johan Brichau &lt;<a href="mailto:johan@inceptive.be">johan@inceptive.be</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Esteban,<div><br></div><div>I picked up your request and was going to look at it but ran out of time.</div><div>The best idea is to create a ticket on&nbsp;<a href="https://code.google.com/p/seaside/issues/list">https://code.google.com/p/seaside/issues/list</a></div><div><br></div><div>thanks</div><div>Johan</div><div><br></div><div><div><div>On 30 Sep 2014, at 15:24, Esteban A. Maringolo &lt;<a href="mailto:emaringolo@gmail.com">emaringolo@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">No replies to this request in a week.<br>Can I have write access to the repo?<br><br>Who is the principal maintainer of Seaside?<br><br>Esteban A. Maringolo<br><br><br>2014-09-22 17:21 GMT-03:00 Esteban A. Maringolo &lt;<a href="mailto:emaringolo@gmail.com">emaringolo@gmail.com</a>&gt;:<br><blockquote type="cite">I was trying to implement a classical "if {...} else {...}" object using<br>JSDecorations.<br>Then I found there is a JSCondition, but there is no way to describe an<br>"else" statement.<br><br>Also there is an JSIfThenElse decoration, but it is implemented as a ternary<br>operator (x ? y : z) instead of 'if(x){ y} else {z}'<br><br>So I added an extension to JSObject, named #condition:else: and also a<br>JSConditionElse decoration which produces the expected output.<br><br>Can this be added to the main trunk of the Javascript-Core package?<br><br>The changes are attached.<br><br><br>With these modifications I was able to transform this Javascript:<br> &nbsp;&nbsp;&nbsp;$('#ajaxId tbody').on( 'click', 'tr', function () {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( $(this).hasClass('selected') ) {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).removeClass('selected');<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('#ajaxId tr.selected').removeClass('selected');<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).addClass('selected');<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br> &nbsp;&nbsp;&nbsp;} );<br><br>Into this:<br><br>| selClass |<br>selClass := 'selected'.<br>^ (html jQuery: '#' , self ajaxId , ' tbody')<br>on: 'click'<br>selector: 'tr'<br>do:<br>((html jQuery this removeClass: selClass)<br>condition: (html jQuery this hasClass: selClass)<br>else:<br>(JSScript new<br>add: ((html jQuery: '#' , self ajaxId , ' tr.' , selClass) removeClass:<br>selClass);<br>add: (html jQuery this addClass: selClass);<br>yourself))<br><br><br>Esteban A. Maringolo<br><br>ps: An alternative solution would be to modify the JSIfThenElse, but this<br>would require adding returns to the trueStatement and falseStatement of this<br>class.<br></blockquote>_______________________________________________<br>seaside-dev mailing list<br><a href="mailto:seaside-dev@lists.squeakfoundation.org">seaside-dev@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev">http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev</a><br></blockquote></div><br></div></div></blockquote></div><br></div></body></html>