Permalink
Browse files

i was annoyed. now i am still annoyed, but slightly less so.

  • Loading branch information...
1 parent 88a3a41 commit ef0becff01938b2764229b7eae99c9525d3ba2a0 @cowboy committed Apr 1, 2011
Showing with 8 additions and 7 deletions.
  1. +7 −6 quewery.js
  2. +1 −1 quewery.min.js
View
13 quewery.js
@@ -3,9 +3,10 @@
*
* Whatever license you want
*/
-(function( document, w ){
- w.Quewery = function( selector ) {
- return selector.match(/#[^(.|\s|\[)]+$/) ? [ document.getElementById( selector.substring(1) ) ] :
- document.querySelectorAll( selector );
- }
-})( document, window);
+(function( document ) {
+ this.Quewery = function( selector ) {
+ return /^#[\w\-]+$/.test(selector)
+ ? [ document.getElementById(selector.substr(1)) ]
+ : document.querySelectorAll(selector);
+ };
+})(document);
View
2 quewery.min.js
@@ -3,4 +3,4 @@
*
* Whatever license you want
*/
-(function(d,w){w.Quewery=function(s){return s.match(/#[^(.|\s|\[)]+$/)?[d.getElementById(s.substring(1))]:d.querySelectorAll(s);}})(document,window);
+(function(a){this.Quewery=function(b){return/^#[\w\-]+$/.test(b)?[a.getElementById(b.substr(1))]:a.querySelectorAll(b)}})(document);

0 comments on commit ef0becf

Please sign in to comment.