From 9014a081ab4b5d30361954ada97b091cda0752e4 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Fri, 8 Jul 2011 13:21:21 -0400 Subject: [PATCH] Removed selector function from global scope, .(selector).el does the same thing --- kis.js | 73 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/kis.js b/kis.js index b28c001..531cbb4 100644 --- a/kis.js +++ b/kis.js @@ -18,41 +18,8 @@ return; } - var $_, $, sel; - - /** - * $_ - * - * Constructor function - */ - $_ = function(sel) - { - //Get the DOM objects from the selector - sel = $(sel); + var $_, $; - //Have window be default selector, just in case - if(typeof sel === "undefined") - { - sel = (typeof $_.el !== "undefined") - ? $_.el - : window; - } - - $_.el = sel; - - return $_; - }; - - $_ = window.$_ = window.$_ || $_; - - //console.log polyfill - if(typeof window.console === "undefined") - { - window.console = { - log:function(){} - }; - } - /** * $ * @@ -81,7 +48,41 @@ return (x.length === 1) ? x[0] : x; }; - window.$ = $; + /** + * $_ + * + * Constructor function + */ + $_ = function(sel) + { + //Get the DOM objects from the selector + sel = $(sel); + + //Have window be default selector, just in case + if(typeof sel === "undefined") + { + sel = (typeof $_.el !== "undefined") + ? $_.el + : window; + } + + $_.el = sel; + + return $_; + }; + + //Set global variables + $_ = window.$_ = window.$_ || $_; + + //console.log polyfill + if(typeof window.console === "undefined") + { + window.console = { + log:function(){} + }; + } + + // -------------------------------------------------------------------------- $_.each = function (callback) { @@ -672,6 +673,8 @@ //No matches? Well, lets log it for now console.log("Property " + prop + " nor an equivalent seems to exist"); } + + // -------------------------------------------------------------------------- d = { addClass: function (c)