--- rat/client/parameter.html 2000/11/19 03:23:54 1.2 +++ rat/client/parameter.html 2001/08/08 13:24:52 1.10 @@ -2,7 +2,8 @@ LON-CAPA @@ -239,6 +240,38 @@ function intcalc() { draw(); } +function integereval() { + svalue=choices.document.forms.sch.intval.value; + svalue=Math.round(svalue); + if (pscat=='zeropos') { svalue=Math.abs(svalue); } + if ((pscat=='pos') && (svalue==0)) { + svalue=''; + } + if (pscat.indexOf('range')!=-1) { + var rangeparts=new Array; + rangeparts=split('_',pscat); + rangeparts=split('...',rangeparts[1]); + if (svaluerangeparts[1]) { svalue=rangeparts[1]; } + } + draw(); +} + +function floateval() { + svalue=choices.document.forms.sch.floatval.value; + svalue=1.0*svalue; + if (pscat=='pos') { svalue=Math.abs(svalue); } + if ((pscat=='zeroone') && ((svalue<0) || (svalue>1))) { + svalue=''; + } + draw(); +} + +function stringeval() { + svalue=choices.document.forms.sch.stringval.value; + draw(); +} + function intervaldis() { csecs=svalue; cdays=Math.floor(csecs/86400); @@ -260,7 +293,17 @@ function afterproc() { function draw() { choicestart(); - choicewrite('
'); + choicewrite(''); if (ptype=='tolerance') { // 0: pscat // 1: after processing @@ -304,7 +347,7 @@ function draw() { choicewrite('Number of digits: ' +''); - choicewrite('Accept if more digits given: ' +choicewrite('Accept if more digits given: ' +''); } @@ -344,17 +387,68 @@ function draw() { } } - if (ptype=='value') { + if (ptype=='int') { + if (pscat=='default') { + tablestart('Default value or none'); + choicewrite(''); + } else { + if (pscat=='pos') { + tablestart('Positive (non-zero) integer'); + } + if (pscat=='zeropos') { + tablestart('Positive integer or zero'); + } + if (pscat.indexOf('range')!=-1) { + var rangeparts=new Array; + rangeparts=split('_',pscat); + tablestart('Integer in the range ['+rangeparts[1]+']'); + } + if (pscat=='any') { + tablestart('Integer'); + } + choicewrite('Value:'); + choicewrite(''); + choicewrite(''); + } } - if (ptype=='truefalse') { + if (ptype=='float') { + if (pscat=='default') { + tablestart('Default value or none'); + choicewrite(''); + } else { + if (pscat=='pos') { + tablestart('Positive floating point number or zero'); + } + if (pscat=='zeroone') { + tablestart('Floating point number between zero and one'); + } + if (pscat=='any') { + tablestart('Floating point number'); + } + choicewrite('Value:'); + choicewrite(''); + choicewrite(''); + } } - if (ptype=='check') { + if (ptype=='string') { + if (pscat=='default') { + tablestart('Default value or none'); + choicewrite(''); + } else { + if (pscat=='any') { + tablestart('Text'); + } + choicewrite('Value:'); + choicewrite(''); + choicewrite(''); + } } - if (ptype=='radio') { - } choicewrite('
'); choiceend(); } @@ -377,8 +471,8 @@ function assemble() { if ((ptype=='date') && (pscat!='interval')) { svalue=Math.round(cdate.getTime()/1000); } + if (pscat=='default') { svalue=''; } stype=ptype+'_'+pscat; - alert(stype+' '+svalue); } @@ -390,13 +484,15 @@ function init() { for (i=0;i'); - selwrite('

'+pname+'

'); + selwrite(''+pname+'
'); selwrite('
'); selwrite('Store  '); + + selwrite('Delete  '); + + selwrite('Store'); + selwrite('">Cancel'); selwrite(''); this.window.selector.document.close();