Skip to content

Instantly share code, notes, and snippets.

@jbueza
Forked from steveluscher/mojo_dojo_connector.js
Created August 11, 2011 17:26
Show Gist options
  • Save jbueza/1140236 to your computer and use it in GitHub Desktop.
Save jbueza/1140236 to your computer and use it in GitHub Desktop.
A Mojo->jQuery/Zepto connector; re-implement these methods in another library, and you can use Mojo 2.0 without Dojo.
/* Mojo-jQuery/Zepto connector */
(function() {
if(typeof mojo == 'undefined') mojo = {};
mojo.addOnUnload = jQuery.unload;
mojo.clone = dojo.clone; //TODO
mojo.config = dojo.config; //TODO
mojo.connect = jQuery.bind;
mojo.declare = dojo.declare; //via RequireJS? define()/require() AMD spec
mojo.destroyElement = jQuery.remove;
mojo.disconnect = jQuery.unbind;
mojo.hasClass = jQuery.hasClass;
mojo.hitch = jQuery.trigger; //jQuery.trigger?
mojo.isArray = jQuery.isArray;
mojo.isObject = jQuery.isPlainObject;
mojo.isString = dojo.isString; //TODO: Can we just remove references from core/app?
mojo.place = dojo.place; //TODO: Can we just remove references from core/app?
mojo.provide = dojo.provide; //via RequireJS? define()/require() AMD spec
mojo.publish = jQuery.publish; //via pubsub plugin by ben alman (@cowboy)
mojo.query = jQuery.find;
mojo.registerModulePath = dojo.registerModulePath; //TODO
mojo.require = dojo.require; //via RequireJS? define()/require() AMD spec
mojo.string = dojo.string; //TODO: Can we just remove references from core/app?
mojo.style = dojo.style; //TODO: Can we just remove references from core/app?
mojo.subscribe = dojo.subscribe; //via pubsub plugin by ben alman (@cowboy)
mojo.unsubscribe = dojo.unsubscribe; //via pubsub plugin by ben alman (@cowboy)
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment