source: geisa/web/initGeisa_script.jsp @ 567

Last change on this file since 567 was 567, checked in by npipsl, 12 years ago

Modifications des menus deroulants , des liens, de l'aide

File size: 104.9 KB
Line 
1<%@ page import="com.ether.Controller" %>
2<%@ page import="com.ether.IsotopeG03" %>
3<%@ page import="com.ether.IsotopeIasiG03" %>
4<%@ page import="com.ether.IsotopeG09" %>
5<%@ page import="com.ether.IsotopeIasiG09" %>
6
7<script type="text/javascript">
8
9
10
11//permet de deselectionner la molecule quand on deselectionne un isotope (toutes les options sauf lst)
12/*function decliquemol( name )
13 {
14
15 var inputs = document.getElementsByTagName( 'input' );
16 var count = inputs.length;
17 for( i = 0; i < count; i++ )
18 {
19 input = inputs.item( i );
20 if( input.type == 'checkbox' && input.id == (name + '-all') && input.checked == true )
21 {
22 input.checked = false;
23 }
24 }
25 } */
26
27
28var InterfaceInit = Class.create( {
29
30            initialize: function()
31            {
32                /** *********** CONTAINERS *********** **/
33                this.containerFormSpectralRangeLower = $( "#spectralRangeLower" );
34                this.containerFormSpectralRangeUpper = $( "#spectralRangeUpper" );
35                this.containerFormIntensityLower = $( "#intensityLower" );
36                this.containerFormIntensityUpper = $( "#intensityUpper" );
37                this.containerFormMeanValue1 = $( "#meanValue1" );
38                this.containerDownload = $( "#downloadContainer" );
39                this.containerLoading = $( "#loading" );
40                /** *********** VARIABLE *********** **/
41                <%--this.pathImg = <%=Controller.PATH_IMAGES%>;--%>
42
43                this.initializeMolecules();
44                this.createForm();
45
46                var downloadButton = new Button( {value:"Download", parent:$( "#downloadContainer" ), id:"button_submit_2", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickDownload, this )} );
47            },
48
49            initializeMolecules: function()
50            {
51                this.arrayGeisa2011 = new Array();
52                this.arrayGeisa2003 = new Array();
53                this.arrayGeisaIasi2011 = new Array();
54                this.arrayGeisaIasi2003 = new Array();
55
56                var molecule = new Object();
57                molecule.id="h2o";
58                molecule.name="H<sub>2</sub>O";
59                molecule.isotopesArray = ["161", "162", "171", "181", "182", "172"];
60                this.arrayGeisa2011.push(molecule);
61                this.arrayGeisa2003.push(molecule);
62                this.arrayGeisaIasi2011.push(molecule);
63                this.arrayGeisaIasi2003.push(molecule);
64
65                var molecule = new Object();
66                molecule.id="co2";
67                molecule.name="CO<sub>2</sub>";
68                molecule.isotopesArray = ["626", "627", "628", "636", "637", "638", "728", "828", "838"];
69                this.arrayGeisa2003.push(molecule);
70                this.arrayGeisa2011.push(molecule);
71                this.arrayGeisaIasi2011.push(molecule);
72                this.arrayGeisaIasi2003.push(molecule);
73
74                var molecule = new Object();
75                molecule.id="o3";
76                molecule.name="O<sub>3</sub>";
77                molecule.isotopesArray = ["666", "668", "686", "667", "676"];
78                this.arrayGeisa2003.push(molecule);
79                this.arrayGeisa2011.push(molecule);
80                this.arrayGeisaIasi2011.push(molecule);
81                this.arrayGeisaIasi2003.push(molecule);
82
83                var molecule = new Object();
84                molecule.id="n2o";
85                molecule.name="N<sub>2</sub>O";
86                molecule.isotopesArray = ["446", "447", "448", "456","458", "546", "548", "556"];
87                this.arrayGeisa2011.push(molecule);
88                this.arrayGeisaIasi2011.push(molecule);
89
90                var molecule = new Object();
91                molecule.id="n2o";
92                molecule.name="N<sub>2</sub>O";
93                molecule.isotopesArray = ["446", "447", "448", "456", "546"];
94                this.arrayGeisa2003.push(molecule);
95                this.arrayGeisaIasi2003.push(molecule);
96
97                var molecule = new Object();
98                molecule.id="co";
99                molecule.name="CO";
100                molecule.isotopesArray = ["26", "36", "28", "27", "38", "37"];
101                this.arrayGeisa2011.push(molecule);
102                this.arrayGeisa2003.push(molecule);
103                this.arrayGeisaIasi2011.push(molecule);
104                this.arrayGeisaIasi2003.push(molecule);
105
106                var molecule = new Object();
107                molecule.id="ch4";
108                molecule.name="CH<sub>4</sub>";
109                molecule.isotopesArray = ["211", "311"];
110                this.arrayGeisa2011.push(molecule);
111                this.arrayGeisa2003.push(molecule);
112
113                var molecule = new Object();
114                molecule.id="ch4";
115                molecule.name="CH<sub>4</sub>";
116                molecule.isotopesArray = ["211", "311", "212", "312"];
117                this.arrayGeisaIasi2011.push(molecule);
118
119                var molecule = new Object();
120                molecule.id="ch4";
121                molecule.name="CH<sub>4</sub>";
122                molecule.isotopesArray = ["211", "311", "212"];
123                this.arrayGeisaIasi2003.push(molecule);
124
125                var molecule = new Object();
126                molecule.id="o2";
127                molecule.name="O<sub>2</sub>";
128                molecule.isotopesArray = ["66", "67", "68"];
129                this.arrayGeisa2011.push(molecule);
130                this.arrayGeisa2003.push(molecule);
131
132                var molecule = new Object();
133                molecule.id="o2";
134                molecule.name="O<sub>2</sub>";
135                molecule.isotopesArray = ["66"];
136                this.arrayGeisaIasi2011.push(molecule);
137                this.arrayGeisaIasi2003.push(molecule);
138
139                var molecule = new Object();
140                molecule.id="no";
141                molecule.name="NO";
142                molecule.isotopesArray = ["46", "48", "56"];
143                this.arrayGeisa2011.push(molecule);
144                this.arrayGeisa2003.push(molecule);
145                this.arrayGeisaIasi2011.push(molecule);
146                this.arrayGeisaIasi2003.push(molecule);
147
148                var molecule = new Object();
149                molecule.id="so2";
150                molecule.name="SO<sub>2</sub>";
151                molecule.isotopesArray = ["626", "646"];
152                this.arrayGeisa2011.push(molecule);
153                this.arrayGeisa2003.push(molecule);
154                this.arrayGeisaIasi2011.push(molecule);
155                this.arrayGeisaIasi2003.push(molecule);
156
157                var molecule = new Object();
158                molecule.id="no2";
159                molecule.name="NO<sub>2</sub>";
160                molecule.isotopesArray = ["646"];
161                this.arrayGeisa2011.push(molecule);
162                this.arrayGeisa2003.push(molecule);
163                this.arrayGeisaIasi2011.push(molecule);
164                this.arrayGeisaIasi2003.push(molecule);
165
166                var molecule = new Object();
167                molecule.id="nh3";
168                molecule.name="NH<sub>3</sub>";
169                molecule.isotopesArray = ["411", "511" ];
170                this.arrayGeisa2011.push(molecule);
171                this.arrayGeisa2003.push(molecule);
172                this.arrayGeisaIasi2011.push(molecule);
173
174                var molecule = new Object();
175                molecule.id="ph3";
176                molecule.name="PH<sub>3</sub>";
177                molecule.isotopesArray = ["131" ];
178                this.arrayGeisa2011.push(molecule);
179                this.arrayGeisa2003.push(molecule);
180
181                var molecule = new Object();
182                molecule.id="hno3";
183                molecule.name="HNO<sub>3</sub>";
184                molecule.isotopesArray = ["146" ];
185                this.arrayGeisa2011.push(molecule);
186                this.arrayGeisa2003.push(molecule);
187                this.arrayGeisaIasi2011.push(molecule);
188                this.arrayGeisaIasi2003.push(molecule);
189
190                var molecule = new Object();
191                molecule.id="oh";
192                molecule.name="OH";
193                molecule.isotopesArray = ["61", "62", "81" ];
194                this.arrayGeisa2011.push(molecule);
195                this.arrayGeisa2003.push(molecule);
196
197                var molecule = new Object();
198                molecule.id="hf";
199                molecule.name="HF";
200                molecule.isotopesArray = ["19" ];
201                this.arrayGeisa2011.push(molecule);
202                this.arrayGeisa2003.push(molecule);
203
204                var molecule = new Object();
205                molecule.id="hcl";
206                molecule.name="HCL";
207                molecule.isotopesArray = ["15", "17" ];
208                this.arrayGeisa2011.push(molecule);
209                this.arrayGeisa2003.push(molecule);
210
211                var molecule = new Object();
212                molecule.id="hbr";
213                molecule.name="HBR";
214                molecule.isotopesArray = ["11", "19" ];
215                this.arrayGeisa2011.push(molecule);
216                this.arrayGeisa2003.push(molecule);
217
218                var molecule = new Object();
219                molecule.id="hi";
220                molecule.name="HI";
221                molecule.isotopesArray = ["17" ];
222                this.arrayGeisa2011.push(molecule);
223                this.arrayGeisa2003.push(molecule);
224
225                var molecule = new Object();
226                molecule.id="clo";
227                molecule.name="ClO";
228                molecule.isotopesArray = ["56", "76" ];
229                this.arrayGeisa2011.push(molecule);
230                this.arrayGeisa2003.push(molecule);
231
232                var molecule = new Object();
233                molecule.id="ocs";
234                molecule.name="OCS";
235                molecule.isotopesArray = ["622", "624", "632", "623", "822", "634"];
236                this.arrayGeisa2011.push(molecule);
237                this.arrayGeisa2003.push(molecule);
238                this.arrayGeisaIasi2011.push(molecule);
239                this.arrayGeisaIasi2003.push(molecule);
240
241                var molecule = new Object();
242                molecule.id="h2co";
243                molecule.name="H<sub>2</sub>CO";
244                molecule.isotopesArray = ["126", "128", "136"];
245                this.arrayGeisa2011.push(molecule);
246                this.arrayGeisa2003.push(molecule);
247
248                var molecule = new Object();
249                molecule.id="h2co";
250                molecule.name="H<sub>2</sub>CO";
251                molecule.isotopesArray = ["126"];
252                this.arrayGeisaIasi2011.push(molecule);
253
254                var molecule = new Object();
255                molecule.id="c2h6";
256                molecule.name="C<sub>2</sub>H<sub>6</sub>";
257                molecule.isotopesArray = ["226", "236"];
258                this.arrayGeisa2011.push(molecule);
259                this.arrayGeisa2003.push(molecule);
260
261                var molecule = new Object();
262                molecule.id="ch3d";
263                molecule.name="CH<sub>3</sub>D";
264                molecule.isotopesArray = ["212", "312"];
265                this.arrayGeisa2011.push(molecule);
266
267                var molecule = new Object();
268                molecule.id="ch3d";
269                molecule.name="CH<sub>3</sub>D";
270                molecule.isotopesArray = ["212"];
271                this.arrayGeisa2003.push(molecule);
272
273                var molecule = new Object();
274                molecule.id="c2h2";
275                molecule.name="C<sub>2</sub>H<sub>2</sub>";
276                molecule.isotopesArray = ["221", "231"];
277                this.arrayGeisa2011.push(molecule);
278                this.arrayGeisa2003.push(molecule);
279                this.arrayGeisaIasi2011.push(molecule);
280                this.arrayGeisaIasi2003.push(molecule);
281
282                var molecule = new Object();
283                molecule.id="c2h4";
284                molecule.name="C<sub>2</sub>H<sub>4</sub>";
285                molecule.isotopesArray = ["211", "311"];
286                this.arrayGeisa2011.push(molecule);
287                this.arrayGeisa2003.push(molecule);
288                this.arrayGeisaIasi2011.push(molecule);
289
290                var molecule = new Object();
291                molecule.id="geh4";
292                molecule.name="GeH<sub>4</sub>";
293                molecule.isotopesArray = ["411"];
294                this.arrayGeisa2011.push(molecule);
295                this.arrayGeisa2003.push(molecule);
296
297                var molecule = new Object();
298                molecule.id="hcn";
299                molecule.name="HCN";
300                molecule.isotopesArray = ["124", "125", "134", "224"];
301                this.arrayGeisa2011.push(molecule);
302                this.arrayGeisaIasi2011.push(molecule);
303
304                var molecule = new Object();
305                molecule.id="hcn";
306                molecule.name="HCN";
307                molecule.isotopesArray = ["124", "125", "134"];
308                this.arrayGeisa2003.push(molecule);
309
310                var molecule = new Object();
311                molecule.id="c3h8";
312                molecule.name="C<sub>3</sub>H<sub>8</sub>";
313                molecule.isotopesArray = ["221"];
314                this.arrayGeisa2011.push(molecule);
315                this.arrayGeisa2003.push(molecule);
316
317                var molecule = new Object();
318                molecule.id="c2n2";
319                molecule.name="C<sub>2</sub>N<sub>2</sub>";
320                molecule.isotopesArray = ["224"];
321                this.arrayGeisa2011.push(molecule);
322                this.arrayGeisa2003.push(molecule);
323
324                var molecule = new Object();
325                molecule.id="c4h2";
326                molecule.name="C<sub>4</sub>H<sub>2</sub>";
327                molecule.isotopesArray = ["211"];
328                this.arrayGeisa2011.push(molecule);
329                this.arrayGeisa2003.push(molecule);
330
331                var molecule = new Object();
332                molecule.id="hc3n";
333                molecule.name="HC<sub>3</sub>N";
334                molecule.isotopesArray = ["124"];
335                this.arrayGeisa2011.push(molecule);
336                this.arrayGeisa2003.push(molecule);
337
338                var molecule = new Object();
339                molecule.id="hocl";
340                molecule.name="HOCl";
341                molecule.isotopesArray = ["165", "167"];
342                this.arrayGeisa2011.push(molecule);
343                this.arrayGeisa2003.push(molecule);
344
345                var molecule = new Object();
346                molecule.id="n2";
347                molecule.name="N<sub>2</sub>";
348                molecule.isotopesArray = ["44"];
349                this.arrayGeisa2011.push(molecule);
350                this.arrayGeisa2003.push(molecule);
351                this.arrayGeisaIasi2011.push(molecule);
352                this.arrayGeisaIasi2003.push(molecule);
353
354                var molecule = new Object();
355                molecule.id="ch3cl";
356                molecule.name="CH<sub>3</sub>Cl";
357                molecule.isotopesArray = ["215", "217"];
358                this.arrayGeisa2011.push(molecule);
359                this.arrayGeisa2003.push(molecule);
360
361                var molecule = new Object();
362                molecule.id="h2o2";
363                molecule.name="H<sub>2</sub>O<sub>2</sub>";
364                molecule.isotopesArray = ["166"];
365                this.arrayGeisa2011.push(molecule);
366                this.arrayGeisa2003.push(molecule);
367
368                var molecule = new Object();
369                molecule.id="h2s";
370                molecule.name="H<sub>2</sub>S";
371                molecule.isotopesArray = ["121", "141", "131"];
372                this.arrayGeisa2011.push(molecule);
373                this.arrayGeisa2003.push(molecule);
374
375                var molecule = new Object();
376                molecule.id="hcooh";
377                molecule.name="HCOOH";
378                molecule.isotopesArray = ["261"];
379                this.arrayGeisa2011.push(molecule);
380                this.arrayGeisa2003.push(molecule);
381                this.arrayGeisaIasi2011.push(molecule);
382
383                var molecule = new Object();
384                molecule.id="cof2";
385                molecule.name="COF<sub>2</sub>";
386                molecule.isotopesArray = ["269"];
387                this.arrayGeisa2011.push(molecule);
388                this.arrayGeisa2003.push(molecule);
389
390                var molecule = new Object();
391                molecule.id="sf6";
392                molecule.name="SF<sub>6</sub>";
393                molecule.isotopesArray = ["29"];
394                this.arrayGeisa2011.push(molecule);
395                this.arrayGeisa2003.push(molecule);
396
397                var molecule = new Object();
398                molecule.id="c3h4";
399                molecule.name="C<sub>3</sub>H<sub>4</sub>";
400                molecule.isotopesArray = ["341"];
401                this.arrayGeisa2011.push(molecule);
402                this.arrayGeisa2003.push(molecule);
403
404                var molecule = new Object();
405                molecule.id="ho2";
406                molecule.name="HO<sub>2</sub>";
407                molecule.isotopesArray = ["166"];
408                this.arrayGeisa2011.push(molecule);
409                this.arrayGeisa2003.push(molecule);
410
411                var molecule = new Object();
412                molecule.id="clono2";
413                molecule.name="ClONO<sub>2</sub>";
414                molecule.isotopesArray = ["564", "764"];
415                this.arrayGeisa2011.push(molecule);
416                this.arrayGeisa2003.push(molecule);
417
418                var molecule = new Object();
419                molecule.id="ch3br";
420                molecule.name="CH<sub>3</sub>Br";
421                molecule.isotopesArray = ["79", "81"];
422                this.arrayGeisa2011.push(molecule);
423
424                var molecule = new Object();
425                molecule.id="ch3oh";
426                molecule.name="CH<sub>3</sub>OH";
427                molecule.isotopesArray = ["216"];
428                this.arrayGeisa2011.push(molecule);
429                this.arrayGeisaIasi2011.push(molecule);
430
431                var molecule = new Object();
432                molecule.id="noplus";
433                molecule.name="NO<sup>+</sup>";
434                molecule.isotopesArray = ["46"];
435                this.arrayGeisa2011.push(molecule);
436
437                var molecule = new Object();
438                molecule.id="hnc";
439                molecule.name="HNC";
440                molecule.isotopesArray = ["142"];
441                this.arrayGeisa2011.push(molecule);
442
443                var molecule = new Object();
444                molecule.id="c6h6";
445                molecule.name="C<sub>6</sub>H<sub>6</sub>";
446                molecule.isotopesArray = ["266"];
447                this.arrayGeisa2011.push(molecule);
448
449                var molecule = new Object();
450                molecule.id="c2hd";
451                molecule.name="C<sub>2</sub>HD";
452                molecule.isotopesArray = ["122"];
453                this.arrayGeisa2011.push(molecule);
454
455                var molecule = new Object();
456                molecule.id="cf4";
457                molecule.name="CF<sub>4</sub>";
458                molecule.isotopesArray = ["291"];
459                this.arrayGeisa2011.push(molecule);
460
461                var molecule = new Object();
462                molecule.id="ch3cn";
463                molecule.name="CH<sub>3</sub>CN";
464                molecule.isotopesArray = ["234"];
465                this.arrayGeisa2011.push(molecule);
466
467
468            },
469
470// CREATES ********************************************************
471            createForm: function()
472            {
473                //Titre de la page
474                var titlePage = document.createTextNode("Graphic vizualisation of the  GEISA  database");
475                document.getElementById("titlePage").appendChild(titlePage);
476
477                // Create menu deroulant  choix de la base
478                var paramDatabase = new Object();
479                paramDatabase.id = "selectDatabase";
480                paramDatabase.parent = $("#database1");
481                this.selectDatabase = new Select( paramDatabase );
482                this.selectDatabase.add( 'GEISA2011', "GEISA 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG09.class%>' );
483                this.selectDatabase.add( 'GEISAIASI2011', "GEISA-IASI 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeIasiG09.class%>' );
484                this.selectDatabase.add( 'GEISA2003', "GEISA 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG03.class%>' );
485                this.selectDatabase.add( 'GEISAIASI2003', "GEISA-IASI 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeIasiG03.class%>' );
486                this.selectDatabase.selectFirst( false );
487
488
489                this.createMolecules($('#BDD-GEISA2011'), this.arrayGeisa2011, "GEISA2011");
490                this.createMolecules($('#BDD-GEISA2003'), this.arrayGeisa2003, "GEISA2003");
491                this.createMolecules($('#BDD-GEISAIASI2011'), this.arrayGeisaIasi2011, "GEISAIASI2011");
492                this.createMolecules($('#BDD-GEISAIASI2003'), this.arrayGeisaIasi2003, "GEISAIASI2003");
493
494
495                //Zone texte  SpectralRange
496                //Titre général (qui changera en fonction de la base geisa choisie)
497                document.getElementById('spectralRangeTitre').innerHTML = "";
498                document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range from 0 to 35877.030506 cm<sup>-1</sup> :";
499
500                //Titre
501                //var titleSpectralRangeLower = document.createTextNode("Upper Bound :");
502               // document.getElementById("spectralRangeLower").appendChild(titleSpectralRangeLower);
503                document.getElementById("spectralRangeLower").innerHTML = "Lower value, cm<sup>-1</sup> : ";
504                //var titleSpectralRangeUpper = document.createTextNode("Upper Bound :");
505               // document.getElementById("spectralRangeUpper").appendChild(titleSpectralRangeUpper);
506                document.getElementById("spectralRangeUpper").innerHTML = "Upper value, cm<sup>-1</sup> : ";
507                //zone texte  SpectralRangeLower
508                var inputSpectralRangeLower = $( document.createElement( "input" ) );
509                inputSpectralRangeLower.attr( {id:"RangeLower", class:"styleInputs"} );
510                inputSpectralRangeLower.val(0);
511                //pour mettre à jour le menu déroulant des transitions
512                inputSpectralRangeLower.bind( 'blur', this, jQuery.proxy( this.requestTransition, this ));
513                this.containerFormSpectralRangeLower.append( inputSpectralRangeLower );
514                //zone texte   SpectralRangeUpper
515                var inputSpectralRangeUpper = $( document.createElement( "input" ) );
516                inputSpectralRangeUpper.attr( {id:"RangeUpper"} );
517                inputSpectralRangeUpper.val(35877.030506);
518                //pour mettre à jour le menu déroulant des transitions lorsque l'on change la valeur du spectral range
519                inputSpectralRangeUpper.bind( 'blur', this, jQuery.proxy( this.requestTransition, this ));
520                this.containerFormSpectralRangeUpper.append( inputSpectralRangeUpper );
521
522
523                 //Zone texte Intensity
524                //Titre
525                //var titleIntensityLower = document.createTextNode("Lower Bound :");
526                //document.getElementById("intensityLower").appendChild(titleIntensityLower);
527                //var titleIntensityUpper = document.createTextNode("Upper Bound :");
528                //document.getElementById("intensityUpper").appendChild(titleIntensityUpper);
529                  document.getElementById("intensityLower").innerHTML = "Lower value, cm/mol. : "
530                  document.getElementById("intensityUpper").innerHTML = "Upper value, cm/mol. : "
531
532                //zone texte    IntensityLower
533                var inputIntensityLower = $( document.createElement( "input" ) );
534                inputIntensityLower.attr( {id:"intensityLo", class:"styleInputs"} );
535                inputIntensityLower.val(0);
536                this.containerFormIntensityLower.append( inputIntensityLower );
537                //zone texte    IntensityUpper
538                var inputIntensityUpper = $( document.createElement( "input" ) );
539                inputIntensityUpper.attr( {id:"intensityUp"} );
540                inputIntensityUpper.val(1e-16);
541                this.containerFormIntensityUpper.append( inputIntensityUpper );
542
543
544                // Create menu deroulant  1er choix axe des y
545                //Titre
546                var titleAxeY1 = document.createTextNode("Select parameter (left Y-axis)");
547                document.getElementById("axeY1").appendChild(titleAxeY1);
548                var spaceBr = document.createElement ("br");
549                document.getElementById("axeY1").appendChild(spaceBr);
550                //menu déroulant
551               // var paramSelectAxeY1 = new Object();
552               // paramSelectAxeY1.id = "selectAxeY1";
553               // paramSelectAxeY1.parent = $("#axeY1");
554               // this.selectTraceAxeY1 = new Select( paramSelectAxeY1 );
555               // this.selectTraceAxeY1.add( 'B', "Intensity", jQuery.proxy(this.onClickSelectTraceAxeY1, this ));
556               // this.selectTraceAxeY1.add( 'C', "Air broadening pressure halfwidth", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
557               // this.selectTraceAxeY1.add( 'D', "Energy of the lower transition level", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
558               // this.selectTraceAxeY1.add( 'F', "Temperature dependence coefficient n of the air broadening halfwidth ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
559               // this.selectTraceAxeY1.add( 'N', "Self broadening pressure halfwidth (HWHM)", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
560               // this.selectTraceAxeY1.add( 'O', "Air pressure shift of the line transition", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
561               // this.selectTraceAxeY1.add( 'R', "Temperature dependence coefficient of the air pressure shift ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
562               // this.selectTraceAxeY1.selectFirst( false );
563                this.selectTraceAxeY1 = $( document.createElement( "select" ) );
564                this.selectTraceAxeY1.attr( {id:"selectAxeY1"} );
565                this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"B", text:"Intensity"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "B" ])));
566                this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"C", text:"Air broadening pressure halfwidth"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "C" ])));
567                this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"D", text:"Energy of the lower transition level"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "D" ])));
568                this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"F", text:"Temperature of the air broadening halfwidth"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "F" ])));
569                this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"N", text:"Self broadening pressure halfwidth (HWHM)"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "N" ])));
570                this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"O", text:"Air pressure shift of the line transition"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "O" ])));
571                this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"R", text:"Temperature of the air pressure shift"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "R" ])));
572                $("#axeY1").append(this.selectTraceAxeY1);
573
574
575
576                // Create menu deroulant  type de graphe
577                 //Titre
578                var titleTypeTrace = document.createTextNode("Type of graph");
579                document.getElementById("NbCourbes").appendChild(titleTypeTrace);
580                var spaceBr = document.createElement ("br");
581                document.getElementById("NbCourbes").appendChild(spaceBr);
582                //menu déroulant
583                //var paramNbCourbes = new Object();
584               // paramNbCourbes.id = "SelectNbCourbes";
585               // paramNbCourbes.parent = $("#NbCourbes");
586               // this.SelectNbCourbes = new Select( paramNbCourbes );
587               // this.SelectNbCourbes.add( 'cm', "One curve for each molecule selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) );
588               // this.SelectNbCourbes.add( 'ci', "One curve for each isotopologue selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) );
589               // this.SelectNbCourbes.add( 'gm', "One graph for each molecule selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) );
590               // this.SelectNbCourbes.add( 'gi', "One graph for each isotopologue selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) );
591               // this.SelectNbCourbes.add( 'ca', "One curve for all selection", jQuery.proxy(this.onClickSelectNbCourbes, this ) );
592               // this.SelectNbCourbes.selectFirst( false );
593                this.selectNbCourbes = $( document.createElement( "select" ) );
594                this.selectNbCourbes.attr( {id:"SelectNbCourbes"} );
595                this.selectNbCourbes.append($( document.createElement( "option" ) ).attr( {value:"ca", text:"One curve for all selection"} ).bind( 'click', jQuery.proxy(this.onClickSelectNbCourbes, [this, "ca" ])));
596                this.selectNbCourbes.append($( document.createElement( "option" ) ).attr( {value:"cm", text:"One curve for each molecule selected"} ).bind( 'click', jQuery.proxy(this.onClickSelectNbCourbes, [this, "cm" ])));
597                this.selectNbCourbes.append($( document.createElement( "option" ) ).attr( {value:"ci", text:"One curve for each isotopologue selected"} ).bind( 'click', jQuery.proxy(this.onClickSelectNbCourbes, [this, "ci" ])));
598                this.selectNbCourbes.append($( document.createElement( "option" ) ).attr( {value:"gm", text:"One graph for each molecule selected"} ).bind( 'click', jQuery.proxy(this.onClickSelectNbCourbes, [this, "gm" ])));
599                this.selectNbCourbes.append($( document.createElement( "option" ) ).attr( {value:"gi", text:"One graph for each isotopologue selected"} ).bind( 'click', jQuery.proxy(this.onClickSelectNbCourbes, [this, "gi" ])));
600                $("#NbCourbes").append(this.selectNbCourbes);
601
602
603                // Create menu deroulant  type d'échelle linéaire ou logarithmique  pour le choix y1
604                //Titre
605                var titleScaleY1 = document.createTextNode("Select the type of Scale (if intensity is choosen)");
606                document.getElementById("scaleY1Titre").appendChild(titleScaleY1);
607                //menu déroulant
608                //var paramSelectScaleY1 = new Object();
609                //paramSelectScaleY1.id = "SelectScaleY1";
610               // paramSelectScaleY1.parent = $("#scaleY1");
611               // this.selectScaleY1 = new Select( paramSelectScaleY1 );
612               // this.selectScaleY1.add( 'l', "Linear" );
613               // this.selectScaleY1.add( '-log_scale', "Logarithmic" );
614               // this.selectScaleY1.selectFirst( false );
615                this.selectScaleY1 = $( document.createElement( "select" ) );
616                this.selectScaleY1.attr( {id:"SelectScaleY1"} );
617                var optSelectScaleY1 = $( document.createElement( "option" ) );
618                optSelectScaleY1.attr( {value:"l", text:"Linear"} );
619                this.selectScaleY1.append(optSelectScaleY1);
620                var optSelectScaleY1 = $( document.createElement( "option" ) );
621                optSelectScaleY1.attr( {value:"-log_scale", text:"Logarithmic"} );
622                this.selectScaleY1.append(optSelectScaleY1);
623                $("#scaleY1").append(this.selectScaleY1);
624
625
626                // Create menu deroulant  style de tracer   Y1
627                //Titre
628                var titleTypeTrace = document.createTextNode("Select the type of plot");
629                document.getElementById("typePlotY1").appendChild(titleTypeTrace);
630                var spaceBr = document.createElement ("br");
631                document.getElementById("typePlotY1").appendChild(spaceBr);
632                //menu déroulant
633               // var paramSelectTypeTraceY1 = new Object();
634               // paramSelectTypeTraceY1.id = "SelectTypePlotY1";
635               // paramSelectTypeTraceY1.parent = $("#typePlotY1");
636               // this.selectTypeTraceY1 = new Select( paramSelectTypeTraceY1 );
637               // this.selectTypeTraceY1.add( 'l', "Lines" );
638               // this.selectTypeTraceY1.add( 'p', "Dots" );
639               // this.selectTypeTraceY1.add( 'i', "Peaks" );
640               // this.selectTypeTraceY1.add( 'lp', "Lines and Dots" );
641               // this.selectTypeTraceY1.selectFirst( false );
642                this.selectTypeTraceY1 = $( document.createElement( "select" ) );
643                this.selectTypeTraceY1.attr( {id:"SelectTypePlotY1"} );
644                this.selectTypeTraceY1.append($( document.createElement( "option" ) ).attr( {value:"l", text:"Lines"} ));
645                this.selectTypeTraceY1.append($( document.createElement( "option" ) ).attr( {value:"p", text:"Dots"} ));
646                this.selectTypeTraceY1.append($( document.createElement( "option" ) ).attr( {value:"i", text:"Peaks"} ));
647                this.selectTypeTraceY1.append($( document.createElement( "option" ) ).attr( {value:"lp", text:"Lines and Dots"} ));
648                $("#typePlotY1").append(this.selectTypeTraceY1);
649
650
651
652
653                //lien pour montrer ou cacher le bloc "advanced options"
654                var showHide = $(document.createElement("a"));
655                showHide.html("Show advanced options");
656                showHide.attr( {id:"aShowHide", class:"fieldsetGeneralTitle"} );
657                showHide.bind( 'click', this, jQuery.proxy( this.onClickShowAdvancedOptions));
658                $("#showAdvancedOptions").append(showHide);
659
660
661                //titre  menu deroulant  transition upper
662                var titleTransitionUpper = document.createTextNode("Upper state : ");
663                document.getElementById("transitionUpper").appendChild(titleTransitionUpper);
664
665
666                // Create menu deroulant  transition upper
667//                var paramSelectTransitionUpper = new Object();
668//                paramSelectTransitionUpper.id = "transition1";
669//                paramSelectTransitionUpper.parent = $("#transitionUpper");
670//                this.selectTransitionUpper = new Select( paramSelectTransitionUpper );
671//                this.selectTransitionUpper.add( '-1', "Select a molecule" );
672//                this.selectTransitionUpper.selectFirst( false );
673
674                this.selectTransitionUpper = $( document.createElement( "select" ) );
675                this.selectTransitionUpper.attr( {id:"transition1"} );
676                var optTransitionUpper = $( document.createElement( "option" ) );
677                optTransitionUpper.attr( {value:"-1", text:"Select a molecule"} );
678                //var  transitionsLower ="000";
679                // opt2.bind( 'click', jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ]));
680                this.selectTransitionUpper.append(optTransitionUpper);
681                $("#transitionUpper").append(this.selectTransitionUpper);
682
683
684                //titre  menu deroulant  transition lower
685                var titleTransitionLower = document.createTextNode("Lower state : ");
686                document.getElementById("transitionLower").appendChild(titleTransitionLower);
687
688                // Create menu deroulant  transition lower
689//                var paramSelectTransitionLower = new Object();
690//                paramSelectTransitionLower.id = "transition2";
691//                paramSelectTransitionLower.parent = $("#transitionLower");
692//                this.selectTransitionLower = new Select( paramSelectTransitionLower );
693//                this.selectTransitionLower.add( '-1', "Select a molecule");
694//                this.selectTransitionLower.selectFirst( false );
695                this.selectTransitionLower = $( document.createElement( "select" ) );
696                this.selectTransitionLower.attr( {id:"transition2"} );
697                var optTransitionLower = $( document.createElement( "option" ) );
698                optTransitionLower.attr( {value:"-1", text:"Select a molecule"} );
699                this.selectTransitionLower.append(optTransitionLower);
700                $("#transitionLower").append(this.selectTransitionLower);
701
702                //bouton reset pour les transition
703                var resetButton = new Button( {value:"Reset", parent:$( "#transitionReset" ), id:"buttonReset", className: "gray_button", onClick:jQuery.proxy( this.requestTransition, this )} );
704
705
706//                //menu déroulant  js   en javascript    sans passer par le modele
707//                var select = document.createElement('select');
708//                select.id = "transiEssai";
709//                select.name ="transiEssai";
710//
711//                var opt = document.createElement('option');
712//                opt.setAttribute('value','id1');
713//                var theText = document.createTextNode("id1");
714//                opt.appendChild(theText);
715//                select.appendChild(opt);
716//
717//                var opt = document.createElement('option');
718//                opt.setAttribute('value','id2');
719//                var theText = document.createTextNode("id2");
720//                opt.appendChild(theText);
721//
722//                //opt.onclick=jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ]);
723//                    select.appendChild(opt);
724//                    document.getElementById("transitionLower").appendChild(select);
725
726
727                //menu déroulant en jquery    sans passer par le modele
728//                this.select2 = $( document.createElement( "select" ) );
729//                this.select2.attr( {id:"transiEssai2", name:"transiEssai2"} );
730//                var opt2 = $( document.createElement( "option" ) );
731//                opt2.attr( {value:"id3", text:"zzz"} );
732//                //var  transitionsLower ="000";
733//                // opt2.bind( 'click', jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ]));
734//                this.select2.append(opt2);
735//                $("#transitionLower").append(this.select2);
736
737
738
739
740                //Zone text Mean Value
741                //Titre
742                var titleMeanValue = document.createTextNode("Step : ");
743                document.getElementById("meanValue1").appendChild(titleMeanValue);
744                //champ input
745                var inputMeanValue = $( document.createElement( "input" ) );
746                inputMeanValue.attr( {id:"meanValue2"} );
747                inputMeanValue.val(0);
748                this.containerFormMeanValue1.append( inputMeanValue );
749                inputMeanValue.bind( 'blur', this, jQuery.proxy( this.onBlurInputMeanValue, this ));
750
751
752                // Create menu deroulant  2eme choix axe des y
753                //Titre
754                var titleAxeY2 = document.createTextNode("Select secondary parameter (right Y-axis)");
755                document.getElementById("axeY2Titre").appendChild(titleAxeY2);
756                //menu déroulant
757                var paramSelectAxeY2 = new Object();
758                paramSelectAxeY2.id = "selectAxeY2";
759                paramSelectAxeY2.parent = $("#axeY2");
760                this.selectTraceAxeY2 = new Select( paramSelectAxeY2 );
761                this.selectTraceAxeY2.add( 'no', "None", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
762                this.selectTraceAxeY2.add( 'B', "Intensity", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
763                this.selectTraceAxeY2.add( 'C', "Air broadening pressure halfwidth", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
764                this.selectTraceAxeY2.add( 'D', "Energy of the lower transition level", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
765                this.selectTraceAxeY2.add( 'F', "Temperature dependence coefficient n of the air broadening halfwidth ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
766                this.selectTraceAxeY2.add( 'N', "Self broadening pressure halfwidth (HWHM)", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
767                this.selectTraceAxeY2.add( 'O', "Air pressure shift of the line transition", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
768                this.selectTraceAxeY2.add( 'R', "Temperature dependence coefficient of the air pressure shift ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
769                this.selectTraceAxeY2.selectFirst( false );
770
771                // Create menu deroulant  type d'échelle linéaire ou logarithmique  pour le choix y2
772                //Titre
773                var titleScaleY2 = document.createTextNode("Select the type of Scale (if intensity is choosen)");
774                document.getElementById("scaleY2Titre").appendChild(titleScaleY2);
775                //menu déroulant
776                var paramSelectScaleY2 = new Object();
777                paramSelectScaleY2.id = "SelectScaleY2";
778                paramSelectScaleY2.parent = $("#scaleY2");
779                this.selectScaleY2 = new Select( paramSelectScaleY2 );
780                this.selectScaleY2.add( 'l', "Linear" );
781                this.selectScaleY2.add( '-log_scale2', "Logarithmic" );
782                this.selectScaleY2.selectFirst( false );
783                //est inactif par defaut car selectTraceAxeY2 est positionne a none par defaut
784                document.getElementById("scaleY2Titre").className = "notActiveText";
785                this.selectScaleY2.disable();
786
787                // Create menu deroulant  style de tracer       Y2
788                //Titre
789                var titleTypeTrace = document.createTextNode("Select the type of plot");
790                document.getElementById("typePlotY2Titre").appendChild(titleTypeTrace);
791                //menu déroulant
792                var paramSelectTypeTraceY2 = new Object();
793                paramSelectTypeTraceY2.id = "SelectTypePlotY2";
794                paramSelectTypeTraceY2.parent = $("#typePlotY2");
795                this.selectTypeTraceY2 = new Select( paramSelectTypeTraceY2 );
796                this.selectTypeTraceY2.add( 'l', "Lines" );
797                this.selectTypeTraceY2.add( 'p', "Dots" );
798                this.selectTypeTraceY2.add( 'i', "Peaks" );
799                this.selectTypeTraceY2.add( 'lp', "Lines and Dots" );
800                this.selectTypeTraceY2.selectFirst( false );
801                //est inactif par defaut car selectTraceAxeY2 est positionne a none par defaut
802                document.getElementById("typePlotY2Titre").className = "notActiveText";
803                this.selectTypeTraceY2.disable();
804
805
806
807
808                //création de l'image d'attente
809                var param = new Object();
810               param.id = "loadingForGraphics";
811               param.parent = this.containerLoading;
812               this.loadingGraphics = new Loading( param );
813              // this.loadingGraphics.display();
814               //this.loadingGraphics.hide();
815
816
817                // var submitButton = new Button( {value:"Submit", parent:$( "#boutonSubmit" ), id:"button_submit_3", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickSubmit, this )} );
818                var submitButton = new Button( {value:"Submit", parent:$( "#boutonSubmit" ), id:"button_submit_3", className: "positive", onClick:jQuery.proxy( this.onClickSubmit, this )} );
819            },
820
821
822
823
824            /**
825             * This method creates the case to check for the moles
826             * create cases à cocher pour les molécules
827             * @param container
828             * @param moleculesArray
829             */
830                //createMolecules: function(container, moleculesArray)
831            createMolecules: function(container, moleculesArray, BddVersion)
832            {
833                var table = $(document.createElement("table"));
834                container.append(table);
835                // var tr = $(document.createElement("tr"));
836                // tr.attr({valign: "top"});
837                // table.append(tr);
838                var i=0;
839                //nombre de molecules par ligne
840                var l=10;
841                //taille du tableau
842                //alert("l" +moleculesArray.length);
843                // parseInt : partie entiÚre
844                // var res =  parseInt(8/3);
845                //alert("res="+res);
846
847                $.each(moleculesArray, jQuery.proxy( function(index, moleculeElement )
848                {
849
850
851                    //this.tr et non var tr pour que tr existe encore à la sortie du if
852                    if ( index == (i*l))
853                    {
854                        //alert(index);
855                        this.tr = $(document.createElement("tr"));
856                        this.tr.attr({valign: "top"});
857                        table.append(this.tr);
858                        i=i+1;
859
860                    }
861                    var td = $(document.createElement("td"));
862                    this.tr.append(td);
863
864                    var span= $(document.createElement("span"));
865                    span.addClass("molecule");
866                    td.append(span);
867
868                    var input = $(document.createElement("input"));
869                    input.attr({type:"checkbox", id:"all-"+moleculeElement.id+"-"+BddVersion});
870                    input.bind( 'click', this, jQuery.proxy( this.cliquetout, [this, moleculeElement.id, BddVersion ] ));
871                    span.append(input);
872
873                    var a = $(document.createElement("a"));
874                    a.html("<b>"+moleculeElement.name+"</b>");
875
876                    a.bind( 'click', this, jQuery.proxy( this.visibilite, [this,"Cache-"+ moleculeElement.id] ));
877                    span.append(a);
878
879                    var div= $(document.createElement("div"));
880                    div.addClass("divViolet");
881                    div.attr({id:"Cache-"+moleculeElement.id, style: "display:none"});
882                    td.append(div);
883
884                    var spanIsotopes= $(document.createElement("span"));
885                    spanIsotopes.addClass("isotope");
886                    spanIsotopes.attr({id:moleculeElement.id+"Isotope"+BddVersion});
887                    div.append(spanIsotopes);
888
889
890                    this.createIsotopes($("#"+moleculeElement.id+"Isotope"+BddVersion), moleculeElement.isotopesArray, moleculeElement.id, BddVersion);
891
892
893                }, this) );
894
895
896            },
897
898            createIsotopes: function(container, isotopesArray, moleculeElement, BddVersion )
899            {
900
901
902                $.each(isotopesArray, jQuery.proxy( function( index, isotopeElement )
903                {
904                    container.append("&nbsp;&nbsp;&nbsp;");
905                    var inputIsotopes = $(document.createElement("input"));
906                    inputIsotopes.attr({type:"checkbox", id:"chk-"+moleculeElement+"_"+isotopeElement+"-"+BddVersion, name:"moles", value:moleculeElement+"_"+isotopeElement});
907                    inputIsotopes.bind( 'click', this, jQuery.proxy( this.cliqueIsotope, [this, moleculeElement+"_"+isotopeElement, moleculeElement, BddVersion ] ));
908                    container.append(inputIsotopes);
909                    container.append(isotopeElement);
910                    var br = $(document.createElement("br"));
911                    container.append(br);
912
913                }, this) );
914            },
915
916            // <table><tr><td>
917            // <span class="molecule"><input type=checkbox id=all-ch3cn-GEISA2011 onclick="cliquetout('this, ch3cn, GEISA2011');">
918            //          <a href="javascript:visibilite('this, Cache-ch3cn');"><B>CH<sub>3</sub>CN</a></B>
919            // </span>
920            // <div class="divViolet" id="Cache-ch3cn" style="display:none;">
921            //          <span class="isotope" id="ch3cnIsotopeGEISA2011">&nbsp;&nbsp;&nbsp;<input type=checkbox id=chk-ch3cn_234-GEISA2011 name=moles value=ch3cn_234 onclick="cliqueIsotope('this, ch3cn_234, GEISA2011');">234<br></span>
922            // </div>
923            // </td></tr></table>
924
925// REQUESTS ********************************************************
926            //récupération de toutes les valeurs choisies par l'utilisateur et transformation de ces valeurs pour les inclure dans la requête fortran
927            requestGeisa: function()
928            {
929
930                //on va chercher les chemin déclaré dans le controller
931                this.pathProcess = "<%=Controller.PATH_PROCESS%>";
932                this.LongPathImages = "<%=Controller.LONG_PATH_IMAGES%>";
933
934
935
936                 //sélection du fichier binaire de la base geisa sélectionnée
937                var paramBase = "";
938                switch (this.selectDatabase.getValue()) {
939                    case 'GEISA2003':
940                        paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+" -filein "+this.pathProcess+"line_GEISA2003_asc_gs03_v1.0 -input_format asc -database_name GEISA2003 -database_type gs03";
941                        break;
942                    case 'GEISA2011':
943                        paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+" -filein "+this.pathProcess+"line_GEISA2009_bin -database_name GEISA2011 -database_type gs08";
944                        break;
945                    case 'GEISAIASI2003':
946                        paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+" -filein "+this.pathProcess+"line_GEISAIASI2003_asc_gsi03_v1.0 -input_format asc -database_name GEISAIASI2003 -database_type gsi03";
947                        break;
948                    case 'GEISAIASI2011':
949                        paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+" -filein "+this.pathProcess+"line_GEISAIASI2011_bin_gsi08_v1.0 -database_name GEISAIASI2011 -database_type gsi08";
950                        break;
951                }
952
953
954                //molécules
955                //récupération des molécules sélectionnées
956                var inputs = document.getElementsByTagName( 'input' );
957                var count = inputs.length;
958                var isotopesSelectedName ="";
959              //  alert(this.selectDatabase.getValue());
960                var i=0;
961                this.nbIsotopes = 0;
962                this.nbMolecules = 0;
963                this.nbGraph = 0;
964                for( i = 0; i < count; i++ )
965                {
966                    var input = inputs.item( i );
967                    //ne prendre que les isotopes sélectionnés dans la base de données sélectionnée  (rechercher des id du type :  "chk-ch3cn-GEISA-11")
968                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1)
969                    {
970                        //nombre d'isotopes sélectionnés
971                        this.nbIsotopes =  this.nbIsotopes + 1;
972
973                        var molN=input.value;
974                        var molN1=molN.replace("_", ":");
975                        // exemple : -moleisot h2o:161 -moleisot h2o:162 -moleisot co2:626 -moleisot co2:627 -moleisot o3:666 -moleisot o3:668
976                        isotopesSelectedName = isotopesSelectedName+"-moleisot "+molN1+" ";
977                    }
978                    //récupération du nombre de molécules sélectionnées
979                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("all-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1)
980                    {
981                        //nombre d'isotopes sélectionnés
982                        this.nbMolecules =  this.nbMolecules + 1;
983                    }
984                }
985
986
987                //averti l'utilisateur qu'il faut au moins sélectionner un isotope
988                if (this.nbIsotopes ==  0) {
989                    alert("Error : no molecule or isotopoloque was selected");
990                    return;
991                }
992
993
994
995                //sélection du nombre de courbes ou de graphs
996
997                var nbCourbes = "";
998
999                //switch (this.SelectNbCourbes.getValue()) {
1000                switch (document.getElementById('SelectNbCourbes').options[document.getElementById('SelectNbCourbes').selectedIndex].value) {
1001                    case 'cm':
1002                        nbCourbes = "-separate_mol -same_graph ";
1003                        this.nbGraph = 1;
1004                        this.nbCourbe =  this.nbMolecules;
1005                        if (this.nbCourbe > 8) {
1006                            alert("Too much molecules selected to draw one curve for each molecule selected");
1007                            return;
1008                        }
1009                        break;
1010                    case 'ci':
1011                        nbCourbes = "-separate_iso -same_graph ";
1012                        this.nbGraph = 1;
1013                        this.nbCourbe =  this.nbIsotopes;
1014                        if (this.nbCourbe > 8) {
1015                            alert("Too much isotopologues selected to draw one curve for each isotopologues selected");
1016                            return;
1017                        }
1018                        break;
1019                    case 'gm':
1020                        nbCourbes = "-separate_mol ";
1021                        this.nbGraph = this.nbMolecules;
1022                        if (this.nbGraph > 20) {
1023                            alert("Too much molecules selected to draw one graph for each molecules selected");
1024                            return;
1025                        }
1026                        break;
1027                    case 'gi':
1028                        nbCourbes = "-separate_iso ";
1029                        this.nbGraph = this.nbIsotopes;
1030                        if (this.nbGraph > 20) {
1031                            alert("Too much isotopologues selected to draw one graph for each isotopologues selected");
1032                            return;
1033                        }
1034                        break;
1035                    default:
1036                        nbCourbes = "";
1037                        this.nbGraph = 1;
1038                        break;
1039                }
1040
1041
1042                //Spectral range
1043                var rangeLower="-wavenb_min "+$("#RangeLower").val();
1044                var rangeUpper="-wavenb_max "+$("#RangeUpper").val();
1045
1046                //controle des valeurs entrées par l'utilisateur
1047
1048                switch (this.selectDatabase.getValue()) {
1049                    case 'GEISA2003':
1050                        //isNaN = n'est pas un nombre
1051                        if(isNaN($("#RangeLower").val()) == true ||   parseInt($("#RangeLower").val()) < 0  || parseInt($("#RangeLower").val()) > 35877.030506)
1052                        {
1053                            alert("Error: Invalid value for lower spectral range area");
1054                            return;
1055                        }
1056
1057                        if(isNaN($("#RangeUpper").val()) == true ||   parseInt( $("#RangeUpper").val()) == 0 || parseInt( $("#RangeUpper").val()) < 0  || parseInt($("#RangeUpper").val()) > 35877.030506)
1058                        {
1059                            alert("Error: Invalid value for upper spectral range area");
1060                            return;
1061                        }
1062                        break;
1063                    case 'GEISA2011':
1064                        //isNaN = n'est pas un nombre
1065                        if(isNaN($("#RangeLower").val()) == true ||   parseInt($("#RangeLower").val()) < 0  || parseInt($("#RangeLower").val()) > 35877.030506)
1066                        {
1067                            alert("Error: Invalid value for lower spectral range area");
1068                            return;
1069                        }
1070
1071                        if(isNaN($("#RangeUpper").val()) == true ||   parseInt( $("#RangeUpper").val()) == 0 || parseInt( $("#RangeUpper").val()) < 0  || parseInt($("#RangeUpper").val()) > 35877.030506)
1072                        {
1073                            alert("Error: Invalid value for upper spectral range area");
1074                            return;
1075                        }
1076                        break;
1077                    case 'GEISAIASI2003':
1078                        //isNaN = n'est pas un nombre
1079                        if(isNaN($("#RangeLower").val()) == true ||   parseInt($("#RangeLower").val()) < 0 || parseInt($("#RangeLower").val()) < 599.000793 || parseInt($("#RangeLower").val()) > 3000.998767)
1080                        {
1081                            alert("Error: Invalid value for lower spectral range area");
1082                            return;
1083                        }
1084
1085                        if(isNaN($("#RangeUpper").val()) == true ||   parseInt( $("#RangeUpper").val()) == 0 || parseInt( $("#RangeUpper").val()) < 0  ||  parseInt($("#RangeUpper").val()) < 599.000793 || parseInt($("#RangeUpper").val()) > 3000.998767)
1086                        {
1087                            alert("Error: Invalid value for upper spectral range area");
1088                            return;
1089                        }
1090                        break;
1091                    case 'GEISAIASI2011':
1092                        //isNaN = n'est pas un nombre
1093                        if(isNaN($("#RangeLower").val()) == true ||   parseInt($("#RangeLower").val()) < 0 || parseInt($("#RangeLower").val()) < 599.000793 || parseInt($("#RangeLower").val()) > 3000.998767)
1094                        {
1095                            alert("Error: Invalid value for lower spectral range area");
1096                            return;
1097                        }
1098
1099                        if(isNaN($("#RangeUpper").val()) == true ||   parseInt( $("#RangeUpper").val()) == 0 || parseInt( $("#RangeUpper").val()) < 0  ||  parseInt($("#RangeUpper").val()) < 599.000793 || parseInt($("#RangeUpper").val()) > 3000.998767)
1100                        {
1101                            alert("Error: Invalid value for upper spectral range area");
1102                            return;
1103                        }
1104                        break;
1105                }
1106
1107
1108                if ($("#RangeLower").val() == ""  )
1109                {
1110                    rangeLower="";
1111                }
1112
1113                if ($("#RangeUpper").val() == ""  )
1114                {
1115                    rangeUpper="";
1116                }
1117                if( parseInt($("#RangeLower").val())  > parseInt($("#RangeUpper").val()) )
1118                {
1119                    alert("Error: lower spectral range area is superior to upper spectral range area ");
1120                    return;
1121                }
1122
1123
1124                //Transitions  to do
1125                //exemple de requete avec transition
1126                //./all -filein line_GEISA2009_bin -moleisot h2o:161 -wavenb_min 1 -wavenb_max 1000 -database_name "GEISA2011" -vib_ident_lower '[000]'
1127                //var TransitionUpper ="-vib_ident_upper '[ "+this.selectTransitionUpper.getValue()+" ]'";
1128                var transitionUpper=document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value;
1129                //Enlever les espaces blancs
1130               // TransitionUp= TransitionUp.replace(/ /g,"");
1131               //var TransitionUpper ="-vib_ident_upper ["+TransitionUp+"]";
1132                // var transitionUpper = "["+transitionUp+"]";
1133               // alert ("transitionUpper"+transitionUpper);
1134
1135                // var TransitionLower ="-vib_ident_lower '[ "+this.selectTransitionLower.getValue()+" ]'";
1136                  var transitionLower=document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value;
1137                //  TransitionLo= TransitionLo.replace(/ /g,"");
1138                 // var TransitionLower ="-vib_ident_lower ["+TransitionLo+"]";
1139                //var transitionLower ="["+transitionLo+"]";
1140
1141                 //pas de transition sélectionnée
1142                // if (( this.selectTransitionUpper.getValue()== -1) ||  (this.selectTransitionUpper.getValue() == "transition" ))
1143                // {
1144                // TransitionUpper ="";
1145                // }
1146                // if (( this.selectTransitionLower.getValue()== -1) ||  (this.selectTransitionLower.getValue() == "transition" ))
1147                // {
1148                // TransitionLower ="";
1149                // }
1150                if (( document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == -1) ||  (document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == "transition" ))
1151                {
1152                    transitionUpper ="no";
1153                }
1154                if (( document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == -1) ||  (document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == "transition" ))
1155                {
1156                    transitionLower ="no";
1157                }
1158
1159                if ( document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == "")
1160                {
1161                    transitionUpper ="noValue";
1162                }
1163
1164                if ( document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == "")
1165                {
1166                    transitionLower ="noValue";
1167                }
1168
1169                 var sel = document.getElementById('transition1');
1170                 var idupper = sel.options[sel.selectedIndex].value;
1171                  //alert("idupper"+idupper);
1172
1173                //Intensity range
1174                var intensityLower="-int_min "+$("#intensityLo").val();
1175                var intensityUpper="-int_max "+$("#intensityUp").val();
1176
1177                //controle des valeurs entrées par l'utilisateur
1178                 if(isNaN($("#intensityLo").val()) == true ||   $("#intensityLo").val() < 0  )
1179                {
1180                    alert("Error: Invalid value for lower intensity range area");
1181                    return;
1182                }
1183                if ($("#intensityLo").val() == ""  )
1184                {
1185                    intensityLower="";
1186                }
1187                if(isNaN($("#intensityUp").val()) == true ||   $("#intensityUp").val() < 0  )
1188                {
1189                    alert("Error: Invalid value for upper intensity range area");
1190                    return;
1191                }
1192                if ($("#intensityUp").val() == ""  )
1193                {
1194                    intensityUpper="";
1195                }
1196
1197                //to do javascript ne sait comparer des exponenciels
1198              // if( $("#intensityLo").val()  > $("#intensityUp").val() )
1199
1200               // {
1201               //     alert("Error: lower intensity range area is superior to upper intensity range area ");
1202               //     return;
1203               // }
1204
1205
1206                //Valeur de mean value
1207                var meanValue = "-step "+$("#meanValue2").val();
1208                //controle des valeurs entrées par l'utilisateur
1209                //Si ce n'est pas un nombre ou si il est négatif
1210                if(isNaN($("#meanValue2").val()) == true ||   $("#meanValue2").val() < 0  )
1211                {
1212                    alert("Error: Invalid value for Average calculation area");
1213                    return;
1214                }
1215                //si aucune valeur
1216                if ($("#meanValue2").val() == ""  )
1217                {
1218                    meanValue="";
1219                }
1220
1221                //sélection du premier choix pour l'axe des Y
1222                var field="-field "+this.selectTraceAxeY1.getValue();
1223
1224
1225                 //sélection du type d'échelle pour le parametre Y1 (il y a une valeur pour ce champ que si logaritmic est choisi et si l'option est activée)
1226                //if  (this.selectScaleY1.getValue() == '-log_scale' && this.selectScaleY1.isDisable == false)
1227                //{
1228                //    var logScale = this.selectScaleY1.getValue();
1229               // }
1230               // else
1231               // {
1232                //    var logScale = ""
1233                //}
1234                if  (document.getElementById('SelectScaleY1').options[document.getElementById('SelectScaleY1').selectedIndex].value == '-log_scale' && document.getElementById("SelectScaleY1" ).disabled == false)
1235                {
1236                    var logScale = document.getElementById('SelectScaleY1').options[document.getElementById('SelectScaleY1').selectedIndex].value;
1237                }
1238                else
1239                {
1240                    var logScale = ""
1241                }
1242
1243
1244                //sélection du type de tracé pour Y1
1245                //var lineType="-line_type "+this.selectTypeTraceY1.getValue();
1246                var lineType="-line_type "+document.getElementById('SelectTypePlotY1').options[document.getElementById('SelectTypePlotY1').selectedIndex].value;
1247
1248
1249                //sélection ou non d'un 2eme choix pour l'axe des Y   (pas de valeur pour ce champ si choix none ou si l'option n'est pas activée)
1250                if  (this.selectTraceAxeY2.getValue() == 'no' ||  this.selectTraceAxeY2.isDisable == true)
1251                {
1252                    var field2 = "";
1253                }
1254                else
1255                {
1256                    var field2 = "-field2 "+this.selectTraceAxeY2.getValue();
1257                }
1258
1259                //sélection du type d'échelle pour le parametre Y2 (il y a une valeur pour ce champ que si logaritmic est choisi et si l'option est activée)
1260                if  (this.selectScaleY2.getValue() == '-log_scale2' && this.selectScaleY2.isDisable == false)
1261                {
1262                    var logScale2 =this.selectScaleY2.getValue();
1263                }
1264                else
1265                {
1266                    var logScale2 = "";
1267                }
1268
1269
1270                //sélection du type de tracé pour Y2  (pas de valeur  si l'option n'est pas activée)
1271                if  ( this.selectTypeTraceY2.isDisable == true)
1272                {
1273                    var lineType2 = "";
1274                }
1275                else
1276                {
1277                    var lineType2 = "-line_type2 "+this.selectTypeTraceY2.getValue();
1278                }
1279
1280
1281                //ouverture de la div de l'image d'attente
1282                this.loadingGraphics.display();
1283
1284
1285
1286
1287                //construction de la requête Fortran
1288               // var parameters = "&fortranRequest="+paramBase+" "+isotopesSelectedName+" "+rangeLower+" "+rangeUpper+" "+TransitionUpper+" "+TransitionLower+" "+intensityLower+" "+intensityUpper+" "+
1289                                      // meanValue+" "+nbCourbes+" "+field+" "+logScale+" "+lineType+" "+field2+" "+logScale2+" "+lineType2;
1290
1291                var parameters = "&fortranRequest="+paramBase+" "+isotopesSelectedName+" "+rangeLower+" "+rangeUpper+" "+intensityLower+" "+intensityUpper+" "+
1292                                       meanValue+" "+nbCourbes+" "+field+" "+logScale+" "+lineType+" "+field2+" "+logScale2+" "+lineType2;
1293
1294                 alert ("parameters"+parameters);
1295
1296                //remplacement de espace par "EEE" pour que le shell script ne voit qu'un seul argument en entrée
1297                parameters=parameters.replace(/ /g,"EEE");
1298                transitionUpper=transitionUpper.replace(/ /g,"EEE");
1299                //le + est interprété comme un espace (plus sera retransformé en + dans le shell)
1300                transitionUpper=transitionUpper.replace(/\+/g,"plus");
1301                transitionLower=transitionLower.replace(/ /g,"EEE");
1302                transitionLower=transitionLower.replace(/\+/g,"plus");
1303
1304
1305                //envoie de la requête au controller
1306                //en cas de succes appel de la fonction "handleGeisa"
1307                $.ajax( {
1308                            //url: "project?methodName=createUserRequest&"+parameters+"&nbGraph="+ this.nbGraph,
1309                            url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph,
1310                            success:jQuery.proxy( this.handleGeisa, this )
1311                        } );
1312            },
1313
1314
1315            //requête pour interrogation de la base de données des transitions
1316            requestTransition: function()
1317            {
1318
1319                var  nbMolecules=0;
1320
1321                //Récupération du spectral range
1322                var spectralRangeLower = $("#RangeLower").val();
1323                var spectralRangeUpper = $("#RangeUpper").val();
1324
1325                //Récupération des isotopes sélectionnés
1326                var inputs = document.getElementsByTagName( 'input' );
1327                var count = inputs.length;
1328                var isotopesSelectedNameArray = new Array();
1329                var i=0;
1330
1331                for( i = 0; i < count; i++ )
1332                {
1333                    var input = inputs.item( i );
1334                    //ne prendre que les isotopes sélectionnés dans la base de données sélectionnée  (rechercher des id du type :  "chk-ch3cn-GEISA-11")
1335                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1)
1336                    {
1337                        var molN=input.value;
1338                        var molN1=molN.replace("_", ":");
1339                        //tous les isotopes sélectionnés sont placés dans un tableau
1340                        isotopesSelectedNameArray.push(molN1);
1341                    }
1342
1343                    //récupération du nombre de molécules sélectionnées
1344                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("all-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1)
1345                    {
1346                       nbMolecules =  nbMolecules + 1;
1347                    }
1348
1349                }
1350                //alert ("nbMolecules"+nbMolecules);
1351                //si le nombre de molécule sélectionnées est supérieure Ã  1 les menus des transition sont inactifs
1352                if (nbMolecules > 1)
1353                {
1354
1355                    //this.selectTransitionLower.disable();
1356                    //this.selectTransitionUpper.disable();
1357                    //ajoute une classe à celle déjà existante de transitionUpperTitle
1358                    $("#transitionUpperTitle").addClass("notActiveText");
1359                    $("#transitionLowerTitle").addClass("notActiveText");
1360                }
1361                else
1362                {
1363                    //this.selectTransitionLower.enable();
1364                    //this.selectTransitionUpper.enable();
1365                    $("#transitionUpperTitle").removeClass("notActiveText");
1366                    $("#transitionLowerTitle").removeClass("notActiveText");
1367                }
1368
1369
1370                //On ne fait appel à la BDD des transitions    et si au plus 1 molécule est sélectionnée
1371                if (nbMolecules == 1 )
1372                {
1373//                    $.ajax( {
1374//                                url: "project?methodName=getTransitionByIsotopeName&isotopesSelectedName="+isotopesSelectedName+"&GeisaSelectedDatabase="+GeisaSelectedDatabase+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper,
1375//                                success:jQuery.proxy( this.handleRequestTransition, this )
1376//                            } );
1377
1378                    $.ajax( {
1379                                url: "project?methodName=getTransitionByIsotopeName&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+this.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper,
1380                                success:jQuery.proxy( this.handleRequestTransition, this )
1381                            } );
1382
1383                }
1384                else
1385                {
1386                    //pour réinitialiser le menu déroulant si aucune ou plusieurs molécules sont sélectionnées
1387                    document.getElementById("transition2").length=0;
1388                    //this.selectTransitionUpper.clear();
1389                    document.getElementById("transition1").length=0;
1390
1391                    if (nbMolecules == 0 )
1392                    {
1393                        //this.selectTransitionLower.add('-1', "Select a molecule");
1394                        this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} ));
1395                        //this.selectTransitionUpper.add('-1', "Select a molecule");
1396                        this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} ));
1397                        //pour forcer à afficher le premier élément (et non le premier élément précédent)
1398                        //this.selectTransitionLower.selectFirst();
1399                        //this.selectTransitionUpper.selectFirst();
1400                    }
1401
1402                    if (nbMolecules > 1 )
1403                    {
1404                        //this.selectTransitionLower.add('-1', "Select a molecule");
1405                        this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"", selected:"selected", disabled:"disabled"} ));
1406                        //this.selectTransitionUpper.add('-1', "Select a molecule");
1407                        this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"", selected:"selected", disabled:"disabled"} ));
1408                        //pour forcer à afficher le premier élément (et non le premier élément précédent)
1409                        //this.selectTransitionLower.selectFirst();
1410                        //this.selectTransitionUpper.selectFirst();
1411                    }
1412                }
1413            },
1414
1415
1416
1417
1418            //requête pour interrogation de la base de données des transitions en fonction d'une transition lower
1419            requestTransitionByTransitionLower: function()
1420            {
1421                var context  = this[0];
1422                //exemple transitionLower="                      000" : il y a 25 caractÚres dans chaque transition
1423                 context.transitionLower = this[1];
1424
1425                //Récupération de la Base Geisa sélectionnée
1426                var GeisaSelectedDatabase = context.selectDatabase.getValue();
1427
1428                //Récupération du spectral range
1429                var spectralRangeLower = $("#RangeLower").val();
1430                var spectralRangeUpper = $("#RangeUpper").val();
1431
1432                //Récupération des isotopes sélectionnés
1433                var inputs = document.getElementsByTagName( 'input' );
1434                var count = inputs.length;
1435                var isotopesSelectedNameArray = new Array();
1436                var i=0;
1437
1438                for( i = 0; i < count; i++ )
1439                {
1440                    var input = inputs.item( i );
1441                    //ne prendre que les isotopes sélectionnés dans la base de données sélectionnée  (rechercher des id du type :  "chk-ch3cn-GEISA-11")
1442                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(context.selectDatabase.getValue())!= -1)
1443                    {
1444                        var molN=input.value;
1445                        var molN1=molN.replace("_", ":");
1446                        //tous les isotopes sélectionnés sont placés dans un tableau
1447                        isotopesSelectedNameArray.push(molN1);
1448                    }
1449
1450                }
1451
1452                 //le passage de javascript Ã  java par ajax transforme les + en espace donc transformation des + en plus et dans le controller on fait l'inverse
1453                 var transitionLowerReplaced = context.transitionLower.replace(/\+/g,"plus");
1454
1455                //Appel Ã  la BDD
1456
1457                $.ajax( {
1458                            url: "project?methodName=getTransitionByIsotopeNameByTransitionLower&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+context.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper+"&transitionLower="+transitionLowerReplaced,
1459                            success:jQuery.proxy( context.handleRequestTransitionByTransitionLower, context)
1460                        } );
1461
1462
1463
1464            },
1465
1466
1467            //requête pour interrogation de la base de données des transitions en fonction d'une transition upper
1468            requestTransitionByTransitionUpper: function()
1469            {
1470                var context  = this[0];
1471                //exemple transitionLower="                      000" : il y a 25 caractÚres dans chaque transition
1472                 context.transitionUpper = this[1];
1473
1474                //Récupération de la Base Geisa sélectionnée
1475                var GeisaSelectedDatabase = context.selectDatabase.getValue();
1476
1477                //Récupération du spectral range
1478                var spectralRangeLower = $("#RangeLower").val();
1479                var spectralRangeUpper = $("#RangeUpper").val();
1480
1481                //Récupération des isotopes sélectionnés
1482                var inputs = document.getElementsByTagName( 'input' );
1483                var count = inputs.length;
1484                var isotopesSelectedNameArray = new Array();
1485                var i=0;
1486
1487                for( i = 0; i < count; i++ )
1488                {
1489                    var input = inputs.item( i );
1490                    //ne prendre que les isotopes sélectionnés dans la base de données sélectionnée  (rechercher des id du type :  "chk-ch3cn-GEISA-11")
1491                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(context.selectDatabase.getValue())!= -1)
1492                    {
1493                        var molN=input.value;
1494                        var molN1=molN.replace("_", ":");
1495                        //tous les isotopes sélectionnés sont placés dans un tableau
1496                        isotopesSelectedNameArray.push(molN1);
1497                    }
1498
1499                }
1500                //le passage de javascript Ã  java par ajax transforme les + en espace donc transformation des + en plus et dans le controller on fait l'inverse
1501                var transitionUpperReplaced = context.transitionUpper.replace(/\+/g,"plus");
1502
1503                //Appel Ã  la BDD
1504                $.ajax( {
1505                            url: "project?methodName=getTransitionByIsotopeNameByTransitionUpper&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+context.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper+"&transitionUpper="+transitionUpperReplaced,
1506                            success:jQuery.proxy( context.handleRequestTransitionByTransitionUpper, context)
1507                        } );
1508
1509
1510
1511            },
1512
1513
1514
1515//            requestTransition: function()
1516//            {
1517//                $.ajax( {
1518//                            url: "project?methodName=transition&transitionValue="+ this.selectTransitionUpper.getValue(),
1519//                            success:jQuery.proxy( this.handleRequestTransition, this )
1520//                        } );
1521//            },
1522
1523            // HANDLES ******************************************************** = retours ajax
1524            //affichage sur l'interface
1525
1526            handleGeisa: function( result )
1527            {
1528
1529
1530                //chemin de l'image
1531//                this.pathImg = jQuery.parseJSON( result ).pathImg;
1532                this.pathImg = "<%=Controller.PATH_IMAGES%>";
1533                //numéro unique pour le nom du graph
1534                this.nb = jQuery.parseJSON( result ).nb;
1535                //Pour tracer le bon nombre de graphe et de bouton download
1536                var i=1;
1537                var content = '';
1538                for (i=1; i<this.nbGraph+1; i++) {
1539                    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>';
1540                }
1541
1542                this.displayWindow(content);
1543            },
1544
1545
1546//            handleRequestTransition: function( result )
1547//            {
1548//                alert("youpi");
1549//            },
1550
1551
1552            handleRequestTransition: function( result )
1553            {
1554
1555
1556//                var transitions = jQuery.parseJSON( result ).transitions;
1557                 var transitionsLower = jQuery.parseJSON( result ).transitionsLower;
1558                 var transitionsUpper = jQuery.parseJSON( result ).transitionsUpper;
1559
1560                 //pour vider les menus déroulant des transitions précédentes
1561                 // this.selectTransitionLower.clear();
1562                document.getElementById("transition2").length=0;
1563                //this.selectTransitionUpper.clear();
1564                document.getElementById("transition1").length=0;
1565                // this.selectTransitionLower.add('transition', "Choose a transition");
1566                this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} ));
1567
1568                // this.selectTransitionUpper.add('transition', "Choose a transition");
1569                this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} ));
1570
1571                 //pour forcer à afficher le premier élément (et non le premier élément précédent)
1572                // this.selectTransitionLower.selectFirst();
1573                // this.selectTransitionUpper.selectFirst();
1574
1575                // alert ("transitionsUpper"+transitionsUpper);
1576                $.each(transitionsLower, jQuery.proxy( function(index, transitionsLower )
1577                {
1578                   //  this.selectTransitionLower.add(transitionsLower, transitionsLower,jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ]));
1579
1580
1581                    this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:transitionsLower, text:transitionsLower} ).bind( 'click', jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ])));
1582
1583                }, this));
1584
1585                $.each(transitionsUpper, jQuery.proxy( function(index, transitionsUpper )
1586                {
1587                    //this.selectTransitionUpper.add(transitionsUpper, transitionsUpper,jQuery.proxy(this.requestTransitionByTransitionUpper, [this, transitionsUpper ]));
1588                    this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:transitionsUpper, text:transitionsUpper} ).bind( 'click', jQuery.proxy(this.requestTransitionByTransitionUpper, [this, transitionsUpper ])));
1589
1590                }, this));
1591
1592            },
1593
1594            handleRequestTransitionByTransitionLower : function( result )
1595            {
1596                //alert("transitionLower"+this.transitionLower);
1597                var transitionsUpperBis = jQuery.parseJSON( result ).transitionsUpperBis;
1598                //alert("transitionsUpper"+transitionsUpper);
1599
1600                //pour vider les menus déroulant des transitions précédentes
1601               // this.selectTransitionLower.clear();
1602                document.getElementById("transition2").length=0;
1603                //this.selectTransitionUpper.clear();
1604                document.getElementById("transition1").length=0;
1605               // while(0 < document.getElementById("transition1").length)
1606               // {
1607               //     document.getElementById("transition1").options[0] = null;
1608               // }
1609
1610
1611                //this.selectTransitionLower.add(this.transitionLower, this.transitionLower);
1612                this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled"} ));
1613                this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:this.transitionLower, text:this.transitionLower,  selected:"selected"} ));
1614                //this.selectTransitionUpper.add('transition', "Choose a transition");
1615                //rajout du text "Choose a transition" selectionné en premier mais on ne peut pa cliquer dessus
1616                this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} ));
1617
1618
1619                //pour forcer Ã  afficher le premier Ã©lément (et non le premier Ã©lément précédent)
1620                //this.selectTransitionLower.selectFirst();
1621                //this.selectTransitionUpper.selectFirst();
1622
1623
1624
1625                $.each(transitionsUpperBis, jQuery.proxy( function(index, transitionsUpperBis )
1626                {
1627                   // this.selectTransitionUpper.add(transitionsUpper, transitionsUpper);
1628                     this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:transitionsUpperBis, text:transitionsUpperBis} ));
1629
1630                }, this));
1631
1632            },
1633
1634
1635            handleRequestTransitionByTransitionUpper : function( result )
1636            {
1637               // alert("transitionUpper"+this.transitionUpper);
1638                var transitionsLowerBis = jQuery.parseJSON( result ).transitionsLowerBis;
1639                //alert("transitionsLower"+transitionsLower);
1640
1641                //pour vider les menus déroulant des transitions précédentes
1642               // this.selectTransitionLower.clear();
1643                document.getElementById("transition2").length=0;
1644                //this.selectTransitionUpper.clear();
1645                document.getElementById("transition1").length=0;
1646
1647               // this.selectTransitionLower.add('transition', "Choose a transition");
1648                this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} ));
1649
1650               // this.selectTransitionUpper.add(this.transitionUpper, this.transitionUpper);
1651                this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled"} ));
1652                this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:this.transitionUpper, text:this.transitionUpper,  selected:"selected"} ));
1653
1654
1655                //pour forcer Ã  afficher le premier Ã©lément (et non le premier Ã©lément précédent)
1656                //this.selectTransitionLower.selectFirst();
1657                //this.selectTransitionUpper.selectFirst();
1658
1659
1660
1661                $.each(transitionsLowerBis, jQuery.proxy( function(index, transitionsLowerBis )
1662                {
1663                    //this.selectTransitionLower.add(transitionsLower, transitionsLower);
1664                    this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:transitionsLowerBis, text:transitionsLowerBis} ));
1665                }, this));
1666
1667            },
1668            // EVENTS ********************************************************
1669            //
1670
1671
1672
1673
1674            //affichage de la valeur du spectral range et affichage du bloc des molecules en fonction de la base de donnees selectionnee
1675            onClickSelectDatabase: function(value)
1676            {
1677
1678                if  ('GEISA2011' == value)
1679                {
1680                    document.getElementById('spectralRangeTitre').innerHTML = "";
1681                    document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range from 0 to 35877.030506 cm<sup>-1</sup> :";
1682                    $("#RangeLower").val(0);
1683                    $("#RangeUpper").val(35877.030506);
1684
1685                    document.getElementById( "BDD-GEISA2011" ).style.display = "";
1686                    document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none";
1687                    document.getElementById( "BDD-GEISA2003" ).style.display = "none";
1688                    document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none";
1689                }
1690
1691                if  ('GEISAIASI2011' == value)
1692                {
1693                    document.getElementById('spectralRangeTitre').innerHTML = "";
1694                    document.getElementById('spectralRangeTitre').innerHTML = "Choosing spectral range (599.000793 to 3000.998767 cm<sup>-1</sup>) :";
1695                    $("#RangeLower").val(599.000793);
1696                    $("#RangeUpper").val(3000.998767);
1697
1698                    document.getElementById( "BDD-GEISA2011" ).style.display = "none";
1699                    document.getElementById( "BDD-GEISAIASI2011" ).style.display = "";
1700                    document.getElementById( "BDD-GEISA2003" ).style.display = "none";
1701                    document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none";
1702                }
1703
1704                if  ('GEISA2003' == value)
1705                {
1706                    document.getElementById('spectralRangeTitre').innerHTML = "";
1707                    document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range from 0 to 35877.030506 cm<sup>-1</sup> :";
1708                    $("#RangeLower").val(0);
1709                    $("#RangeUpper").val(35877.030506);
1710
1711                    document.getElementById( "BDD-GEISA2011" ).style.display = "none";
1712                    document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none";
1713                    document.getElementById( "BDD-GEISA2003" ).style.display = "";
1714                    document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none";
1715                }
1716                if  ('GEISAIASI2003' == value)
1717                {
1718                    document.getElementById('spectralRangeTitre').innerHTML = "";
1719                    document.getElementById('spectralRangeTitre').innerHTML = "Choosing spectral range (599.000793 to 3000.998767 cm<sup>-1</sup>) :";
1720                    $("#RangeLower").val(599.000793);
1721                    $("#RangeUpper").val(3000.998767);
1722
1723                    document.getElementById( "BDD-GEISA2011" ).style.display = "none";
1724                    document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none";
1725                    document.getElementById( "BDD-GEISA2003" ).style.display = "none";
1726                    document.getElementById( "BDD-GEISAIASI2003" ).style.display = "";
1727                }
1728
1729                //mettre a jour le menu déroulant des transitions en fonction des isotopes sélectionnés, de la longueur d'onde et de la base geisa
1730                this.requestTransition();
1731            },
1732
1733
1734
1735            //Actions déclenchées quand on clique sur le nom d'une molécule
1736            cliquetout: function()
1737            {
1738                var context = this[0];
1739                // exemple :moleculeName = ch3ch
1740                var moleculeName = this[1];
1741                var bddVersion = this[2];
1742                var inputs = document.getElementsByTagName( 'input' );
1743                var count = inputs.length;
1744                for( i = 0; i < count; i++ )
1745                {
1746                    var  input = inputs.item( i );
1747                    //cliquer toutes les molécules et isotopes du meme nom dans toutes les bases
1748                    //if( input.type == 'checkbox' && ( input.id == ('chk-' + name + '-GEISA-11') || input.id == ('chk-' + name + '-GEISA-03') || input.id == ('chk-' + name + '-GEISA-IASI-11') || input.id == ('chk-' + name + '-GEISA-IASI-03')
1749                    // || input.id == (name + '-all-GEISA-03') || input.id == (name + '-all-GEISA-11') || input.id == (name + '-all-GEISA-IASI-03') || input.id == (name + '-all-GEISA-IASI-11')))
1750
1751                    if( input.type == 'checkbox' && ( input.id.indexOf('chk-' + moleculeName + '_') != -1 || input.id.indexOf('all-'+moleculeName+'-')!= -1 ))
1752
1753                    {
1754                        input.checked = document.getElementById( 'all-'+ moleculeName + '-' + bddVersion ).checked;
1755                    }
1756                }
1757                //mettre a jour le menu déroulant des transitions en fonction des isotopes sélectionnés, de la longueur d'onde et de la base geisa
1758                context.requestTransition();
1759            },
1760
1761            //actions déclenchées quand on clique sur un isotope
1762            cliqueIsotope: function()
1763            {
1764                var context = this[0];
1765                //exemple isotopeName = ch3cn_134
1766                var isotopeName = this[1];
1767                // exemple  moleculeName= ch3cn
1768                var moleculeName = this[2];
1769                var bddVersion = this[3];
1770                var inputs = document.getElementsByTagName( 'input' );
1771                var count = inputs.length;
1772                var i = 0;
1773                for( i = 0; i < count; i++ )
1774                {
1775                    input = inputs.item( i );
1776
1777                    //id=chk-ch3cn_234-GEISA2011
1778                    //cliquer ou decliquer le meme isotope dans toutes les bases
1779                    if( input.type == 'checkbox' &&  input.id.indexOf('chk-' + isotopeName) != -1)
1780                    {
1781                        input.checked = document.getElementById( 'chk-' + isotopeName + '-' + bddVersion ).checked;
1782
1783                    }
1784                     // id=all-ch3cn-GEISA2011
1785                    //pour décocher la case de la molecule quand on décoche un isotope
1786                   // if( input.type == 'checkbox' && input.id.indexOf('all-'+ moleculeName) != -1 && input.checked == true )
1787                    // {
1788                    //     input.checked = false;
1789                    // }
1790                }
1791
1792
1793                //pour cocher molecule quand on clique sur un isotope et décocher molécule quand tous les isotopes de la molécule sont décochés
1794                var nbIsotopeSelected=0;
1795
1796                for( i = 0; i < count; i++ )
1797                {
1798                    input = inputs.item( i );
1799                    if( input.type == 'checkbox' &&  input.id.indexOf('chk-'+moleculeName+'_') != -1  && input.id.indexOf(bddVersion) != -1 && input.checked == true )
1800                    {
1801                     nbIsotopeSelected=nbIsotopeSelected+1;
1802                    }
1803
1804                }
1805
1806
1807                for( i = 0; i < count; i++ )
1808                {
1809                    input = inputs.item( i );
1810                    if (input.type == 'checkbox' && input.id.indexOf('all-'+ moleculeName+'-') != -1 && nbIsotopeSelected == 0)
1811                    {
1812                        input.checked = false;
1813                    }
1814
1815                     if (input.type == 'checkbox' && input.id.indexOf('all-'+ moleculeName+'-') != -1 && nbIsotopeSelected > 0)
1816                    {
1817                        input.checked = true;
1818                    }
1819
1820                }
1821
1822                // alert("database"+context.selectDatabase.getSize());
1823
1824                //mettre a jour le menu déroulant des transitions en fonction des isotopes sélectionnés, de la longueur d'onde et de la base geisa
1825                context.requestTransition();
1826
1827            },
1828
1829
1830
1831            //pour cacher ou voir les isotopes d'une molecule
1832            visibilite: function(  )
1833            {
1834                var context = this[0];
1835                var thingId = this[1];
1836                var divs = document.getElementsByTagName( 'div' );
1837                var count = divs.length;
1838                var i = 0;
1839                for( i = 0; i < count; i++ )
1840                {
1841                    var div = divs.item( i );
1842
1843
1844                    if  (  div.id ==   thingId)
1845                    {
1846                        if( div.style.display == "none" )
1847                        {
1848                            div.style.display = "";
1849                        }
1850                        else
1851                        {
1852                            div.style.display = "none";
1853                        }
1854                    }
1855                }
1856            },
1857
1858             //Faire apparatre ou disparaitre le bloc "advanced options" quand on clique sur le lien "show advanced options"
1859             onClickShowAdvancedOptions: function()
1860            {
1861                //document.getElementById( "advancedOptions" ).style.display = "none";
1862                  if( document.getElementById( "advancedOptions" ).style.display == "none" )
1863                        {
1864                            document.getElementById( "advancedOptions" ).style.display = "";
1865                            document.getElementById( "aShowHide" ).innerHTML = "";
1866                            document.getElementById( "aShowHide" ).innerHTML = "Hide advanced options";
1867                        }
1868                        else
1869                        {
1870                            document.getElementById( "advancedOptions" ).style.display = "none";
1871                            document.getElementById( "aShowHide" ).innerHTML = "";
1872                            document.getElementById( "aShowHide" ).innerHTML = "Show advanced options";
1873                        }
1874            },
1875
1876
1877
1878            onBlurInputMeanValue: function()
1879            {
1880                //si step est sup a 0,   ajout d'une ligne Z aux parametres Y1 et y2  si elle n'est pas déjà présente
1881                // !this.selectTraceAxeY1.content('Z') indique que "Z" n'exite pas dans le menu déroulant  selectTraceAxeY1
1882                if  ($("#meanValue2").val() > 0 && !this.selectTraceAxeY1.content('Z'))
1883
1884                {
1885
1886                    this.selectTraceAxeY1.add( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
1887                    this.selectTraceAxeY2.add( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
1888                }
1889                //si step = a 0     et autres valeurs (a faire) , retrait de la ligne Z aux parametres Y1 et y2
1890                if  ($("#meanValue2").val() == 0)
1891                {
1892                    this.selectTraceAxeY1.remove( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
1893                    this.selectTraceAxeY2.remove( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
1894                    //Selection par defaut du 1er element (pour que  "Number of lines"  ne soit plus selectionne par defaut si il n'existe plus)
1895                    this.selectTraceAxeY1.selectFirst();
1896                    this.selectTraceAxeY2.selectFirst();
1897                }
1898            },
1899
1900            onClickSelectNbCourbes: function(value)
1901            {
1902              var context  = this[0];
1903              var optionVal = this[1];
1904
1905               //si plusieurs courbes choisis pour les isotopes et ou molecules, les choix pour Y2 sont inactifs
1906                //if  ('cm' == value || 'ci' == value)
1907                if  ('cm' == optionVal || 'ci' == optionVal)
1908                {
1909                    //transformer le texte en gris
1910                    document.getElementById("axeY2Titre").className = "notActiveText";
1911                    document.getElementById("scaleY2Titre").className = "notActiveText";
1912                    document.getElementById("typePlotY2Titre").className = "notActiveText";
1913                    //pour rendre le menu déroulant inactif
1914                    this.selectTraceAxeY2.disable();
1915                    this.selectScaleY2.disable();
1916                    this.selectTypeTraceY2.disable();
1917                }
1918                //si une seule courbe choisie pour les isotopes et ou molecules, les choix pour Y2 sont actifs
1919                //if  ('ca' == value || 'gm' == value || 'gi' == value)
1920                if  ('ca' == optionVal || 'gm' == optionVal || 'gi' == optionVal)
1921                {
1922                    //remet le texte en couleur active
1923                    document.getElementById("axeY2Titre").className = "activeText";
1924                    //rendre actif l'echelle que si l'intensite est choisie dans les parametres
1925                    if (this.selectTraceAxeY2.getValue() == 'B')
1926                    {
1927                        document.getElementById("scaleY2Titre").className = "activeText";
1928                    }
1929                    //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie
1930                    if (this.selectTraceAxeY2.getValue() != 'no')
1931                    {
1932                        document.getElementById("typePlotY2Titre").className = "activeText";
1933                    }
1934                    //pour rendre les menu déroulant actifs
1935                    this.selectTraceAxeY2.enable();
1936                    //rendre actif l'echelle que si l'intensite est choisie dans les parametres
1937                    if (this.selectTraceAxeY2.getValue() == 'B')
1938                    {
1939                        this.selectScaleY2.enable();
1940                    }
1941                    //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie
1942                    if (this.selectTraceAxeY2.getValue() != 'no')
1943                    {
1944                        this.selectTypeTraceY2.enable();
1945                    }
1946                }
1947
1948
1949            },
1950
1951
1952            onClickSelectTraceAxeY1: function(value)
1953            {
1954                //si intensite n'est pas choisi pour Y1, le type d'échelle est inactif
1955                if  (this.selectTraceAxeY1.getValue() != 'B')
1956                {
1957                    //transformer le texte en gris
1958                    document.getElementById("scaleY1Titre").className = "notActiveText";
1959                    //pour rendre le menu déroulant inactif
1960                   // this.selectScaleY1.disable();
1961                    document.getElementById("SelectScaleY1" ).disabled=true;
1962                }
1963                //si intensite est  choisi pour Y1, le type d'échelle est actif
1964                if  (this.selectTraceAxeY1.getValue() == 'B')
1965                {
1966                    //transformer le texte en gris
1967                    document.getElementById("scaleY1Titre").className = "activeText";
1968                    //pour rendre le menu déroulant inactif
1969                   // this.selectScaleY1.enable();
1970                    document.getElementById("SelectScaleY1" ).disabled=false;
1971                }
1972            },
1973
1974            onClickSelectTraceAxeY2: function(value)
1975            {
1976                //si intensite n'est pas choisi pour Y2, le type d'échelle est inactif
1977                if  (this.selectTraceAxeY2.getValue() != 'B')
1978                {
1979                    //transformer le texte en gris
1980                    document.getElementById("scaleY2Titre").className = "notActiveText";
1981                    //pour rendre le menu déroulant inactif
1982                    this.selectScaleY2.disable();
1983                }
1984                //si intensite est  choisi pour Y2, le type d'échelle est actif
1985                if  (this.selectTraceAxeY2.getValue() == 'B')
1986                {
1987                    //transformer le texte en gris
1988                    document.getElementById("scaleY2Titre").className = "activeText";
1989                    //pour rendre le menu déroulant inactif
1990                    this.selectScaleY2.enable();
1991                }
1992                //si aucun parametre est  choisi pour Y2, le type de plot est inactif
1993                if  (this.selectTraceAxeY2.getValue() == 'no')
1994                {
1995                    //transformer le texte en gris
1996                    document.getElementById("typePlotY2Titre").className = "notActiveText";
1997                    //pour rendre le menu déroulant inactif
1998                    this.selectTypeTraceY2.disable();
1999                }
2000                //si un parametre est  choisi pour Y2, le type de plot est actif
2001                if  (this.selectTraceAxeY2.getValue() != 'no')
2002                {
2003                    //transformer le texte en gris
2004                    document.getElementById("typePlotY2Titre").className = "activeText";
2005                    //pour rendre le menu déroulant inactif
2006                    this.selectTypeTraceY2.enable();
2007                }
2008
2009            },
2010
2011            onClickSubmit: function()
2012            {
2013                this.requestGeisa();
2014            },
2015
2016            displayWindow: function(content)
2017            {
2018                //fermeture de la div de l'image d'attente
2019                this.loadingGraphics.hide();
2020
2021                // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName='  + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>';
2022
2023                //alert(content);
2024                var $dialog = $( '<div></div>' )
2025
2026                        .html( content )
2027
2028                        .dialog( {
2029                            autoOpen: false,
2030                            title: "GEISA : spectroscopic database",
2031                            //minHeight: 500,
2032                            // minWidth: 660,
2033                            height: 560,
2034                            width:700,
2035                            //Exemple de  valeurs possible pour position : "middle", "top",  [200, 100]
2036                            position: "middle"
2037
2038                        } );
2039                $dialog.dialog( 'open' )
2040            },
2041
2042            // displayWindow: function(coordinate)
2043            //{
2044            //var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=bib.txt"><button class="dataProtocolDownloadButton">Download</button></a>';
2045            // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName='  + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>';
2046
2047            //alert(content);
2048            // var $dialog = $( '<div></div>' )
2049            // .html( content + content1 )
2050
2051            // .dialog( {
2052            //    autoOpen: false,
2053            //    title: "GEISA : spectroscopic database",
2054            //    minHeight: 500,
2055            //    minWidth: 660,
2056
2057            //coordonnee y y
2058            //   position:coordinate
2059
2060            // } );
2061            // $dialog.dialog( 'open' )
2062            //},
2063
2064
2065            onClickDownload: function()
2066            {
2067                document.location.href = "project?methodName=downloadFile&fileName=bib.txt";
2068            }
2069
2070
2071        } );
2072
2073
2074</script>
2075
2076
2077
Note: See TracBrowser for help on using the repository browser.