<p dir="ltr"><br>
Le 30 sept. 2014 17:19, "Esteban A. Maringolo" <<a href="mailto:emaringolo@gmail.com">emaringolo@gmail.com</a>> a écrit :<br>
><br>
> IMHO JSIfThenElse should be the name of decoration class, and replace<br>
> all the references to it by JSTernary or similar.<br>
><br>
> But feel free to change it to whatever you like the most, I'm fine as<br>
> long as there is a way to define a JS if/then/else statement using<br>
> 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>
><br>
> Regards!<br>
><br>
><br>
> Esteban A. Maringolo<br>
><br>
><br>
> 2014-09-30 12:14 GMT-03:00 Johan Brichau <<a href="mailto:johan@inceptive.be">johan@inceptive.be</a>>:<br>
> > Esteban,<br>
> ><br>
> > As a short note, I forgot to reply that I was a tad confused by the naming<br>
> > of the method.<br>
> > I would prefer to have something like #classicalthen: else: where the<br>
> > pattern stays <condition> <then> <else>, while your suggestion transforms it<br>
> > to <then> <condition> <else><br>
> ><br>
> > So, then we are down to choosing a name, which is probably why you ended up<br>
> > with #condition: else:<br>
> ><br>
> > Johan<br>
> ><br>
> > On 30 Sep 2014, at 16:48, Johan Brichau <<a href="mailto:johan@inceptive.be">johan@inceptive.be</a>> wrote:<br>
> ><br>
> > Hi Esteban,<br>
> ><br>
> > I picked up your request and was going to look at it but ran out of time.<br>
> > The best idea is to create a ticket on<br>
> > <a href="https://code.google.com/p/seaside/issues/list">https://code.google.com/p/seaside/issues/list</a><br>
> ><br>
> > thanks<br>
> > Johan<br>
> ><br>
> > On 30 Sep 2014, at 15:24, Esteban A. Maringolo <<a href="mailto:emaringolo@gmail.com">emaringolo@gmail.com</a>> wrote:<br>
> ><br>
> > 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 <<a href="mailto:emaringolo@gmail.com">emaringolo@gmail.com</a>>:<br>
> ><br>
> > 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>
> > $('#ajaxId tbody').on( 'click', 'tr', function () {<br>
> > if ( $(this).hasClass('selected') ) {<br>
> > $(this).removeClass('selected');<br>
> > }<br>
> > else {<br>
> > $('#ajaxId tr.selected').removeClass('selected');<br>
> > $(this).addClass('selected');<br>
> > }<br>
> > } );<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>
> ><br>
> > _______________________________________________<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>
> ><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<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>
> ><br>
> _______________________________________________<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>
</p>