scripts/database.js
/**
 * Driver function for adding a Custom Model to the Drop-Down Lists and Database
 * @param {String} modelURL The URL of the Custom Model used
 * @param {number} travelMethod The ID of the Travel Method that was used to travel along the Route
 * @callback addRouteCB The driver function for adding the Route data to the Drop-Down Lists and database
 */
Driver function for adding a Custom Model to the Drop-Down Lists and Database
@param {String} modelURL The URL of the Custom Model used
@param {number} travelMethod The ID of the Travel Method that was used to travel along the Route
@callback addRouteCB The driver function for adding the Route data to the Drop-Down Lists and database
Driver function for adding a Custom Model to the Drop - Down Lists and Database @param { String } modelURL The URL of the Custom Model used @param { number } travelMethod The ID of the Travel Method that was used to travel along the Route @callback addRouteCB The driver function for adding the Route data to the Drop - Down Lists and database
function addNewCustomModel(modelURL, travelMethod, addRouteCB) {
	var modelType = "Custom";
	var maxCustomItems = 5;
	var modelName;
	var menuSection = "model";
	if(customItemEntered($("#model"))) {
		modelName = getModelName(modelURL);
		var optGroup = determineMenuItemOptGroup(modelType, menuSection);
		addToOptGroup(optGroup, modelURL, modelName);
		addNewCustomModelToDatabase(modelName, modelURL, modelType, travelMethod, addRouteCB);
		removeOldCustomOptEntries(optGroup, maxCustomItems, removeOldCustomModelsFromDB);
	}
	else {
		var modelID = "null";
		addRouteCB(modelID);
	}
}
function addNewCustomModel ( modelURL , travelMethod , addRouteCB ) { var modelType = "Custom" ; var maxCustomItems = 5 ; var modelName ; var menuSection = "model" ; if ( customItemEntered ( $ ( "#model" ) ) ) { modelName = getModelName ( modelURL ) ; var optGroup = determineMenuItemOptGroup ( modelType , menuSection ) ; addToOptGroup ( optGroup , modelURL , modelName ) ; addNewCustomModelToDatabase ( modelName , modelURL , modelType , travelMethod , addRouteCB ) ; removeOldCustomOptEntries ( optGroup , maxCustomItems , removeOldCustomModelsFromDB ) ; } else { var modelID = "null" ; addRouteCB ( modelID ) ; } }
Driver function for adding a Custom Model to the Drop-Down Lists and Database
 @param {String} modelURL The URL of the Custom Model used
 @param {number} travelMethod The ID of the Travel Method that was used to travel along the Route
 @callback addRouteCB The driver function for adding the Route data to the Drop-Down Lists and database
Driver function for adding a Custom Model to the Drop - Down Lists and Database @param { String } modelURL The URL of the Custom Model used @param { number } travelMethod The ID of the Travel Method that was used to travel along the Route @callback addRouteCB The driver function for adding the Route data to the Drop - Down Lists and database
//Check the user has selected to enter a New Custom Model //If not, the modelID cannot be immediately ascertained, and so the callback function should be executed immediately