branaway / Japid

A Java-based statically-typed fast template engine that can be used in any Java code. It has special adapter for use with the Play! Framework.
113 stars 18 forks source link

Implement a $jsRoute() static method #42

Closed mikenikles closed 12 years ago

mikenikles commented 12 years ago

Hi,

Play introduced a #{jsRoute} tag in 1.2.4 (see http://www.playframework.org/documentation/1.2.4/tags#jsroute). The corresponding commit is https://github.com/playframework/play/commit/02d4176e4e0422765b1e97.

It would be great to include a jsRoute static method in the JapidPlayAdapter (https://github.com/branaway/Japid/blob/master/src.japidplay/cn/bran/play/JapidPlayAdapter.java).

In addition, the RouteAdapter (https://github.com/branaway/Japid/blob/master/src.japidplay/cn/bran/play/RouteAdapter.java) should probably provide a method to obtain an ActionDefinition object as it's created in the lookup() method.

The JapidPlayAdapter can then, as it can be seen in the Play commit above, use the ActionDefinition object in the new jsRoute static method.

Having that would make a switch from the Groovy templating engine to Japid much easier. No javascript code would have to be modified.

Sorry for not providing you with a pull request. I thought setting up the Japid project locally and changing the code takes much longer than letting you do it with the information provided in this issue.

Thanks,

Mike

branaway commented 12 years ago

I'll take a look at that in my next free cycle. Thanks again Mike.

2012/1/18 Agile Consulting < reply@reply.github.com

Hi,

Play introduced a #{jsRoute} tag in 1.2.4 (see http://www.playframework.org/documentation/1.2.4/tags#jsroute). The corresponding commit is https://github.com/playframework/play/commit/02d4176e4e0422765b1e97.

It would be great to include a jsRoute static method in the JapidPlayAdapter ( https://github.com/branaway/Japid/blob/master/src.japidplay/cn/bran/play/JapidPlayAdapter.java ).

In addition, the RouteAdapter ( https://github.com/branaway/Japid/blob/master/src.japidplay/cn/bran/play/RouteAdapter.java) should probably provide a method to obtain an ActionDefinition object as it's created in the lookup() method.

The JapidPlayAdapter can then, as it can be seen in the Play commit above, use the ActionDefinition object in the new jsRoute static method.

Having that would make a switch from the Groovy templating engine to Japid much easier. No javascript code would have to be modified.

Sorry for not providing you with a pull request. I thought setting up the Japid project locally and changing the code takes much longer than letting you do it with the information provided in this issue.

Thanks,

Mike


Reply to this email directly or view it on GitHub: https://github.com/branaway/Japid/issues/42

branaway commented 12 years ago

Hi Mike,

I have push a new version to the module repository: 0.9.2.7. Could you please verify it work as intended? I just implemented exactly as you have suggested.

Thanks!

Bing

2012/1/18 Agile Consulting < reply@reply.github.com

Hi,

Play introduced a #{jsRoute} tag in 1.2.4 (see http://www.playframework.org/documentation/1.2.4/tags#jsroute). The corresponding commit is https://github.com/playframework/play/commit/02d4176e4e0422765b1e97.

It would be great to include a jsRoute static method in the JapidPlayAdapter ( https://github.com/branaway/Japid/blob/master/src.japidplay/cn/bran/play/JapidPlayAdapter.java ).

In addition, the RouteAdapter ( https://github.com/branaway/Japid/blob/master/src.japidplay/cn/bran/play/RouteAdapter.java) should probably provide a method to obtain an ActionDefinition object as it's created in the lookup() method.

The JapidPlayAdapter can then, as it can be seen in the Play commit above, use the ActionDefinition object in the new jsRoute static method.

Having that would make a switch from the Groovy templating engine to Japid much easier. No javascript code would have to be modified.

Sorry for not providing you with a pull request. I thought setting up the Japid project locally and changing the code takes much longer than letting you do it with the information provided in this issue.

Thanks,

Mike


Reply to this email directly or view it on GitHub: https://github.com/branaway/Japid/issues/42

mikenikles commented 12 years ago

Hi Bing,

Excellent, that works exactly as expected. Thanks!

I'll hopefully get around to properly fork and set up your project so I can start providing pull requests when / if necessary.

Cheers,

Mike

branaway commented 12 years ago

You're so welcome to do that, Mike.

2012/1/19 Agile Consulting < reply@reply.github.com

Hi Bing,

Excellent, that works exactly as expected. Thanks!

I'll hopefully get around to properly fork and set up your project so I can start providing pull requests when / if necessary.

Cheers,

Mike


Reply to this email directly or view it on GitHub: https://github.com/branaway/Japid/issues/42#issuecomment-3556305