Skip to content

Instantly share code, notes, and snippets.

@ezhlobo
Last active December 11, 2015 12:08
Show Gist options
  • Save ezhlobo/4598604 to your computer and use it in GitHub Desktop.
Save ezhlobo/4598604 to your computer and use it in GitHub Desktop.
JS framework: overall
(function() {
var root = this,
_tool = root.tool,
_$$ = root._$$,
tool = function(selector, context) {
return new tool.fn.init(selector, context);
};
tool.fn = tool.prototype = {
init: function() {
return this;
}
};
// jQuery Magic
tool.fn.init.prototype = tool.fn;
//
tool.fn.METHOD = function() {
return this;
}
//
root.tool = root.$$ = tool;
tool.noConflict = function() {
if (root.$$ === tool) {
root.$$ = _$$;
}
if (root.tool === tool) {
root.tool = _tool;
}
return tool;
};
})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment