- Timestamp:
- 04/19/12 20:26:57 (12 years ago)
- Location:
- tapas/web
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
tapas/web/project/formTapas.jsp
r481 r489 3 3 <%@ page import="com.ether.InstrumentalFunction" %> 4 4 <%@ page import="com.ether.ClimatoReference" %> 5 <%@ page import="com.ether.YesNo" %> 5 6 <%@ page contentType="text/html;charset=UTF-8" language="java" %> 6 7 <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> … … 21 22 <ether:htmlJs jsFile="calendar/anytime"/> 22 23 <ether:htmlJsp jspFile="formTapas_script"/> 24 <ether:htmlJs jsFile="tools/controls"/> 23 25 </tiles:put> 24 26 … … 45 47 tapasTexts["<%=SpectralUnit.NM_VACUUM%>"] = "<spring:message code="label.spectralUnit.NM_VACUUM"/>"; 46 48 tapasTexts["<%=SpectralUnit.CM%>"] = "<spring:message code="label.spectralUnit.CM"/>"; 47 tapasTexts["<%=InstrumentalFunction.NONE%>"] = "<spring:message code=" label.instrumentalFunction.NONE"/>";49 tapasTexts["<%=InstrumentalFunction.NONE%>"] = "<spring:message code="text.NONE"/>"; 48 50 tapasTexts["<%=InstrumentalFunction.GAUSSIAN%>"] = "<spring:message code="label.instrumentalFunction.GAUSSIAN"/>"; 49 51 tapasTexts["<%=ClimatoReference.TROPICAL%>"] = "<spring:message code="label.climatoReference.TROPICAL"/>"; … … 53 55 tapasTexts["<%=ClimatoReference.SUBARCTIC_WINTER%>"] = "<spring:message code="label.climatoReference.SUBARCTIC_WINTER"/>"; 54 56 tapasTexts["<%=ClimatoReference.US_STANDARD_1976%>"] = "<spring:message code="label.climatoReference.US_STANDARD_1976"/>"; 55 tapasTexts["confirm"] = "<spring:message code="label.confirm"/>"; 57 58 tapasTexts["<%=YesNo.YES%>"] = "<spring:message code="app.YES"/>"; 59 tapasTexts["<%=YesNo.NO%>"] = "<spring:message code="app.NO"/>"; 60 61 62 tapasTexts["confirm"] = "<spring:message code="label.confirm"/>"; 63 64 tapasTexts["label.ira"]="<spring:message code="label.ira"/>"; 65 tapasTexts["label.ide"]="<spring:message code="label.ide"/>"; 66 tapasTexts["label.iza"]="<spring:message code="label.iza"/>"; 67 tapasTexts["label.spectralUnit"]="<spring:message code="label.spectralUnit"/>"; 68 tapasTexts["label.spectralRange"]="<spring:message code="label.spectralRange"/>"; 69 tapasTexts["label.to"]="<spring:message code="label.to"/>"; 70 tapasTexts["label.observatory"]="<spring:message code="label.observatory"/>"; 71 tapasTexts["label.preferences"]="<spring:message code="label.preferences"/>"; 72 tapasTexts["label.resolution"]="<spring:message code="label.resolution"/>"; 73 tapasTexts["label.ratio"]="<spring:message code="label.ratio"/>"; 74 tapasTexts["label.ifunction"]="<spring:message code="label.ifunction"/>"; 75 tapasTexts["label.climato"]="<spring:message code="label.climato"/>"; 76 tapasTexts["label.datemesure"]="<spring:message code="label.datemesure"/>"; 77 78 tapasTexts["label.format"]="<spring:message code="label.format"/>"; 79 tapasTexts["label.era"]="<spring:message code="label.era"/>"; 80 tapasTexts["label.eo2"]="<spring:message code="label.eo2"/>"; 81 tapasTexts["label.eh2o"]="<spring:message code="label.eh2o"/>"; 82 tapasTexts["label.eco2"]="<spring:message code="label.eco2"/>"; 83 tapasTexts["label.eo3"]="<spring:message code="label.eo3"/>"; 84 tapasTexts["text.select"]="<spring:message code="text.select"/>"; 85 86 87 tapasTexts["label.datemesure"]="<spring:message code="label.datemesure"/>"; 88 89 tapasTexts["text.validnum"]="<spring:message code="text.validnum"/>"; 90 tapasTexts["text.badvalue"]="<spring:message code="text.badvalue"/>"; 91 92 93 56 94 57 95 var interfaceTapas = new InterfaceTapas(${jSonFileFormats},${jSonYesNos},${jSonObservatories},${jSonSpectralUnits},${jSonInstrumentalFunctions},${jSonClimatoReferences}); 96 58 97 </script> 59 98 -
tapas/web/project/formTapas_script.jsp
r481 r489 1 1 2 <script type="text/javascript"> 3 4 5 2 6 var InterfaceTapas = Class.create( { 3 7 … … 41 45 42 46 43 td2.attr({colspan: 3});47 td2.attr({colspan:4}); 44 48 td2.append( inputDate ); 45 49 tr.append( td2 ); … … 59 63 }, 60 64 61 createTr: function( texte, inputId, container ) 62 { 65 66 // CREATES ******************************************************** 67 createTime: function( containerCalendar, texte, input ) 68 { 69 // Create input for date text 70 var inputDateId = input; 63 71 var tr = $( document.createElement( "tr" ) ); 64 72 var td1 = $( document.createElement( "td" ) ); 65 73 var td2 = $( document.createElement( "td" ) ); 74 var inputDate = $( document.createElement( "input" ) ); 75 inputDate.attr( {id:inputDateId, size:"10"} ); 76 77 td1.html( texte ); 78 td1.attr( { class:"containerLabel" } ); 79 80 tr.append( td1 ); 81 82 83 td2.attr({colspan:3}); 84 td2.append( inputDate ); 85 tr.append( td2 ); 86 containerCalendar.append( tr ); 87 88 // Calendar 89 this.calendarFormat = "%H:%i:%s"; 90 this.calendarConverter = new AnyTime.Converter( { format: this.calendarFormat } ); 91 92 AnyTime.picker( inputDateId, { format: this.calendarFormat, firstDOW: 1, 93 labelTitle: "Select hour", labelHour: "Hour", labelMinute: "Minute", labelSecond: "Second" 94 } ); 95 96 $( "#"+inputDateId ).val( "00:00:00" ); 97 }, 98 99 createTr: function( texte, inputId, container, textesup ) 100 { 101 var tr = $( document.createElement( "tr" ) ); 102 var td1 = $( document.createElement( "td" ) ); 103 var td2 = $( document.createElement( "td" ) ); 104 var td3 = $( document.createElement( "td" ) ); 66 105 var input = $( document.createElement( "input" ) ); 67 106 68 input.attr( {id: inputId, class:"containerText" } );107 input.attr( {id: inputId, class:"containerText", size:11} ); 69 108 70 109 td1.html( texte ); 71 110 td1.attr( {class:"containerLabel"} ); 111 112 td3.html( textesup ); 113 td3.attr( {class:"containerLabel2", colspan:3} ); 72 114 tr.append( td1 ); 73 115 td2.append( input ); 74 116 75 117 tr.append( td2 ); 118 tr.append( td3 ); 76 119 container.append( tr ); 77 120 … … 86 129 jQuery.each( this.jSonYesNos, jQuery.proxy( function ( i, jsonYesNo ) 87 130 { 88 selectYesNos.add( jsonYesNo.value, jsonYesNo.text);131 selectYesNos.add( jsonYesNo.value, tapasTexts[jsonYesNo.text] ); 89 132 }, this ) ); 90 133 selectYesNos.selectFirst( false ); … … 93 136 94 137 95 createTr2Input: function( texte1, texte2, inputId1, inputId2, container )138 createTr2Input: function( texte1, texte2, inputId1, inputId2, container, textesup ) 96 139 { 97 140 var tr = $( document.createElement( "tr" ) ); … … 100 143 var td3 = $( document.createElement( "td" ) ); 101 144 var td4 = $( document.createElement( "td" ) ); 145 var td5 = $( document.createElement( "td" ) ); 102 146 var input1 = $( document.createElement( "input" ) ); 103 147 var input2 = $( document.createElement( "input" ) ); 104 148 105 149 106 input1.attr( {id: inputId1,class:"containerText" } );107 input2.attr( {id: inputId2,class:"containerText" } );150 input1.attr( {id: inputId1,class:"containerText",size:11} ); 151 input2.attr( {id: inputId2,class:"containerText",size:11} ); 108 152 109 153 td1.html( texte1 ); 110 154 td3.html( texte2 ); 155 td5.html( textesup ); 111 156 td1.attr({class:"containerLabel"}); 112 td3.attr({class:"containerLabel"}); 157 td3.attr({class:"containerLabel3"}); 158 td5.attr({class:"containerLabel2"}); 159 113 160 td2.append( input1 ); 114 161 //td2.html( texte2 ); 115 td 3.append( input2 );162 td4.append( input2 ); 116 163 117 164 tr.append( td1 ); … … 119 166 tr.append( td3 ); 120 167 tr.append( td4 ); 168 tr.append( td5 ); 121 169 container.append( tr ); 122 170 }, … … 133 181 134 182 td1.html( texte ); 135 td1.attr( {class:"containerLabel", width:"140px"} ); 183 td1.attr( {class:"containerLabel"} ); 184 136 185 tr.append( td1 ); 137 186 if( type == 'format' ) this.displayFileFormats( td2 ); … … 145 194 } 146 195 else if( type == 'observatories' ) this.displayObservatories( td2 ); 147 else if( type == 'spectralUnit' ) this.displaySpectralUnits( td2 ); 196 else if( type == 'spectralUnit' ) { 197 this.displaySpectralUnits( td2 ); 198 //td2.attr({colspan:3}); 199 } 148 200 else if( type == 'ilsf' ) this.displayInstrumentalFunctions( td2 ); 149 else if( type == 'climatoReference' ) this.displayClimatoReferences( td2 ); 201 else if( type == 'climatoReference' ) { 202 this.displayClimatoReferences( td2 ); 203 204 205 } 150 206 151 207 td2.attr({colspan:3}); … … 185 241 onClickSubmit: function() 186 242 { 187 if ( confirm(tapasTexts["confirm"]) ) { 188 this.containerErrors.hide(); 189 this.requestCreateXML(); 243 if ( true && isDeg($( "#ide").val(),tapasTexts["label.ide"],tapasTexts["text.badvalue"] )) { 244 245 if ( confirm(tapasTexts["confirm"]) ) { 246 this.containerErrors.hide(); 247 this.requestCreateXML(); 248 } 190 249 } 191 250 }, … … 214 273 this.selectObservatories = new Select( paramSelect ); 215 274 //ajouter select vide avec add 216 this.selectObservatories.add( "-1", "-- Select an observatory--" );275 this.selectObservatories.add( "-1", "-- "+tapasTexts["text.select"]+" --" ); 217 276 jQuery.each( this.jSonObservatories, jQuery.proxy( function ( i, jsonObservatory ) 218 277 { … … 230 289 this.selectSpectralUnits = new Select( paramSelect ); 231 290 //ajouter select vide avec add 232 this.selectSpectralUnits.add( "-1", "-- Select unit--" );291 this.selectSpectralUnits.add( "-1", "-- "+tapasTexts["text.select"]+" --" ); 233 292 jQuery.each( this.jSonSpectralUnits, jQuery.proxy( function ( i, jsonSpectralUnit ) 234 293 { … … 282 341 var divPreference = $( document.createElement( "div" ) ); 283 342 var tabPreference = $( document.createElement( "table" ) ); 343 tabPreference.attr({cellspacing:3}); 284 344 285 345 var divObservation = $( document.createElement( "div" ) ); 286 346 var tabObservation = $( document.createElement( "table" ) ); 347 //tabObservation.attr({border:1}); 348 tabObservation.attr({cellspacing:3}); 349 287 350 288 351 var divAtmosphere = $( document.createElement( "div" ) ); … … 304 367 305 368 var legendPreference = $( document.createElement( "legend" ) ); 306 legendPreference.html( "Preferences");369 legendPreference.html(tapasTexts["label.preferences"]); 307 370 fieldSetPreference.append(legendPreference); 308 371 legendPreference.addClass("containerField"); 309 372 310 311 //this.tabInput = new Array(3); 312 this.createTrList( "File format", "iformat", tabPreference, 'format' ); 313 this.createTrList( "Rayleigh extinction", "irextinction", tabPreference, 'yesno' ); 314 this.createTrList( "H20 extinction", "ih2oe", tabPreference, 'yesno' ); 315 this.createTrList( "O3 extinction", "io3e", tabPreference, 'yesno' ); 316 this.createTrList( "O2 extinction", "io2e", tabPreference, 'yesno' ); 317 this.createTrList( "CO2 extinction", "ico2e", tabPreference, 'yesno' ); 318 319 this.createTrList( "Observatory", "iobservatory", tabObservation, 'observatories' ); 320 321 this.createTr( "Right LOS ascension", "ira", tabObservation ); 322 this.createTr( "LOS declension", "ide", tabObservation ); 323 this.createTr( "Zenith angle", "iza", tabObservation ); 324 325 //unite 326 this.createTrList( "Spectral unit", "ispectral_choice", tabObservation, 'spectralUnit' ); 327 this.createTr2Input( "Spectral range", " to ", "iminspectral_ranger", "imaxspectral_ranger", tabObservation ); 328 329 //fonction instrumentale 330 this.createTrList( "Instrumental function", "ifunction", tabObservation, "ilsf" ); 331 332 this.createTr( "Resolving power", "irp", tabObservation ); 333 this.createTr( "Sampling ratio", "isr", tabObservation ); 334 335 //reference climato 336 this.createTrList( "Climatologic reference", "icr", tabAtmosphere, "climatoReference" ); 337 338 339 340 fieldSetObservation.append( tabObservation ); 373 fieldSetObservation.append( tabObservation ); 341 374 divObservation.addClass("divObservation"); 342 375 this.containerForm.append( divObservation ); … … 350 383 divPreference.addClass("divPreference"); 351 384 this.containerForm.append( divPreference ); 352 353 // Ajout du calendrier APRES la création du formulaire 354 this.createCalendar( tabObservation, "Date measurement" ); 385 //this.tabInput = new Array(3); 386 387 this.createTrList( tapasTexts["label.format"], "iformat", tabPreference, 'format' ); 388 this.createTrList( tapasTexts["label.era"], "irextinction", tabPreference, 'yesno' ); 389 this.createTrList( tapasTexts["label.eh2o"], "ih2oe", tabPreference, 'yesno' ); 390 this.createTrList( tapasTexts["label.eo3"], "io3e", tabPreference, 'yesno' ); 391 this.createTrList( tapasTexts["label.eo2"], "io2e", tabPreference, 'yesno' ); 392 this.createTrList( tapasTexts["label.eco2"], "ico2e", tabPreference, 'yesno' ); 393 394 this.createTrList( tapasTexts["label.observatory"], "iobservatory", tabObservation, 'observatories' ); 395 this.createCalendar( tabObservation, tapasTexts["label.datemesure"] ); 396 397 //unite 398 this.createTrList( tapasTexts["label.spectralUnit"], "ispectral_choice", tabObservation, 'spectralUnit' ); 399 this.createTr2Input( tapasTexts["label.spectralRange"], tapasTexts["label.to"], "iminspectral_ranger", "imaxspectral_ranger", tabObservation, "[350,2500] nm" ); 400 401 //fonction instrumentale 402 this.createTrList( tapasTexts["label.ifunction"], "ifunction", tabObservation, "ilsf" ); 403 //reference climato 404 //this.createTrList( tapasTexts["label.climato"], "icr", tabAtmosphere, "climatoReference" ); 405 this.createTrList( tapasTexts["label.climato"], "icr", tabObservation, "climatoReference" ); 406 407 408 //this.createTr( tapasTexts["label.ira"], "ira", tabObservation ); 409 this.createTime( tabObservation, tapasTexts["label.ira"],"ira" ); 410 this.createTr( tapasTexts["label.ide"],"ide", tabObservation,"hh:mm:ss.ms [-90,90] °" ); 411 this.createTr( tapasTexts["label.iza"], "iza", tabObservation, "[0,90] °" ); 412 413 this.createTr( tapasTexts["label.resolution"], "irp", tabObservation, "" ); 414 this.createTr( tapasTexts["label.ratio"], "isr", tabObservation, "" ); 355 415 356 416 //jQuery.proxy permet d'envoyer le contexte this courant … … 467 527 } 468 528 529 /*, 530 531 isEmpty: function(string){ 532 return (string.trim()==''); 533 }, 534 535 536 isMail: function(email){ 537 return (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)); 538 }, 539 540 541 isInt: function(number){ 542 return (/^[0-9]+$/.test(number)); 543 }, 544 545 546 isFloat: function(number){ 547 return (/^[0-9]+(\.[0-9]+)?$/.test(number)); 548 }, 549 550 551 isIP: function(ip){ 552 return (/^(([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+))$/.test(ip)); 553 }, 554 555 556 557 isURL: function(string){ 558 return (/^(((ht|f)tp(s?))\:\/\/)([0-9a-zA-Z\-]+\.)+[a-zA-Z]{2,6}(\:[0-9]+)?(\/\S*)?$/.test(string.toLowerCase())); 559 }, 560 561 isValidNum: function(number) { 562 if (!this.isEmpty(number) && this.isFloat(number)) return true; 563 else return false; 564 }*/ 565 566 469 567 } ); 470 568 -
tapas/web/resources/css/tapas.css
r481 r489 22 22 border-radius:8px; 23 23 padding-right:40px; 24 margin-left:30px; 24 padding-left:30px; 25 margin-left:20px; 25 26 padding-bottom:30px; 26 27 } … … 33 34 padding-right:40px; 34 35 padding-bottom:30px; 36 margin-right:50px; 37 margin-left:0px; 38 padding-left:30px 35 39 } 36 40 … … 92 96 //margin-top: 10px; 93 97 padding-left: 0px; 94 width:100px;98 //width:100px; 95 99 96 100 } … … 103 107 padding-left: 20px; 104 108 text-align:right; 109 } 110 111 .containerLabel2 { 112 font-size: 12px; 113 color: white; 114 font-weight: bold; 115 //margin-bottom: 10px; 116 //padding-left: 20px; 117 } 118 119 120 .containerLabel3 { 121 font-size: 12px; 122 color: white; 123 font-weight: bold; 124 125 text-align:center; 105 126 } 106 127 … … 356 377 background-repeat: no-repeat; 357 378 } 379 380 381 #ira { 382 background-image: url("../../resources/icons/icone_heure.png"); 383 background-position:bottom right; 384 background-repeat: no-repeat; 385 386 387 388 } -
tapas/web/resources/js/tools/controls.js
r481 r489 4 4 * Date: 18/04/12 5 5 * Time: 11:26 6 * To change this template use File | Settings | File Templates.7 6 */ 8 7 8 function isEmpty(string){ 9 return (string.trim()==''); 10 } 9 11 12 13 function isMail(email){ 14 return (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)); 15 } 16 17 18 function isInt(number,champ,texte){ 19 if (!(/^[0-9]+$/.test(number))) { 20 alert(champ+' : '+texte); 21 return false; 22 } 23 else { 24 return true; 25 } 26 } 27 28 29 function isFloat(number,champ,texte){ 30 if (!(/^[0-9]+(\.[0-9]+)?$/.test(number))) { 31 alert(champ+' : '+texte); 32 return true; 33 } 34 else { 35 return false; 36 } 37 } 38 39 40 function isIP(ip){ 41 return (/^(([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+))$/.test(ip)); 42 } 43 44 function isDeg(val,champ,texte){ 45 //return (/^(([0-2]*[0-9][0-9])\.([0-2]*[0-9][0-9])\.([0-2]*[0-9][0-9])\.([0-2]*[0-9][0-9]))$/.test(val)); 46 if ( !(/^(([\+-])?[0-9]?[0-9]):([0-9]+[0-9]+):([0-9]+[0-9]+)(\.)*([0-9]*[0-9]*[0-9]*)*$/.test(val)) || isEmpty(val)){ 47 alert(champ+' : '+texte); 48 return false; 49 } 50 else { 51 var tab=val.split(":") 52 53 if (tab[0]>90) { 54 alert(champ+' : '+texte); 55 return false 56 } 57 else { 58 return true; 59 } 60 } 61 62 //return (/^(([0-9]*[0-9]+):([0-9]+[0-9]+):([0-9]+[0-9]+))$/.test(val)); 63 } 64 65 function isURL(string){ 66 return (/^(((ht|f)tp(s?))\:\/\/)([0-9a-zA-Z\-]+\.)+[a-zA-Z]{2,6}(\:[0-9]+)?(\/\S*)?$/.test(string.toLowerCase())); 67 } 68 69 function isValidNum(number,champ,texte){ 70 if (!isEmpty(number) && isFloat(number,champ,texte)) return true; 71 else { 72 alert(champ+' : '+texte); 73 return false; 74 } 75 } -
tapas/web/src/messages_en.properties
r481 r489 4 4 label.language.value.to.switch=fr 5 5 6 7 label.ira=Right LOS ascension 8 label.ide=LOS declension 9 label.iza=Zenithal angle 10 label.spectralUnit=Spectral unit 11 label.spectralRange=Spectral range 12 label.to=to 13 label.observatory=Observatory 14 label.preferences=Preferences 15 label.ifunction=Instrumental function 16 label.resolution=Resolution power 17 label.ratio=Sampling ratio 18 label.climato=Climatologic reference 19 label.datemesure=Date measurement 20 21 label.format=File format 22 label.era=Rayleigh extinction 23 label.eo2=O2 extinction 24 label.eh2o=H2O extinction 25 label.eco2=CO2 extinction 26 label.eo3=O3 extinction 27 28 text.validnum=shoud be numeric 29 text.select=Select 30 text.NONE=None 31 text.badvalue=bad value 32 33 34 6 35 app.title=Tapas 7 36 app.fulltitle=Transmissions Atmosphériques Personnalisées Pour l'AStronomie 8 37 app.connexion=Connection 9 38 app.administrator=Administrator 10 app. yes=Yes11 app. no=No39 app.YES=Yes 40 app.NO=No 12 41 13 42 title.home=Home -
tapas/web/src/messages_fr.properties
r481 r489 4 4 label.language.value.to.switch=en 5 5 6 7 label.ira=Ascension LOS droite 8 label.ide=Déclinaision LOS 9 label.iza=Angle zénithal 10 label.spectralUnit=Unité spectrale 11 label.spectralRange=Intervalle spectral 12 label.to= à 13 label.ifunction=Fonction instrumentale 14 label.resolution=Résolution 15 label.ratio=Taux d'échantillonnage 16 label.climato=Climatologie 17 label.datemesure=Date de mesure 18 19 label.format=Format fichier 20 label.era=Extinction rayleigh 21 label.eo2=Extinction O2 22 label.eh2o=Extinction H2O 23 label.eco2=Extinction CO2 24 label.eo3=Extinction O3 25 26 label.observatory=Observatoire 27 label.preferences=Préférences 28 29 text.validnum=doit être numérique 30 text.select=Sélectionnez 31 text.badvalue=mauvaise valeur 32 text.NONE=Aucune 33 34 6 35 app.title=Tapas 7 36 app.fulltitle=Transmissions Atmosphériques Personnalisées Pour l'AStronomie 8 37 app.connexion=Connexion 9 38 app.administrator=Administrateur 10 app. yes=Oui11 app. no=Non39 app.YES=Oui 40 app.NO=Non 12 41 13 42 title.home=Accueil
Note: See TracChangeset
for help on using the changeset viewer.