Changeset 530 for ether_megapoli/trunk/web/backoffice/simulation-script.jsp
- Timestamp:
- 07/03/12 17:02:35 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/web/backoffice/simulation-script.jsp
r528 r530 3 3 var interfaceBODataInsertion = Class.create( { 4 4 5 initialize: function( pathSimulationFiles )5 initialize: function( simulationFiles, simulationDirectories ) 6 6 { 7 7 // Values 8 this.files = pathSimulationFiles || null; 8 this.files = simulationFiles || null; 9 this.directories = simulationDirectories || null; 9 10 10 11 // Containers … … 41 42 42 43 // Bind buttons 43 // $( "#insert" ).bind( 'click', this, jQuery.proxy( this.onClickInsert, this ) );44 $( "#ncdumpButton" ).bind( 'click', this, jQuery.proxy( this.onClickLaunchNcDump, this ) ); 44 45 // $( "#cleanLocalisationAndFlagButton" ).bind( 'click', this, jQuery.proxy( this.onClickCleanLocalisationAndFlag, this ) ); 45 46 }, … … 58 59 }, 59 60 61 requestLaunchNcDump: function() 62 { 63 $.ajax( { 64 url: "backoffice?methodName=launchNCDumpInSimulationDirectory", 65 success:jQuery.proxy( this.handleLaunchNcDump, this ), 66 error: jQuery.proxy( this.showErrors, [this] ) 67 } ); 68 }, 69 70 requestInsertHeader: function( directoryName ) 71 { 72 $.ajax( { 73 url: "backoffice?methodName=insertHeader&directoryName=" + directoryName, 74 success:jQuery.proxy( this.handleInsertHeader, this ), 75 error: jQuery.proxy( this.showErrors, [this] ) 76 } ); 77 }, 60 78 61 79 // HANDLES ******************************************************** … … 67 85 }, 68 86 87 handleLaunchNcDump: function( result ) 88 { 89 this.files = jQuery.parseJSON( result ).simulationFiles; 90 this.directories = jQuery.parseJSON( result ).simulationDirectories; 91 this.displayFiles(); 92 }, 93 94 handleInsertHeader: function( result ) 95 { 96 // this.files = jQuery.parseJSON( result ).simulationFiles; 97 // this.directories = jQuery.parseJSON( result ).simulationDirectories; 98 // this.displayFiles(); 99 }, 100 69 101 // DISPLAYS ******************************************************** 70 102 displayFiles: function() 71 103 { 104 this.containerFileList_left.empty(); 105 this.containerFileList_right.empty(); 72 106 var number = this.files.length; 107 jQuery.each( this.directories, jQuery.proxy( function( i, directory ) 108 { 109 var divDirectory = $( document.createElement( "div" ) ); 110 var divDirectoryName = $( document.createElement( "div" ) ); 111 divDirectoryName.attr( {style:"float:left"} ); 112 divDirectoryName.html( "- " + directory + " " ); 113 divDirectory.append( divDirectoryName ); 114 115 var button = $( document.createElement( "button" ) ); 116 button.addClass( "small negative" ); 117 button.html( interfaceTexts["bo.simulation.save.header"] ); 118 button.bind( 'click', [this, directory], jQuery.proxy( this.onClickInsertHeader, this ) ); 119 divDirectory.append( button ); 120 121 this.containerFileList_left.append( divDirectory ); 122 }, this ) ); 123 73 124 jQuery.each( this.files, jQuery.proxy( function( i, file ) 74 125 { 75 if( (number / 2) > i ) 76 this.containerFileList_left.append( " - " + file + "<BR/>" ); 77 else 78 this.containerFileList_right.append( " - " + file + "<BR/>" ); 126 this.containerFileList_right.append( " - " + file + "<BR/>" ); 79 127 }, this ) ); 80 81 128 }, 82 129 … … 193 240 }, 194 241 195 onClickRemove: function( dataset ) 196 { 197 this.dataset = dataset; 198 199 this.containerErrors.hide(); 200 this.hideRemove(); 201 this.hideMove(); 202 this.hideInsert(); 203 204 this.displayFilesMove(); 205 206 $( "#categoryNameInsert" ).val( this.dataset.categoryName ); 207 $( "#datasetNameInsert" ).val( this.dataset.name ); 208 209 if( window.confirm( interfaceTexts["bo.dataset.remove.confirm"] + " " + dataset.name + " ?" ) ) 210 this.requestRemoveDataset(); 211 }, 212 213 onClickMove: function() 214 { 215 this.containerErrors.hide(); 216 this.containerResultRemove.addClass( "disable" ); 217 this.hideMove(); 218 this.hideInsert(); 219 this.requestFilesMove(); 220 }, 221 222 onClickInsert: function() 223 { 224 this.containerErrors.hide(); 225 this.containerResultMove.addClass( "disable" ); 226 this.hideInsert(); 227 228 if( "" != $( "#categoryNameInsert" ).val() && "" != $( "#datasetNameInsert" ).val() && "" != $( "#versionInsert" ).val() ) 229 this.requestDatasetInsert(); 230 else 231 this.showErrors( interfaceTexts["bo.dataset.fields"] ); 232 }, 233 234 onClickCleanLocalisationAndFlag: function() 235 { 236 if( window.confirm( interfaceTexts["bo.cleanTables.confirm"] ) ) 237 this.requestCleanLocalisationAndFlag(); 242 onClickLaunchNcDump: function() 243 { 244 this.requestLaunchNcDump(); 245 }, 246 247 onClickInsertHeader: function( parameters ) 248 { 249 var context = parameters.data[0]; 250 var directoryName = parameters.data[1]; 251 this.requestInsertHeader( directoryName ); 238 252 }, 239 253
Note: See TracChangeset
for help on using the changeset viewer.