Skip to content

Instantly share code, notes, and snippets.

@micmath
Created January 13, 2010 10:28
Show Gist options
  • Save micmath/276095 to your computer and use it in GitHub Desktop.
Save micmath/276095 to your computer and use it in GitHub Desktop.
(function(undefined) {
if (window.Glow !== undefined) { return; }
var Glow = function(version) {
if (Glow.versions[version] !== undefined) {
return Glow.versions[version];
}
var glow = function(arg) {
if (arg.indexOf('<', arg) === 0) { return glow.dom.create(arg); }
else return glow.dom.get(arg);
};
glow.version = version;
glow.load = function(pack, version) {
alert('load: '+pack+', '+version);
};
glow.dom = {
create: function(s) { alert('create: '+s); }
,get: function(s) { alert('get: '+s); }
};
Glow.versions[version] = glow;
return glow;
};
Glow.versions = {};
window.Glow = Glow;
})();
(function() {
var $ = Glow(2);
alert($.version);
$.load('widgets');
$('*');
$('<p>hello</p>');
})();
alert(window.$); // undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment