Changeset 526 for geisa/web/initGeisa_script.jsp
- Timestamp:
- 06/15/12 12:07:46 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
geisa/web/initGeisa_script.jsp
r525 r526 550 550 paramNbCourbes.parent = $("#NbCourbes"); 551 551 this.SelectNbCourbes = new Select( paramNbCourbes ); 552 this.SelectNbCourbes.add( 'ca', "One curve for all selection", jQuery.proxy(this.onClickSelectNbCourbes, this ) );552 this.SelectNbCourbes.add( 'ca', "One curve for all selection", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 553 553 this.SelectNbCourbes.add( 'cm', "One curve for each molecule selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 554 554 this.SelectNbCourbes.add( 'ci', "One curve for each isotopologue selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 555 this.SelectNbCourbes.add( 'gm', "One graph efor each molecule selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) );556 this.SelectNbCourbes.add( 'gi', "One graph efor each isotopologue selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) );555 this.SelectNbCourbes.add( 'gm', "One graph for each molecule selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 556 this.SelectNbCourbes.add( 'gi', "One graph for each isotopologue selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 557 557 this.SelectNbCourbes.selectFirst( false ); 558 558 … … 727 727 a.html("<b>"+moleculeElement.name+"</b>"); 728 728 729 //a.bind( 'click', this, jQuery.proxy( this.visibilite, [this,"Cache-"+ moleculeElement.id+"-"+BddVersion] ));730 729 a.bind( 'click', this, jQuery.proxy( this.visibilite, [this,"Cache-"+ moleculeElement.id] )); 731 730 span.append(a); … … 733 732 var div= $(document.createElement("div")); 734 733 div.addClass("divViolet"); 735 //div.attr({id:"Cache-"+moleculeElement.id+"-"+BddVersion, style: "display:none"}); 736 div.attr({id:"Cache-"+moleculeElement.id, style: "display:none"}); 734 div.attr({id:"Cache-"+moleculeElement.id, style: "display:none"}); 737 735 td.append(div); 738 736 … … 761 759 inputIsotopes.attr({type:"checkbox", id:"chk-"+moleculeElement+"_"+isotopeElement+"-"+BddVersion, name:"moles", value:moleculeElement+"_"+isotopeElement}); 762 760 inputIsotopes.bind( 'click', this, jQuery.proxy( this.cliqueIsotope, [this, moleculeElement+"_"+isotopeElement, BddVersion ] )); 763 //inputIsotopes.bind( 'click', this, jQuery.proxy( this.decliquemol(moleculeElement), [this, moleculeElement.id] ));764 761 container.append(inputIsotopes); 765 762 container.append(isotopeElement); … … 772 769 // <table><tr><td> 773 770 // <span class="molecule"><input type=checkbox id=all-ch3cn-GEISA-11 onclick="cliquetout('this, ch3cn, GEISA-11');"> 774 // <a href="javascript:visibilite('this, Cache-ch3cn -GEISA-11');"><B>CH<sub>3</sub>CN</a></B>771 // <a href="javascript:visibilite('this, Cache-ch3cn');"><B>CH<sub>3</sub>CN</a></B> 775 772 // </span> 776 // <div class="divViolet" id="Cache-ch3cn -GEISA-11" style="display:none;">773 // <div class="divViolet" id="Cache-ch3cn" style="display:none;"> 777 774 // <span class="isotope" id="ch3cnIsotopeGEISA-11"> <input type=checkbox id=chk-ch3cn_234-GEISA-11 name=moles value=ch3cn_234 onclick="cliqueIsotope('this, ch3cn_234, GEISA-11');">234<br></span> 778 775 // </div> … … 782 779 requestGeisa: function() 783 780 { 784 // alert(this.selectTypeTrace.getValue()); 785 // alert(this.selectTraceAxeY.getValue()); 786 //alert(valSelect); 781 787 782 // var parameters = "check1="+$("#chk-h2o_Bob").attr('checked')+"&check2="+$("#chk-h2o_Bob").val()+"&valselectTypeTrace="+this.selectTypeTrace.getValue()+"&valselectTraceAxeY="+this.selectTraceAxeY.getValue(); 788 783 var parameters = "&valselectTraceAxeY1="+this.selectTraceAxeY1.getValue()+"&valselectTraceAxeY2="+this.selectTraceAxeY2.getValue()+ … … 803 798 var molName =""; 804 799 alert(this.selectDatabase.getValue()); 805 800 var i=0; 801 this.nbIsotopes = 0; 802 this.nbMolecules = 0; 806 803 for( i = 0; i < count; i++ ) 807 804 { 808 input = inputs.item( i );805 var input = inputs.item( i ); 809 806 //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") 810 807 if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1) 811 808 { 809 //nombre d'isotopes sélectionnés 810 this.nbIsotopes = this.nbIsotopes + 1; 811 812 812 var molN=input.value; 813 813 var molN1=molN.replace("_", ":"); 814 molName = molName+"-moleisotEEE"+molN1+".EEE"; 814 // exemple : -moleisotEEEh2o:161EEE-moleisotEEEh2o:162EEE-moleisotEEEco2:626EEE-moleisotEEEco2:627EEE-moleisotEEEo3:666EEE-moleisotEEEo3:668 815 molName = molName+"-moleisotEEE"+molN1+"EEE"; 815 816 } 816 } 817 818 //remplacement de "_" par ":" 819 //alert(molN); 820 821 //alert(molN1); 822 //var molName = "-moleisotEEEh2o:161,162.EEE-moleisotEEEco2:626,627.EEE-moleisotEEE"+molN1+"."; 823 // alert(molName); 824 825 //sélection du type d'échelle pour le parametre Y1 826 if (this.selectScaleY1.getValue() == '-log_scale' ) 817 //récupération du nombre de molécules sélectionnées 818 if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("all-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1) 819 { 820 //nombre d'isotopes sélectionnés 821 this.nbMolecules = this.nbMolecules + 1; 822 } 823 } 824 825 826 827 //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) 828 if (this.selectScaleY1.getValue() == '-log_scale' && this.selectScaleY1.isDisable == false) 827 829 { 828 830 var logScale = this.selectScaleY1.getValue(); … … 833 835 } 834 836 835 //sélection 1 courbe ou 1 courbe par mol/iso 836 if (this.SelectNbCourbes.getValue() == 'mc' ) 837 { 838 var nbCourbes = "EEE-separate_molEEE-same_graphEEE"; 837 //sélection du nombre de courbes ou de graphs 838 839 var nbCourbes = ""; 840 switch (this.SelectNbCourbes.getValue()) { 841 case 'cm': 842 nbCourbes = "EEE-separate_molEEE-same_graphEEE"; 843 this.nbGraph = 1; 844 this.nbCourbe = this.nbMolecules; 845 if (this.nbCourbe > 8) {alert("Too much molecules selected to draw one curve for each molecule selected");} 846 break; 847 case 'ci': 848 nbCourbes = "EEE-separate_isoEEE-same_graphEEE"; 849 this.nbGraph = 1; 850 this.nbCourbe = this.nbIsotopes; 851 if (this.nbCourbe > 8) {alert("Too much isotopologues selected to draw one curve for each isotopologues selected");} 852 break; 853 case 'gm': 854 nbCourbes = "EEE-separate_molEEE"; 855 this.nbGraph = this.nbMolecules; 856 if (this.nbGraph > 20) {alert("Too much molecules selected to draw one graph for each molecules selected");} 857 break; 858 case 'gi': 859 nbCourbes = "EEE-separate_isoEEE"; 860 this.nbGraph = this.nbIsotopes; 861 if (this.nbGraph > 20) {alert("Too much isotopologues selected to draw one graph for each isotopologues selected");} 862 break; 863 default: 864 nbCourbes = ""; 865 this.nbGraph = 1; 866 break; 867 } 868 869 870 //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) 871 if (this.selectTraceAxeY2.getValue() == 'no' || this.selectTraceAxeY2.isDisable == true) 872 { 873 var field2 = ""; 839 874 } 840 875 else 841 876 { 842 var nbCourbes = ""; 843 } 844 845 846 //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 visible) 847 if (this.selectTraceAxeY2.getValue() == 'no' || document.getElementById( "axeY2" ).style.display == "none") 848 { 849 var field2 = ""; 877 var field2 = "-field2EEE"+this.selectTraceAxeY2.getValue(); 878 } 879 880 //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) 881 if (this.selectScaleY2.getValue() == '-log_scale2' && this.selectScaleY2.isDisable == false) 882 { 883 var logScale2 =this.selectScaleY2.getValue(); 850 884 } 851 885 else 852 886 { 853 var field2 = "-field2EEE"+this.selectTraceAxeY2.getValue(); 854 } 855 856 //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 visible) 857 if (this.selectScaleY2.getValue() == '-log_scale2' && document.getElementById( "typeScaleY2" ).style.display == "") 858 { 859 var logScale2 =this.selectScaleY2.getValue(); 887 var logScale2 = ""; 888 } 889 890 891 //sélection du type de tracé pour Y2 (pas de valeur si l'option n'est pas activée) 892 if ( this.selectTypeTraceY2.isDisable == true) 893 { 894 var lineType = ""; 860 895 } 861 896 else 862 897 { 863 var logScale2 = ""; 864 } 865 866 //on ne prend la valeur de mean value que si l'option est visible 867 if ( document.getElementById( "meanValue" ).style.display == "") 868 { 898 var lineType = "-line_type2EEE"+this.selectTypeTraceY2.getValue(); 899 } 900 901 //Valeur de mean value (a faire test sur la valeur à ne prendre que si val >=0 sinon afficher message) 869 902 var meanValue = "EEE-stepEEE"+$("#meanValue2").val(); 870 } 871 else 872 { 873 var meanValue = "" 874 } 903 875 904 876 905 … … 880 909 881 910 882 var parameters2 = "&fortranRequest=-fieldEEE"+this.selectTraceAxeY1.getValue()+"EEE"+logScale+"EEE"+field2+"EEE"+logScale2+"EEE"+"EEE-wavenb_minEEE"+$("#RangeLower").val()+ 883 "EEE-wavenb_maxEEE"+$("#RangeUpper").val()+"EEE-int_minEEE"+$("#intensityLo").val()+"EEE-int_maxEEE"+$("#intensityUp").val()+"EEE-line_typeEEE"+this.selectTypeTraceY1.getValue()+"EEE"+molName+meanValue+nbCourbes; 884 911 //var parameters2 = "&fortranRequest=-fieldEEE"+this.selectTraceAxeY1.getValue()+"EEE"+logScale+"EEE"+field2+"EEE"+logScale2+"EEE"+"EEE-wavenb_minEEE"+$("#RangeLower").val()+ 912 // "EEE-wavenb_maxEEE"+$("#RangeUpper").val()+"EEE-int_minEEE"+$("#intensityLo").val()+"EEE-int_maxEEE"+$("#intensityUp").val()+"EEE-line_typeEEE"+this.selectTypeTraceY1.getValue()+"EEE"+molName+meanValue+nbCourbes; 913 914 var parameters2 = "&fortranRequest="+molName+"EEE-wavenb_minEEE"+$("#RangeLower").val()+"EEE-wavenb_maxEEE"+$("#RangeUpper").val()+"EEE-int_minEEE"+$("#intensityLo").val()+"EEE-int_maxEEE"+$("#intensityUp").val()+ 915 meanValue+nbCourbes+"EEE-fieldEEE"+this.selectTraceAxeY1.getValue()+"EEE"+logScale+"EEE-line_typeEEE"+this.selectTypeTraceY1.getValue()+"EEE"+field2+"EEE"+logScale2+"EEE"+lineType; 885 916 886 917 alert(parameters2); … … 893 924 894 925 // HANDLES ******************************************************** = retours ajax 926 927 895 928 handleGeisa: function( result ) 896 929 { 897 930 // var bob = jQuery.parseJSON( result ).resultAjax; 898 //chemin de l'image avec le nom931 //chemin de l'image 899 932 this.pathImg = jQuery.parseJSON( result ).pathImg; 900 alert(this.pathImg); 933 //alert("this.pathImg="+this.pathImg); 934 //numéro unique pour le nom du graph 935 this.nb = jQuery.parseJSON( result ).nb; 936 alert("this.nb="+this.nb); 901 937 //nom de l'image 902 this.nameImg = jQuery.parseJSON( result ).nameImg; 903 alert(this.nameImg); 904 905 //to do 938 //this.nameImg = jQuery.parseJSON( result ).nameImg; 939 940 941 942 var coordinate = [200, 100]; 943 944 //Pour tracer le bon nombre de graphe et de bouton download 945 var i=1; 946 var content = ''; 947 for (i=1; i<this.nbGraph+1; i++) { 948 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>'; 949 } 950 951 952 //to do 906 953 if( !this.pathImg ) 907 954 setTimeout( jQuery.proxy( this.displayWindow, this ), 1000 ); 908 955 else 909 this.displayWindow(); 956 this.displayWindow(coordinate,content); 957 910 958 }, 911 959 … … 961 1009 for( i = 0; i < count; i++ ) 962 1010 { 963 input = inputs.item( i );1011 var input = inputs.item( i ); 964 1012 //cliquer toutes les molécules et isotopes du meme nom dans toutes les bases 965 1013 //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') … … 1039 1087 onBlurInputMeanValue: function() 1040 1088 { 1041 1042 1089 //si step est sup a 0, ajout d'une ligne Z aux parametres Y1 et y2 1043 1090 if ($("#meanValue2").val() > 0) 1044 1091 { 1045 this.selectTraceAxeY1.add( 'Z', "Number of lines " );1046 this.selectTraceAxeY2.add( 'Z', "Number of lines " );1092 this.selectTraceAxeY1.add( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); 1093 this.selectTraceAxeY2.add( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); 1047 1094 } 1048 1095 //si step = a 0 et autres valeurs (a faire) , retrait de la ligne Z aux parametres Y1 et y2 … … 1050 1097 { 1051 1098 //alert($("#meanValue2").val()); 1052 this.selectTraceAxeY1.remove( 'Z', "Number of lines " );1053 this.selectTraceAxeY2.remove( 'Z', "Number of lines " );1099 this.selectTraceAxeY1.remove( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); 1100 this.selectTraceAxeY2.remove( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); 1054 1101 } 1055 1102 }, … … 1069 1116 this.selectScaleY2.disable(); 1070 1117 this.selectTypeTraceY2.disable(); 1071 1072 1118 } 1073 1119 //si une seule courbe choisie pour les isotopes et ou molecules, les choix pour Y2 sont actifs … … 1157 1203 } 1158 1204 1159 1160 1205 }, 1161 1206 … … 1165 1210 }, 1166 1211 1167 displayWindow: function( )1168 { 1169 // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=bib.txt"><button class="dataProtocolDownloadButton">Download</button></a>';1170 var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=' + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>'; 1212 displayWindow: function(coordinate, content) 1213 { 1214 // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=' + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>'; 1215 1171 1216 //alert(content); 1172 1217 var $dialog = $( '<div></div>' ) 1218 1173 1219 .html( content ) 1220 1174 1221 .dialog( { 1175 1222 autoOpen: false, 1176 1223 title: "GEISA : spectroscopic database", 1177 minHeight: 500, 1178 minWidth: 660 1224 //minHeight: 500, 1225 // minWidth: 660, 1226 height: 560, 1227 width:700, 1228 //Exemple de valeurs possible pour position : "middle", "top", [200, 100] 1229 position: "middle" 1230 1179 1231 } ); 1180 1232 $dialog.dialog( 'open' ) 1181 1233 }, 1182 1234 1235 // displayWindow: function(coordinate) 1236 //{ 1237 //var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=bib.txt"><button class="dataProtocolDownloadButton">Download</button></a>'; 1238 // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=' + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>'; 1239 1240 //alert(content); 1241 // var $dialog = $( '<div></div>' ) 1242 // .html( content + content1 ) 1243 1244 // .dialog( { 1245 // autoOpen: false, 1246 // title: "GEISA : spectroscopic database", 1247 // minHeight: 500, 1248 // minWidth: 660, 1249 1250 //coordonnee y y 1251 // position:coordinate 1252 1253 // } ); 1254 // $dialog.dialog( 'open' ) 1255 //}, 1256 1257 1183 1258 onClickDownload: function() 1184 1259 {
Note: See TracChangeset
for help on using the changeset viewer.