WebContent/js/explore/spaces.js
/**
 * Handles removal of job(s) from a space
 * @author Todd Elvers
 */
Handles removal of job(s) from a space
@author Todd Elvers
Handles removal of job ( s ) from a space @author Todd Elvers
function removeJobs(selectedJobs, ownsAll) {
	if (ownsAll) {
		$('#dialog-confirm-delete-txt')
		.text('do you want to remove the selected job(s) from ' + spaceName + ', or do you want to delete them permanently?');
		$('#dialog-confirm-delete').dialog({
			modal: true,
			height: 250,
			buttons: {
				'remove jobs': function() {
					jobTable.fnProcessingIndicator();
					log('user confirmed job deletion');
					$('#dialog-confirm-delete').dialog('close');
					$.post(
						starexecRoot + "services/remove/job/" + spaceId,
						{selectedIds: selectedJobs},
						function(returnCode) {
							s = parseReturnCode(returnCode);
							if (s) {
								updateTable(jobTable);
							}
							jobTable.fnProcessingIndicator(false);
						},
						"json"
					).error(function() {
						showMessage('error',
							"Internal error removing jobs",
							5000);
					});
				},
				'delete permanently': function() {
					jobTable.fnProcessingIndicator();
					log('user confirmed job deletion');
					$('#dialog-confirm-delete').dialog('close');
					$.post(
						starexecRoot + "services/deleteandremove/job/" + spaceId,
						{selectedIds: selectedJobs},
						function(returnCode) {
							s = parseReturnCode(returnCode);
							if (s) {
								updateTable(jobTable);
							}
							jobTable.fnProcessingIndicator(false);
						},
						"json"
					).error(function() {
						showMessage('error',
							"Internal error removing jobs",
							5000);
					});
				},
				"cancel": function() {
					log('user canceled job deletion');
					$(this).dialog("close");
				}
			}
		});
	} else {
		$('#dialog-confirm-delete-txt')
		.text('do you want to remove the selected job(s) from ' + spaceName + '?');
		$('#dialog-confirm-delete').dialog({
			modal: true,
			height: 250,
			buttons: {
				'remove jobs': function() {
					jobTable.fnProcessingIndicator();
					log('user confirmed job deletion');
					$('#dialog-confirm-delete').dialog('close');
					$.post(
						starexecRoot + "services/remove/job/" + spaceId,
						{selectedIds: selectedJobs},
						function(returnCode) {
							s = parseReturnCode(returnCode);
							if (s) {
								updateTable(jobTable);
							}
							jobTable.fnProcessingIndicator(false);
						},
						"json"
					).error(function() {
						showMessage('error',
							"Internal error removing jobs",
							5000);
					});
				},
				"cancel": function() {
					log('user canceled job deletion');
					$(this).dialog("close");
				}
			}
		});
	}
}
function removeJobs ( selectedJobs , ownsAll ) { if ( ownsAll ) { $ ( '#dialog-confirm-delete-txt' ) . text ( 'do you want to remove the selected job(s) from ' + spaceName + ', or do you want to delete them permanently?' ) ; $ ( '#dialog-confirm-delete' ) . dialog ( { modal : true , height : 250 , buttons : { 'remove jobs' : function ( ) { jobTable . fnProcessingIndicator ( ) ; log ( 'user confirmed job deletion' ) ; $ ( '#dialog-confirm-delete' ) . dialog ( 'close' ) ; $ . post ( starexecRoot + "services/remove/job/" + spaceId , { selectedIds : selectedJobs } , function ( returnCode ) { s = parseReturnCode ( returnCode ) ; if ( s ) { updateTable ( jobTable ) ; } jobTable . fnProcessingIndicator ( false ) ; } , "json" ) . error ( function ( ) { showMessage ( 'error' , "Internal error removing jobs" , 5000 ) ; } ) ; } , 'delete permanently' : function ( ) { jobTable . fnProcessingIndicator ( ) ; log ( 'user confirmed job deletion' ) ; $ ( '#dialog-confirm-delete' ) . dialog ( 'close' ) ; $ . post ( starexecRoot + "services/deleteandremove/job/" + spaceId , { selectedIds : selectedJobs } , function ( returnCode ) { s = parseReturnCode ( returnCode ) ; if ( s ) { updateTable ( jobTable ) ; } jobTable . fnProcessingIndicator ( false ) ; } , "json" ) . error ( function ( ) { showMessage ( 'error' , "Internal error removing jobs" , 5000 ) ; } ) ; } , "cancel" : function ( ) { log ( 'user canceled job deletion' ) ; $ ( this ) . dialog ( "close" ) ; } } } ) ; } else { $ ( '#dialog-confirm-delete-txt' ) . text ( 'do you want to remove the selected job(s) from ' + spaceName + '?' ) ; $ ( '#dialog-confirm-delete' ) . dialog ( { modal : true , height : 250 , buttons : { 'remove jobs' : function ( ) { jobTable . fnProcessingIndicator ( ) ; log ( 'user confirmed job deletion' ) ; $ ( '#dialog-confirm-delete' ) . dialog ( 'close' ) ; $ . post ( starexecRoot + "services/remove/job/" + spaceId , { selectedIds : selectedJobs } , function ( returnCode ) { s = parseReturnCode ( returnCode ) ; if ( s ) { updateTable ( jobTable ) ; } jobTable . fnProcessingIndicator ( false ) ; } , "json" ) . error ( function ( ) { showMessage ( 'error' , "Internal error removing jobs" , 5000 ) ; } ) ; } , "cancel" : function ( ) { log ( 'user canceled job deletion' ) ; $ ( this ) . dialog ( "close" ) ; } } } ) ; } }
Handles removal of job(s) from a space
 @author Todd Elvers
Handles removal of job ( s ) from a space @author Todd Elvers
// Display the confirmation dialog
 // If the user actually confirms, close the dialog right away
 // If the user actually confirms, close the dialog right away
 // Display the confirmation dialog
 // If the user actually confirms, close the dialog right away
