src/js/tooltipster.js
function(constructor, obj, pluginName) {
		
		// if it's not already bridged
		if (!obj[pluginName]) {
			
			var fn = function() {};
			fn.prototype = constructor;
			
			var pluginInstance = new fn();
			
			// the _init method has to exist in instance constructors but might be missing
			// in core constructors
			if (pluginInstance.__init) {
				pluginInstance.__init(obj);
			}
			
			$.each(constructor, function(methodName, fn) {
				
				// don't proxy "private" methods, only "protected" and public ones
				if (methodName.indexOf('__') != 0) {
					
					// if the method does not exist yet
					if (!obj[methodName]) {
						
						obj[methodName] = function() {
							return pluginInstance[methodName].apply(pluginInstance, Array.prototype.slice.apply(arguments));
						};
						
						// remember to which plugin this method corresponds (several plugins may
						// have methods of the same name, we need to be sure)
						obj[methodName].bridged = pluginInstance;
					}
					else if (defaults.debug) {
						
						console.log('The '+ methodName +' method of the '+ pluginName
							+' plugin conflicts with another plugin or native methods');
					}
				}
			});
			
			obj[pluginName] = pluginInstance;
		}
		
		return this;
	}
function(constructor, obj, pluginName) {
		
		// if it's not already bridged
		if (!obj[pluginName]) {
			
			var fn = function() {};
			fn.prototype = constructor;
			
			var pluginInstance = new fn();
			
			// the _init method has to exist in instance constructors but might be missing
			// in core constructors
			if (pluginInstance.__init) {
				pluginInstance.__init(obj);
			}
			
			$.each(constructor, function(methodName, fn) {
				
				// don't proxy "private" methods, only "protected" and public ones
				if (methodName.indexOf('__') != 0) {
					
					// if the method does not exist yet
					if (!obj[methodName]) {
						
						obj[methodName] = function() {
							return pluginInstance[methodName].apply(pluginInstance, Array.prototype.slice.apply(arguments));
						};
						
						// remember to which plugin this method corresponds (several plugins may
						// have methods of the same name, we need to be sure)
						obj[methodName].bridged = pluginInstance;
					}
					else if (defaults.debug) {
						
						console.log('The '+ methodName +' method of the '+ pluginName
							+' plugin conflicts with another plugin or native methods');
					}
				}
			});
			
			obj[pluginName] = pluginInstance;
		}
		
		return this;
	}
function ( constructor , obj , pluginName ) { // if it's not already bridged if ( ! obj [ pluginName ] ) { var fn = function ( ) { } ; fn . prototype = constructor ; var pluginInstance = new fn ( ) ; // the _init method has to exist in instance constructors but might be missing // in core constructors if ( pluginInstance . __init ) { pluginInstance . __init ( obj ) ; } $ . each ( constructor , function ( methodName , fn ) { // don't proxy "private" methods, only "protected" and public ones if ( methodName . indexOf ( '__' ) != 0 ) { // if the method does not exist yet if ( ! obj [ methodName ] ) { obj [ methodName ] = function ( ) { return pluginInstance [ methodName ] . apply ( pluginInstance , Array . prototype . slice . apply ( arguments ) ) ; } ; // remember to which plugin this method corresponds (several plugins may // have methods of the same name, we need to be sure) obj [ methodName ] . bridged = pluginInstance ; } else if ( defaults . debug ) { console . log ( 'The ' + methodName + ' method of the ' + pluginName + ' plugin conflicts with another plugin or native methods' ) ; } } } ) ; obj [ pluginName ] = pluginInstance ; } return this ; }
A function to proxy the public methods of an object onto another

@param {object} constructor The constructor to bridge
@param {object} obj The object that will get new methods (an instance or the core)
@param {string} pluginName A plugin name for the console log message
@return {core}
@private
A function to proxy the public methods of an object onto another