Changeset 615 for geisa/web/initGeisa_script.jsp
- Timestamp:
- 10/30/12 15:52:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
geisa/web/initGeisa_script.jsp
r595 r615 687 687 this.selectTransitionUpper = $( document.createElement( "select" ) ); 688 688 this.selectTransitionUpper.attr( {id:"transition1"} ); 689 //fonction sur le menu déroulant (des qu'on clique dessus) et non sur chacune des options 690 this.selectTransitionUpper.bind( 'click', jQuery.proxy(this.OnclickVerifTransition, this)); 689 691 var optTransitionUpper = $( document.createElement( "option" ) ); 690 692 optTransitionUpper.attr( {value:"-1", text:"Select a molecule"} ); … … 708 710 this.selectTransitionLower = $( document.createElement( "select" ) ); 709 711 this.selectTransitionLower.attr( {id:"transition2"} ); 712 this.selectTransitionLower.bind( 'click', jQuery.proxy(this.OnclickVerifTransition, this)); 710 713 var optTransitionLower = $( document.createElement( "option" ) ); 711 714 optTransitionLower.attr( {value:"-1", text:"Select a molecule"} ); … … 1228 1231 // var transitionUpper = "["+transitionUp+"]"; 1229 1232 // alert ("transitionUpper"+transitionUpper); 1233 //certaine transitions ont plusieurs espaces à droite qui ne sont pas conservés (ex ch4 et C2HD) 1234 //si la longueur de la chaine de caracteres n'est pas 25 on rajoute le nobre d'espace nécessaire pour arriver à 25 1235 var nb=0; 1236 nb=25-transitionUpper.length 1237 if (nb != 0) 1238 { 1239 for (i = 1; i <= nb; i++) { 1240 transitionUpper=transitionUpper+" "; 1241 } 1242 } 1243 1244 //alert("transitionUpper.length"+transitionUpper.length); 1245 //transitionUpper=transitionUpper+" "; 1246 //alert("transitionUpper.length"+transitionUpper.length); 1230 1247 1231 1248 // var TransitionLower ="-vib_ident_lower '[ "+this.selectTransitionLower.getValue()+" ]'"; … … 1234 1251 // var TransitionLower ="-vib_ident_lower ["+TransitionLo+"]"; 1235 1252 //var transitionLower ="["+transitionLo+"]"; 1253 1254 //certaine transitions ont plusieurs espaces à droite qui ne sont pas conservés (ex ch4 et C2HD) 1255 //si la longueur de la chaine de caracteres n'est pas 25 on rajoute le nobre d'espace nécessaire pour arriver à 25 1256 var nb=0; 1257 nb=25-transitionUpper.length 1258 if (nb != 0) 1259 { 1260 for (i = 1; i <= nb; i++) { 1261 transitionUpper=transitionUpper+" "; 1262 } 1263 } 1236 1264 1237 1265 //pas de transition sélectionnée … … 1397 1425 meanValue+" "+nbCourbes+" "+field+" "+logScale+" "+lineType+" "+field2+" "+logScale2+" "+lineType2; 1398 1426 1399 //alert ("parameters"+parameters);1427 //alert ("parameters"+parameters); 1400 1428 1401 1429 //remplacement de espace par "EEE" pour que le shell script ne voit qu'un seul argument en entrée 1402 parameters=parameters.replace(/ /g," EEE");1403 transitionUpper=transitionUpper.replace(/ /g," EEE");1430 parameters=parameters.replace(/ /g,"kkk"); 1431 transitionUpper=transitionUpper.replace(/ /g,"kkk"); 1404 1432 //le + est interprété comme un espace (plus sera retransformé en + dans le shell) 1405 1433 transitionUpper=transitionUpper.replace(/\+/g,"plus"); 1406 transitionLower=transitionLower.replace(/ /g," EEE");1434 transitionLower=transitionLower.replace(/ /g,"kkk"); 1407 1435 transitionLower=transitionLower.replace(/\+/g,"plus"); 1408 1436 1409 1437 this.nomFichier="GEISA2011"; 1410 1438 //envoie de la requête au controller 1411 1439 //en cas de succes appel de la fonction "handleGeisa" 1412 1440 $.ajax( { 1413 1441 //url: "project?methodName=createUserRequest&"+parameters+"&nbGraph="+ this.nbGraph, 1414 url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph, 1442 //url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph, 1443 url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph+"&nomFichier="+this.nomFichier, 1415 1444 success:jQuery.proxy( this.handleGeisa, this ) 1416 1445 } ); … … 1635 1664 { 1636 1665 1666 //numéro unique pour le nom du répertoire 1667 //this.nb = jQuery.parseJSON( result ).nb; 1668 this.NomRepFileOut = jQuery.parseJSON( result ).NomRepFileOut; 1637 1669 1638 1670 //chemin de l'image 1639 1671 // this.pathImg = jQuery.parseJSON( result ).pathImg; 1640 this.pathImg = "<%=Controller.PATH_IMAGES%>" ;1641 //numéro unique pour le nom du graph 1642 this.nb = jQuery.parseJSON( result ).nb; 1672 this.pathImg = "<%=Controller.PATH_IMAGES%>"+this.NomRepFileOut; 1673 1674 1643 1675 //Pour tracer le bon nombre de graphe et de bouton download 1644 1676 var i=1; 1645 1677 var content = ''; 1646 1678 for (i=1; i<this.nbGraph+1; i++) { 1647 content = content + '<img src=' + this.pathImg + "graph" + this.nb +"-"+i+ ".png"+ ' /><a href="project?methodName=downloadFile&fileName=' + "graph" + this.nb+"-"+i + ".png"+ '"><button class="dataProtocolDownloadButton">Download</button></a>'; 1679 //content = content + '<img src=' + this.pathImg + "graph" + this.nb +"-"+i+ ".png"+ ' /><a href="project?methodName=downloadFile&fileName=' + "graph" + this.nb+"-"+i + ".png"+ '"><button class="dataProtocolDownloadButton">Download</button></a>'; 1680 content = content + '<img src=' + this.pathImg + this.nomFichier +"-"+i+ ".png"+ ' /><a href="project?methodName=downloadFile&fileName=' +this.NomRepFileOut + this.nomFichier+"-"+i + ".png"+ '"><button class="dataProtocolDownloadButton">Download</button></a>'; 1681 1648 1682 } 1649 1683 … … 1681 1715 // this.selectTransitionUpper.selectFirst(); 1682 1716 1683 // alert ("transitionsUpper"+transitionsUpper); 1717 1684 1718 $.each(transitionsLower, jQuery.proxy( function(index, transitionsLower ) 1685 1719 { … … 1721 1755 this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:this.transitionLower, text:this.transitionLower, selected:"selected"} )); 1722 1756 //this.selectTransitionUpper.add('transition', "Choose a transition"); 1723 //rajout du text "Choose a transition" selectionné en premier mais on ne peut pa cliquer dessus1757 //rajout du text "Choose a transition" selectionné en premier mais on ne peut pas cliquer dessus 1724 1758 this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); 1725 1759 … … 1907 1941 for( i = 0; i < count; i++ ) 1908 1942 { 1909 // ouvrir que les div dont l'id contient la chaine Cache1943 //fermer que les div dont l'id contient la chaine Cache 1910 1944 if (divs.item(i).id.indexOf("Cache") != -1) { 1911 1945 divs.item(i).style.display = "none" ; … … 2065 2099 }, 2066 2100 2067 2101 //si aucun transition n'a été trouvée 2102 OnclickVerifTransition : function() 2103 { 2104 //si il n'y a qu'un élément dans les menu déroulant transition upper et lower et que la valeur est "transition" 2105 if (document.getElementById('transition1').length==1 && document.getElementById('transition1').options[0].value=="transition" && document.getElementById('transition2').length==1 && document.getElementById('transition2').options[0].value=="transition") 2106 { 2107 alert("Change isotopologues selection or spectral range values to obtain transition values"); 2108 } 2109 }, 2068 2110 2069 2111 onBlurInputMeanValue: function() … … 2236 2278 resetPage: function() 2237 2279 { 2238 location.reload(); 2280 //location.reload(); //pas appliquée car supprime la fenêtre graphique 2281 2282 //reset du choix de la base de données 2283 // selectFirst : affiche le premier élément de la liste 2284 //true : active la fonction associée au bouton 2285 this.selectDatabase.selectFirst( true ); 2286 2287 //cacher tous les isotopes 2288 var divs = document.getElementsByTagName( 'div' ); 2289 var count = divs.length; 2290 var i = 0; 2291 2292 for( i = 0; i < count; i++ ) 2293 { 2294 //fermer que les div dont l'id contient la chaine Cache 2295 if (divs.item(i).id.indexOf("Cache") != -1) { 2296 divs.item(i).style.display = "none" ; 2297 } 2298 } 2299 this.showButton.setValue("View all isotopologues"); 2300 2301 //déselectionner tous les isotopes 2302 var inputs = document.getElementsByTagName( 'input' ); 2303 var count = inputs.length; 2304 var i=0; 2305 2306 for( i = 0; i < count; i++ ) 2307 { 2308 var input = inputs.item( i ); 2309 if( input.type == 'checkbox' ) 2310 { 2311 input.checked = false; 2312 } 2313 } 2314 this.selectButton.setValue("Select all isotopologues"); 2315 2316 //spectral range 2317 $("#rangeLower").val(0); 2318 $("#rangeUpper").val(35877.030506); 2319 $("#sampStep").val(""); 2320 2321 //intensity range 2322 $("#intensityLo").val(0); 2323 $("#intensityUp").val(1e-16); 2324 2325 this.selectNbCourbes.selectFirst( true ); 2326 2327 this.selectTraceAxeY1.selectFirst( true ); 2328 this.selectScaleY1.selectFirst( true ); 2329 this.selectTypeTraceY1.selectFirst( true ); 2330 2331 document.getElementById("transition1").length=0; 2332 document.getElementById("transition2").length=0; 2333 this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} )); 2334 this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} )); 2335 $("#transitionUpper").removeClass("notActiveText"); 2336 $("#transitionLower").removeClass("notActiveText"); 2337 2338 2339 $("#meanValue2").val(""); 2340 2341 this.selectTraceAxeY2.selectFirst( true ); 2342 this.selectScaleY2.selectFirst( true ); 2343 this.selectTypeTraceY2.selectFirst( true ); 2344 2239 2345 }, 2240 2346
Note: See TracChangeset
for help on using the changeset viewer.