media/js/vendor/selectize/selectize.js
function(input, triggerDropdown) {
			var self  = this;
			var caret = self.caretPos;
			input = input || $.trim(self.$control_input.val() || '');
	
			var callback = arguments[arguments.length - 1];
			if (typeof callback !== 'function') callback = function() {};
	
			if (typeof triggerDropdown !== 'boolean') {
				triggerDropdown = true;
			}
	
			if (!self.canCreate(input)) {
				callback();
				return false;
			}
	
			self.lock();
	
			var setup = (typeof self.settings.create === 'function') ? this.settings.create : function(input) {
				var data = {};
				data[self.settings.labelField] = input;
				data[self.settings.valueField] = input;
				return data;
			};
	
			var create = once(function(data) {
				self.unlock();
	
				if (!data || typeof data !== 'object') return callback();
				var value = hash_key(data[self.settings.valueField]);
				if (typeof value !== 'string') return callback();
	
				self.setTextboxValue('');
				self.addOption(data);
				self.setCaret(caret);
				self.addItem(value);
				self.refreshOptions(triggerDropdown && self.settings.mode !== 'single');
				callback(data);
			});
	
			var output = setup.apply(this, [input, create]);
			if (typeof output !== 'undefined') {
				create(output);
			}
	
			return true;
		}
function(input, triggerDropdown) {
			var self  = this;
			var caret = self.caretPos;
			input = input || $.trim(self.$control_input.val() || '');
	
			var callback = arguments[arguments.length - 1];
			if (typeof callback !== 'function') callback = function() {};
	
			if (typeof triggerDropdown !== 'boolean') {
				triggerDropdown = true;
			}
	
			if (!self.canCreate(input)) {
				callback();
				return false;
			}
	
			self.lock();
	
			var setup = (typeof self.settings.create === 'function') ? this.settings.create : function(input) {
				var data = {};
				data[self.settings.labelField] = input;
				data[self.settings.valueField] = input;
				return data;
			};
	
			var create = once(function(data) {
				self.unlock();
	
				if (!data || typeof data !== 'object') return callback();
				var value = hash_key(data[self.settings.valueField]);
				if (typeof value !== 'string') return callback();
	
				self.setTextboxValue('');
				self.addOption(data);
				self.setCaret(caret);
				self.addItem(value);
				self.refreshOptions(triggerDropdown && self.settings.mode !== 'single');
				callback(data);
			});
	
			var output = setup.apply(this, [input, create]);
			if (typeof output !== 'undefined') {
				create(output);
			}
	
			return true;
		}
function ( input , triggerDropdown ) { var self = this ; var caret = self . caretPos ; input = input || $ . trim ( self . $control_input . val ( ) || '' ) ; var callback = arguments [ arguments . length - 1 ] ; if ( typeof callback !== 'function' ) callback = function ( ) { } ; if ( typeof triggerDropdown !== 'boolean' ) { triggerDropdown = true ; } if ( ! self . canCreate ( input ) ) { callback ( ) ; return false ; } self . lock ( ) ; var setup = ( typeof self . settings . create === 'function' ) ? this . settings . create : function ( input ) { var data = { } ; data [ self . settings . labelField ] = input ; data [ self . settings . valueField ] = input ; return data ; } ; var create = once ( function ( data ) { self . unlock ( ) ; if ( ! data || typeof data !== 'object' ) return callback ( ) ; var value = hash_key ( data [ self . settings . valueField ] ) ; if ( typeof value !== 'string' ) return callback ( ) ; self . setTextboxValue ( '' ) ; self . addOption ( data ) ; self . setCaret ( caret ) ; self . addItem ( value ) ; self . refreshOptions ( triggerDropdown && self . settings . mode !== 'single' ) ; callback ( data ) ; } ) ; var output = setup . apply ( this , [ input , create ] ) ; if ( typeof output !== 'undefined' ) { create ( output ) ; } return true ; }
Invokes the `create` method provided in the
selectize options that should provide the data
for the new item, given the user input.

Once this completes, it will be added
to the item list.

@param {string} value
@param {boolean} [triggerDropdown]
@param {function} [callback]
@return {boolean}
Invokes the create method provided in the selectize options that should provide the data for the new item given the user input .