Permalink
Browse files

Merge pull request #8 from arexkun/master

Added a couple things
  • Loading branch information...
2 parents e66ce49 + c3d2c10 commit 2945b0662b21b5e0651ae6b14554ef1df1dc55d5 @danheberden committed Jun 21, 2011
Showing with 14 additions and 1 deletion.
  1. +14 −1 quewery.js
View
@@ -1,16 +1,29 @@
+
/*
* Quewery.js (c) 2011 Dan Heberden
*
* Whatever license you want
*/
(function( document, window ) {
+function makeArray(arr){
+ var ret=[],x;
+
+ for(x=0;x<arr.length;x++){
+ ret[x]=arr[x];
+ }
+
+ return ret;
+}
+
var _Quewery = window.Quewery,
_Q = window.Q,
Quewery = window.Q = window.Quewery = function ( selector ) {
return /^#[\w\-]+$/.test( selector )
? [ document.getElementById( selector.slice(1) ) ]
- : document.querySelectorAll( selector );
+ : selector=="body"&&document.body?[document.body]
+ : !/\W/.test(selector)? makeArray(document.getElementsByTagName(selector))
+ : document.querySelectorAll( selector );
};
Quewery.noConflict = function( allTheWay ) {

0 comments on commit 2945b06

Please sign in to comment.