xonecas.io
142
St

startsInvasion / files

startsInvasion / libs / node_modules / bonzo / build / qwery / README.md

1.8 KB
1Q('wery') - The Tiny Selector Engine
2-----
3Qwery is a 1k *blazing fast* query selector engine allowing you to select elements with CSS1 & CSS2 selectors (including [attribute selectors](http://www.w3.org/TR/css3-selectors/#attribute-selectors)).
4
5Acceptable queries
6---------------
7
8    // basic
9    #foo // id
10    .bar // class
11    #foo a // descendents
12    #foo a.bar element attribute comibination
13
14    // attributes
15    #foo a[href] // simple
16    #foo a[href=bar] // attribute values
17    #foo a[href^="http://"] // attribute starts with
18    #foo a[href$=com] // attribute ends with
19    #foo a[href*=twitter] // attribute wildcards
20
21    // combos
22    div,p
23
24    // variations
25    #foo.bar.baz
26    div#baz.thunk a[-data-info*="hello world"] strong
27    #thunk[title$='huzza']
28
29Contexts
30-------
31Each query can optionally pass in a context
32
33    qwery('div', node); // existing DOM node or...
34    qwery('div', '#foo'); // another query
35
36Browser Support
37---------------
38  - IE6, IE7, IE8, IE9
39  - Chrome 1 - 10
40  - Safari 3, 4, 5
41  - Firefox 2, 3, 4
42
43Build
44-----
45Qwery uses [JSHint](http://www.jshint.com/) to keep some house rules as well as [UglifyJS](https://github.com/mishoo/UglifyJS) for its compression. For those interested in building Qwery yourself. Run *make* in the root of the project.
46
47Tests
48-----
49
50    $ open tests/index.html
51
52Note
53----
54Qwery uses querySelectorAll when available. All querySelectorAll default behavior then applies.
55
56Ender support
57-------------
58Qwery is the default selector engine for [Ender](http://ender.no.de). However to use it in a custom builds of Ender you can include it as such:
59
60    ender -b qwery[,mod2,mod3,...]
61
62Contributors
63-------
64  * [Dustin Diaz](https://github.com/ded/qwery/commits/master?author=ded)
65  * [Jacob Thornton](https://github.com/ded/qwery/commits/master?author=fat)
66  * Follow our software [@dedfat](http://twitter.com/dedfat)