jQuery code for voting

You need to be logged in to post messages in the forums. New users may register here.

Carlos Revillo

Member since:
09 January 2008

Posts: 48

Sunday 30 August 2009 3:23:50 am

Hi.

I really like jQuery, so i have written some code to do voting with this library. it's just a 'translation' of the yui3 functions.

please, let me know if you think this code could be useful for you.

regarding to this, it would be nice to choose wich library to use via ini file or something...

best regards.
Up

André R.

Member since:
14 January 2008

Posts: 145

Tuesday 01 September 2009 6:00:36 am

Feel free to post it and we'll look into ways of incorporation it.
Would be cool with a jquery / yui setting, but I think it should be in ezjscore then*.

Note: As of today, the loading of scripts are a bit different as well as the access checks**, and the schema changes I mentioned in the other post also happened today***.
So look out for that when you svn update.

* http://projects.ez.no/ezjscore/subversion/14
** http://projects.ez.no/ezjscore/subversion/12
*** http://projects.ez.no/ezstarrating/subversion/43

eZ Online Editor 5.1: http://projects.ez.no/ezoe || eZJSCore 1.1(Ajax): http://projects.ez.no/ezjscore || eZSearch++(better search results): http://projects.ez.no/ezsearchpro
@: http://twitter.com/andrerom

Up

Carlos Revillo

Member since:
09 January 2008

Posts: 48

Tuesday 01 September 2009 8:02:33 am

Hi. After getting rev 47, this is the piece of code that is working for me when choosing jquery as my PreferredLibrary



























































































































































Up

André R.

Member since:
14 January 2008

Posts: 145

Thursday 03 September 2009 5:07:03 am

I think your example would have to be something like:













eZ Online Editor 5.1: http://projects.ez.no/ezoe || eZJSCore 1.1(Ajax): http://projects.ez.no/ezjscore || eZSearch++(better search results): http://projects.ez.no/ezsearchpro
@: http://twitter.com/andrerom

Up

Carlos Revillo

Member since:
09 January 2008

Posts: 48

Thursday 03 September 2009 6:56:45 am

great. thank you.
Up

André R.

Member since:
14 January 2008

Posts: 145

Tuesday 08 September 2009 11:05:39 am

Hi, this is now implemented in svn, thanks for sharing the jQuery code!
I only did some small tweaks:
* not using $ in global scope in case user uses moo tools or prototype
* changes to be able to change vote
* support for "ezsr-star-rating-disabled" class on <ul id="ezsr_rating_{$attribute.id}" class="ezsr-star-rating"> so user can signal disabled rating for instance based on recently added 'current_user_has_rated' attribute on datatype content (Like we discussed earlier, not used by default since it's not cache safe).

eZ Online Editor 5.1: http://projects.ez.no/ezoe || eZJSCore 1.1(Ajax): http://projects.ez.no/ezjscore || eZSearch++(better search results): http://projects.ez.no/ezsearchpro
@: http://twitter.com/andrerom

Up

Carlos Revillo

Member since:
09 January 2008

Posts: 48

Tuesday 08 September 2009 4:00:16 pm

Glad it helpel André. Thanks for reviewing the code.

If i can help with some jquery core for another extensions, please let me know.

I will share a spanish translation file asap.

Best Regards.
Up

You need to be logged in to post messages in the forums. New users may register here.