Ignore:
Timestamp:
07/17/12 16:37:48 (12 years ago)
Author:
npipsl
Message:

Mise en place 2 couches

  • hibernate
  • service
File:
1 edited

Legend:

Unmodified
Added
Removed
  • geisa/web/initGeisa_script.jsp

    r532 r533  
    66//permet de deselectionner la molecule quand on deselectionne un isotope (toutes les options sauf lst) 
    77/*function decliquemol( name ) 
    8 { 
    9  
    10     var inputs = document.getElementsByTagName( 'input' ); 
    11     var count = inputs.length; 
    12     for( i = 0; i < count; i++ ) 
    13     { 
    14         input = inputs.item( i ); 
    15         if( input.type == 'checkbox' && input.id == (name + '-all') && input.checked == true ) 
    16         { 
    17             input.checked = false; 
    18         } 
    19     } 
    20 } */ 
     8 { 
     9 
     10 var inputs = document.getElementsByTagName( 'input' ); 
     11 var count = inputs.length; 
     12 for( i = 0; i < count; i++ ) 
     13 { 
     14 input = inputs.item( i ); 
     15 if( input.type == 'checkbox' && input.id == (name + '-all') && input.checked == true ) 
     16 { 
     17 input.checked = false; 
     18 } 
     19 } 
     20 } */ 
    2121 
    2222 
     
    509509                paramSelectTransitionUpper.parent = $("#transitionUpper"); 
    510510                this.selectTransitionUpper = new Select( paramSelectTransitionUpper ); 
    511                 this.selectTransitionUpper.add( 'transi1', "transi1" ); 
    512                 this.selectTransitionUpper.add( 'transi2', "transi2" ); 
     511                this.selectTransitionUpper.add( 'transi1', "transi1", jQuery.proxy(this.onClickSelectTransition, this) ); 
     512                this.selectTransitionUpper.add( 'transi2', "transi2", jQuery.proxy(this.onClickSelectTransition, this) ); 
    513513                this.selectTransitionUpper.selectFirst( false ); 
    514514                // Create menu deroulant  transition lower 
     
    686686             * @param moleculesArray 
    687687             */ 
    688             //createMolecules: function(container, moleculesArray) 
     688                //createMolecules: function(container, moleculesArray) 
    689689            createMolecules: function(container, moleculesArray, BddVersion) 
    690690            { 
    691691                var table = $(document.createElement("table")); 
    692692                container.append(table); 
    693                // var tr = $(document.createElement("tr")); 
    694                // tr.attr({valign: "top"}); 
    695                // table.append(tr); 
     693                // var tr = $(document.createElement("tr")); 
     694                // tr.attr({valign: "top"}); 
     695                // table.append(tr); 
    696696                var i=0; 
    697697                //nombre de molecules par ligne 
     
    699699                //taille du tableau 
    700700                //alert("l" +moleculesArray.length); 
    701                // parseInt : partie entiÚre 
    702                // var res =  parseInt(8/3); 
     701                // parseInt : partie entiÚre 
     702                // var res =  parseInt(8/3); 
    703703                //alert("res="+res); 
    704704 
     
    787787                // var parameters = "&valselectTraceAxeY1="+this.selectTraceAxeY1.getValue()+"&valselectTraceAxeY2="+this.selectTraceAxeY2.getValue()+ 
    788788                //        "&inputSpectralRangeLower="+$("#spectralRangeLower").val()+ "&inputSpectralRangeUpper="+$("#spectralRangeUpper").val()+ 
    789                  //      "&inputIntensityLower="+$("#intensityLower").val()+"&inputIntensityUpper="+$("#intensityUpper").val()+ 
    790                  //       "&valselectTypeTraceY1="+this.selectTypeTraceY1.getValue(); 
     789                //      "&inputIntensityLower="+$("#intensityLower").val()+"&inputIntensityUpper="+$("#intensityUpper").val()+ 
     790                //       "&valselectTypeTraceY1="+this.selectTypeTraceY1.getValue(); 
    791791 
    792792                //molécules 
     
    915915 
    916916                //Valeur de mean value (a faire test sur la valeur à ne prendre que si val >=0 sinon afficher message) 
    917                     var meanValue = "EEE-stepEEE"+$("#meanValue2").val(); 
     917                var meanValue = "EEE-stepEEE"+$("#meanValue2").val(); 
    918918 
    919919 
     
    938938                //construction de la requête Fortran 
    939939                var parameters2 = "&fortranRequest="+paramBase+"EEE"+molName+"EEE-wavenb_minEEE"+$("#RangeLower").val()+"EEE-wavenb_maxEEE"+$("#RangeUpper").val()+"EEE-int_minEEE"+$("#intensityLo").val()+"EEE-int_maxEEE"+$("#intensityUp").val()+ 
    940                                    meanValue+nbCourbes+"EEE-fieldEEE"+this.selectTraceAxeY1.getValue()+"EEE"+logScale+"EEE-line_typeEEE"+this.selectTypeTraceY1.getValue()+"EEE"+field2+"EEE"+logScale2+"EEE"+lineType; 
     940                        meanValue+nbCourbes+"EEE-fieldEEE"+this.selectTraceAxeY1.getValue()+"EEE"+logScale+"EEE-line_typeEEE"+this.selectTypeTraceY1.getValue()+"EEE"+field2+"EEE"+logScale2+"EEE"+lineType; 
    941941 
    942942                alert(parameters2); 
     
    948948            }, 
    949949 
    950  // HANDLES ******************************************************** = retours ajax 
     950            requestIsotope: function(isotopeName) 
     951            { 
     952                $.ajax( { 
     953                            url: "project?methodName=getTransitionByIsotopeName&isotopeName="+isotopeName, 
     954                            success:jQuery.proxy( this.handleRequestIsotope, this ) 
     955                        } ); 
     956            }, 
     957 
     958            requestTransition: function() 
     959            { 
     960                $.ajax( { 
     961                            url: "project?methodName=transition&transitionValue="+ this.selectTransitionUpper.getValue(), 
     962                            success:jQuery.proxy( this.handleRequestTransition, this ) 
     963                        } ); 
     964            }, 
     965 
     966            // HANDLES ******************************************************** = retours ajax 
    951967 
    952968 
     
    962978                //numéro unique pour le nom du graph 
    963979                this.nb = jQuery.parseJSON( result ).nb; 
    964                  //alert("this.nb="+this.nb); 
     980                //alert("this.nb="+this.nb); 
    965981                //nom de l'image 
    966982                //this.nameImg = jQuery.parseJSON( result ).nameImg; 
     
    969985                var i=1; 
    970986                var content = ''; 
    971                     for (i=1; i<this.nbGraph+1; i++) { 
    972                         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>'; 
    973                     } 
    974  
    975  
    976                //to do 
    977                // if( !this.pathImg ) 
    978                //     setTimeout( jQuery.proxy( this.displayWindow, this ), 1000 ); 
    979                // else 
    980                    this.displayWindow(content); 
    981  
    982               // window.setTimeout(function() { 
    983                //      alert("Hello World!"); 
    984                //     jQuery.proxy( this.displayWindow(content), this ); 
    985                //  }, 2000); 
    986  
    987             }, 
    988  
    989  // EVENTS ******************************************************** 
     987                for (i=1; i<this.nbGraph+1; i++) { 
     988                    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>'; 
     989                } 
     990 
     991 
     992                //to do 
     993                // if( !this.pathImg ) 
     994                //     setTimeout( jQuery.proxy( this.displayWindow, this ), 1000 ); 
     995                // else 
     996                this.displayWindow(content); 
     997 
     998                // window.setTimeout(function() { 
     999                //      alert("Hello World!"); 
     1000                //     jQuery.proxy( this.displayWindow(content), this ); 
     1001                //  }, 2000); 
     1002 
     1003            }, 
     1004 
     1005            handleRequestTransition: function( result ) 
     1006            { 
     1007                alert("youpi"); 
     1008            }, 
     1009 
     1010            handleRequestIsotope: function( result ) 
     1011            { 
     1012                var isotopes = jQuery.parseJSON( result ).isotopes; 
     1013                $.each(isotopes, jQuery.proxy( function(index, isotope ) 
     1014                { 
     1015                    alert(isotope.codeQuantLower); 
     1016                })); 
     1017 
     1018            }, 
     1019 
     1020            // EVENTS ******************************************************** 
    9901021 
    9911022 
     
    10261057            }, 
    10271058 
     1059            onClickSelectTransition: function() 
     1060            { 
     1061                this.requestTransition(); 
     1062            }, 
    10281063 
    10291064            //cliquer toutes les molécules et isotopes du meme nom dans toutes les bases 
     
    10381073                for( i = 0; i < count; i++ ) 
    10391074                { 
    1040                    var  input = inputs.item( i ); 
     1075                    var  input = inputs.item( i ); 
    10411076                    //cliquer toutes les molécules et isotopes du meme nom dans toutes les bases 
    10421077                    //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') 
    1043                                                   // || 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'))) 
     1078                    // || 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'))) 
    10441079 
    10451080                    if( input.type == 'checkbox' && ( input.id.indexOf('chk-' + moleculeName + '_') != -1 || input.id.indexOf('all-'+moleculeName+'-')!= -1 )) 
     
    10701105                    } 
    10711106                } 
     1107 
     1108                context.requestIsotope("ho2:166"); 
    10721109            }, 
    10731110 
     
    11021139                for( i = 0; i < count; i++ ) 
    11031140                { 
    1104                    var div = divs.item( i ); 
     1141                    var div = divs.item( i ); 
    11051142 
    11061143 
     
    12261263                    this.selectScaleY2.enable(); 
    12271264                } 
    1228                //si aucun parametre est  choisi pour Y2, le type de plot est inactif 
     1265                //si aucun parametre est  choisi pour Y2, le type de plot est inactif 
    12291266                if  (this.selectTraceAxeY2.getValue() == 'no') 
    12301267                { 
     
    12451282            }, 
    12461283 
    1247               onClickSubmit: function() 
     1284            onClickSubmit: function() 
    12481285            { 
    12491286                this.requestGeisa(); 
     
    12751312            // displayWindow: function(coordinate) 
    12761313            //{ 
    1277                 //var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=bib.txt"><button class="dataProtocolDownloadButton">Download</button></a>'; 
    1278                // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName='  + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>'; 
    1279  
    1280                 //alert(content); 
    1281                // var $dialog = $( '<div></div>' ) 
    1282                        // .html( content + content1 ) 
    1283  
    1284                        // .dialog( { 
    1285                         //    autoOpen: false, 
    1286                         //    title: "GEISA : spectroscopic database", 
    1287                         //    minHeight: 500, 
    1288                         //    minWidth: 660, 
    1289  
    1290                             //coordonnee y y 
    1291                          //   position:coordinate 
    1292  
    1293                        // } ); 
    1294                // $dialog.dialog( 'open' ) 
     1314            //var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=bib.txt"><button class="dataProtocolDownloadButton">Download</button></a>'; 
     1315            // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName='  + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>'; 
     1316 
     1317            //alert(content); 
     1318            // var $dialog = $( '<div></div>' ) 
     1319            // .html( content + content1 ) 
     1320 
     1321            // .dialog( { 
     1322            //    autoOpen: false, 
     1323            //    title: "GEISA : spectroscopic database", 
     1324            //    minHeight: 500, 
     1325            //    minWidth: 660, 
     1326 
     1327            //coordonnee y y 
     1328            //   position:coordinate 
     1329 
     1330            // } ); 
     1331            // $dialog.dialog( 'open' ) 
    12951332            //}, 
    12961333 
    12971334 
    1298               onClickDownload: function() 
     1335            onClickDownload: function() 
    12991336            { 
    13001337                document.location.href = "project?methodName=downloadFile&fileName=bib.txt"; 
Note: See TracChangeset for help on using the changeset viewer.