WebContent/js/explore/spaces.js
/**
 * Handles removal of solver(s) from a space
 * @author Todd Elvers & Skylar Stark
 */
Handles removal of solver(s) from a space
@author Todd Elvers & Skylar Stark
Handles removal of solver ( s ) from a space @author Todd Elvers & Skylar Stark
function removeSolvers(selectedSolvers, ownsAll) {
	var removeSolverButtons = {
		'remove from space': function() {
			removeSolversFromSpace(selectedSolvers);
		},
	};
	if (!isLeafSpace) {
		removeSolverButtons['remove from space hierarchy'] = function() {
			removeSolversFromSpaceHierarchy(selectedSolvers);
		};
	}
	var dialogText = null;
	if (ownsAll) {
		removeSolverButtons['move to recycle bin'] = function() {
			moveSolversToRecycleBin(selectedSolvers);
		};
	}
	if (ownsAll && isLeafSpace) {
		dialogText = 'do you want to remove the solver(s) from ' + spaceName + " or would you like to move them to the recycle bin?";
	} else if (ownsAll && !isLeafSpace) {
		dialogText = 'do you want to remove the solver(s) from ' + spaceName + ', from ' + spaceName
			+ ' and its hierarchy, or would you like to move them to the recycle bin?';
	} else if (!ownsAll && isLeafSpace) {
		dialogText = 'do you want to remove the solver(s) from ' + spaceName + '?';
	} else {
		dialogText = 'do you want to remove the solver(s) from ' + spaceName + ' or from ' + spaceName + ' and its hierarchy?';
	}
	removeSolverButtons['cancel'] = function() {
		$(this).dialog("close");
	};
	$('#dialog-confirm-delete-txt').text(dialogText);
	$('#dialog-confirm-delete').dialog({
		modal: true,
		width: 430,
		height: 250,
		buttons: removeSolverButtons
	});
}
function removeSolvers ( selectedSolvers , ownsAll ) { var removeSolverButtons = { 'remove from space' : function ( ) { removeSolversFromSpace ( selectedSolvers ) ; } , } ; if ( ! isLeafSpace ) { removeSolverButtons [ 'remove from space hierarchy' ] = function ( ) { removeSolversFromSpaceHierarchy ( selectedSolvers ) ; } ; } var dialogText = null ; if ( ownsAll ) { removeSolverButtons [ 'move to recycle bin' ] = function ( ) { moveSolversToRecycleBin ( selectedSolvers ) ; } ; } if ( ownsAll && isLeafSpace ) { dialogText = 'do you want to remove the solver(s) from ' + spaceName + " or would you like to move them to the recycle bin?" ; } else if ( ownsAll && ! isLeafSpace ) { dialogText = 'do you want to remove the solver(s) from ' + spaceName + ', from ' + spaceName + ' and its hierarchy, or would you like to move them to the recycle bin?' ; } else if ( ! ownsAll && isLeafSpace ) { dialogText = 'do you want to remove the solver(s) from ' + spaceName + '?' ; } else { dialogText = 'do you want to remove the solver(s) from ' + spaceName + ' or from ' + spaceName + ' and its hierarchy?' ; } removeSolverButtons [ 'cancel' ] = function ( ) { $ ( this ) . dialog ( "close" ) ; } ; $ ( '#dialog-confirm-delete-txt' ) . text ( dialogText ) ; $ ( '#dialog-confirm-delete' ) . dialog ( { modal : true , width : 430 , height : 250 , buttons : removeSolverButtons } ) ; }
Handles removal of solver(s) from a space
 @author Todd Elvers & Skylar Stark
Handles removal of solver ( s ) from a space @author Todd Elvers & Skylar Stark
// The remove from space button and cancel button will be in the dialog no matter what.
 // Only add the hierarchy option if the space is not a leaf.
 // Add the move to recycle bin button if the user owns the solvers.
 // Add cancel button last
 // Display the confirmation dialog
