karl368 / firepath

Automatically exported from code.google.com/p/firepath
GNU General Public License v3.0
0 stars 0 forks source link

Add Sizzle/jQuery support #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've made changes against the trunk to support Sizzle (the selector engine for 
jQuery). As I am sure you know many folks use jQuery, so I think saying 
firepath supports it will bring it even more users (as it deserves).

I've attached the patch file. You also need to add sizzle.js (from 
http://sizzlejs.com/) to the content directory. You do not need all of jQuery.

At a user level, Sizzle has been added to the drop-down of evaluation modes. 
The user can select it and create Sizzle queries just like they do with 
CSS/Xpath. I believe it also properly turns red when the query is wrong. There 
isn't functionality for generating a Sizzle selector because that would just be 
a CSS selector.

At the code level, I added the evaluationMode "sizzle". And updated the 
evaluate and validate code to use it. In the end Sizzle works like the existing 
css selector behavior, its just called slightly differently. I also had to 
change code to have a sizzle selector error. I refactored how error messages 
are created to support that in a clean way (and I think a cleaner way in 
general).

Original issue reported on code.google.com by coolr...@gmail.com on 15 Mar 2011 at 3:13

GoogleCodeExporter commented 9 years ago
Here is the patch file against the trunk as of 3/15/11

Original comment by coolr...@gmail.com on 15 Mar 2011 at 3:14

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks you very much for your contribution!
I will try to take a look at the patch and integrate it to trunk sometime this 
week.

Original comment by pierre.t...@gmail.com on 16 Mar 2011 at 1:31

GoogleCodeExporter commented 9 years ago
I apply the patch and made the changes necessary to inject Sizzle inside the 
document in which to evaluate the selector. The changes were committed to trunk 
at revision r29.

Could you please try it and let me know if it works for you.

Also could you add yourself as a contributor to the install.rdf and send me the 
patch.

Thanks again for your contribution.

Original comment by pierre.t...@gmail.com on 20 Mar 2011 at 1:52

GoogleCodeExporter commented 9 years ago
Seems to be working just fine for me, very handy really :). I've attached the 
contributor patch (thanks :).

Original comment by coolr...@gmail.com on 21 Mar 2011 at 9:21

Attachments:

GoogleCodeExporter commented 9 years ago
Patch applied, thanks again.

Original comment by pierre.t...@gmail.com on 22 Mar 2011 at 7:41

GoogleCodeExporter commented 9 years ago
Released on March 22, 2011

Original comment by pierre.t...@gmail.com on 6 Aug 2011 at 3:38