-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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