Permalink
Browse files

Remove joker syntax

  • Loading branch information...
pyrsmk committed Dec 20, 2011
1 parent 48d413f commit bea1ee2c5014683a0a778f880f354b5f4bdff421
Showing with 7 additions and 46 deletions.
  1. +2 −2 README.markdown
  2. +1 −9 benchmark/runner.js
  3. +0 −1 nut-0.1.19.min.js
  4. +1 −0 nut-0.1.20.min.js
  5. +1 −30 src/nut.js
  6. +1 −1 src/package.json
  7. +1 −3 unit/runner.js
View
@@ -1,4 +1,4 @@
-Nut 0.1.19
+Nut 0.1.20
==========
Nut is a concise query selector engine that just allows you to do extremely simple queries.
@@ -42,7 +42,7 @@ And here's it can't:
div > p
div + p
-So, all pseudo-classes, attribute selectors and other advanced syntax are not allowed. But, let's dig in:
+So, all pseudo-classes, attribute selectors and other advanced syntax are not allowed. But, let's dig in it:
// Return an array
nut('#foo');
View
@@ -44,14 +44,6 @@ domReady(function(){
.add('[nut: #foo .bar span]',function(){
nut('#foo .bar span');
})
-
- // #foo .bar * , p
- .add('[querySelectorAll: #foo .bar * , p]',function(){
- document.querySelectorAll('#foo .bar * , p');
- })
- .add('[nut: #foo .bar * , p]',function(){
- nut('#foo .bar * , p');
- })
// Display results
.on('complete',function(){
@@ -64,4 +56,4 @@ domReady(function(){
// Run benchmarks
.run();
-});
+});
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,7 +1,7 @@
/*
nut, the concise CSS selector engine
- Version : 0.1.19
+ Version : 0.1.20
Author : Aurélien Delogu (dev@dreamysource.fr)
Homepage : https://github.com/pyrsmk/nut
License : MIT
@@ -22,31 +22,6 @@
getElementsByClassName='getElementsByClassName',
length='length',
- /*
- Get all nodes
-
- Parameters
- string selector : a selector
- context : a context
-
- Return
- object : nodes
- */
- getAllNodes=function(selector,context){
- var node=context[firstChild],
- nodes=[];
- // Reduce
- if(node){
- do{
- if(node.nodeType==1){
- nodes.push(node);
- }
- }
- while(node=node[nextSibling]);
- }
- return nodes;
- },
-
/*
Get id node
@@ -190,10 +165,6 @@
selector=selector.substr(1);
getNodesFromSelector=getNodesFromClassSelector;
}
- // Joker
- else if(selector=='*'){
- getNodesFromSelector=getAllNodes;
- }
// Tag
else{
getNodesFromSelector=getNodesFromTagSelector;
View
@@ -1,7 +1,7 @@
{
"name" : "nut",
"description" : "The concise CSS selector engine",
- "version" : "0.1.18",
+ "version" : "0.1.20",
"author" : "Aurélien Delogu <pyrsmk@dreamysource.fr> (http://dreamysource.fr)",
"repository" : {
"type" : "git",
View
@@ -16,7 +16,7 @@ domReady(function(){
return true;
};
- test('Acceptable selectors',6,function(){
+ test('Acceptable selectors',5,function(){
// p
ok(verifyNodes(nut('p'),3),'p');
// #foo
@@ -27,8 +27,6 @@ domReady(function(){
ok(verifyNodes(nut('.bar',nut('#foo')[0]),2),'.bar from #foo context (node)');
// #foo .bar span
ok(verifyNodes(nut('#foo .bar span'),2),'#foo .bar span');
- // #foo .bar * , p
- ok(verifyNodes(nut(' #foo .bar * , p '),5),'#foo .bar * , p');
});
test('Non acceptable selectors',1,function(){

0 comments on commit bea1ee2

Please sign in to comment.