Annotation of rat/client/parameter.html, revision 1.22
1.1 www 1: <html>
2: <!--
3: The LearningOnline Network with CAPA
4: Parameter Input Window
1.16 albertel 5: //
1.22 ! www 6: // $Id: parameter.html,v 1.21 2003/04/18 20:21:38 www Exp $
1.16 albertel 7: //
8: // Copyright Michigan State University Board of Trustees
9: //
10: // This file is part of the LearningOnline Network with CAPA (LON-CAPA).
11: //
12: // LON-CAPA is free software; you can redistribute it and/or modify
13: // it under the terms of the GNU General Public License as published by
14: // the Free Software Foundation; either version 2 of the License, or
15: // (at your option) any later version.
16: //
17: // LON-CAPA is distributed in the hope that it will be useful,
18: // but WITHOUT ANY WARRANTY; without even the implied warranty of
19: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20: // GNU General Public License for more details.
21: //
22: // You should have received a copy of the GNU General Public License
23: // along with LON-CAPA; if not, write to the Free Software
24: // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25: //
26: // /home/httpd/html/adm/gpl.txt
27: //
28: // http://www.lon-capa.org/
29: //
1.7 www 30: 06/16/00,06/17,11/17,11/18,11/23,11/27,11/28,12/15,12/16,
1.10 www 31: 03/21/01,03/24,06/26 Gerd Kortemeyer
1.12 www 32: 08/08 Gerd Kortemeyer
1.1 www 33: -->
34: <head>
35: <title>LON-CAPA</title>
36: </head>
37:
38: <script>
39:
40: var ptype='';
41: var pvalue='';
42: var preturn='';
43: var pcode='';
1.2 www 44: var pscat='';
45: var pmarker='';
1.1 www 46: var pname='';
47:
48: var svalue;
1.2 www 49: var stype;
50: var smarker;
1.1 www 51:
52: var vars=new Array();
53:
1.2 www 54: var cdate=new Date();
55:
56: var csec;
57: var cmin;
58: var chour;
59: var cday;
60:
61: var months=new Array();
62:
63:
1.1 www 64: function selwrite(text) {
65: this.window.selector.document.write(text);
66: }
67:
68: function choicestart() {
69: this.window.choices.document.clear();
70: choicewrite('<html><body bgcolor="#FFFFFF">');
71: }
72:
73: function choiceend() {
74: choicewrite('</body></html>');
75: this.window.choices.document.close();
76: }
77:
78: function choicewrite(text) {
79: this.window.choices.document.write(text);
80: }
81:
82: function tablestart(headtext) {
83: choicewrite('<table><tr bgcolor="#AAFFAA"><th colspan=3>'+
84: headtext+'</th></tr>');
85: }
86:
87: function valline(text,id1,id2) {
88: choicewrite('<tr bgcolor="#AAFFAA"><td>'+text+
89: '</td><td><input type=text size=4 name=val'+
90: id1+'></td><td>incl:<input type=checkbox name=val'+
91: id2+'></td></tr>');
92: }
93:
1.2 www 94: function datecalc() {
95: var sform=choices.document.forms.sch;
96:
97: cdate.setHours(sform.hours.options[sform.hours.selectedIndex].value);
98: cdate.setMinutes(sform.minutes.options[sform.minutes.selectedIndex].value);
99: cdate.setSeconds(sform.minutes.options[sform.seconds.selectedIndex].value);
100: cdate.setDate(sform.date.options[sform.date.selectedIndex].value);
101: cdate.setMonth(sform.month.options[sform.month.selectedIndex].value);
102: cdate.setFullYear(sform.year.options[sform.year.selectedIndex].value);
103:
104: draw();
105: }
106:
107: function hour() {
108: var thishour=cdate.getHours();
109: var i; var j;
110: choicewrite('<select name=hours onChange="parent.datecalc();">');
111: for (i=0;i<=23;i++) {
112: choicewrite('<option value='+i);
113: if (i==thishour) {
114: choicewrite(' selected');
115: }
116: choicewrite('>');
117: if (i==12) { choicewrite('noon'); } else {
118: if (i==0) { choicewrite('midnight') } else {
119:
120: if (i<12) { choicewrite(i+' am'); } else {
121: j=i-12; choicewrite(j+' pm');
122: }
123:
124: }
125: }
126: choicewrite('</option>');
127: }
128: choicewrite('</select>');
129: }
130:
131: function minute() {
132: var thisminutes=cdate.getMinutes();
133: var i;
134: choicewrite('<select name=minutes onChange="parent.datecalc();">');
135: for (i=0;i<=59;i++) {
136: choicewrite('<option value='+i);
137: if (i==thisminutes) {
138: choicewrite(' selected');
139: }
140: choicewrite('>'+i+'</option>');
141: }
142: choicewrite('</select>');
143: }
144:
145: function second() {
146: var thisseconds=cdate.getSeconds();
147: var i;
148: choicewrite('<select name=seconds onChange="parent.datecalc();">');
149: for (i=0;i<=59;i++) {
150: choicewrite('<option value='+i);
151: if (i==thisseconds) {
152: choicewrite(' selected');
153: }
154: choicewrite('>'+i+'</option>');
155: }
156: choicewrite('</select>');
157: }
158:
159:
160: function date() {
161: var thisdate=cdate.getDate();
162: var i;
163: choicewrite('<select name=date onChange="parent.datecalc();">');
164: for (i=1;i<=31;i++) {
165: choicewrite('<option value='+i);
166: if (i==thisdate) {
167: choicewrite(' selected');
168: }
169: choicewrite('>'+i+'</option>');
170: }
171: choicewrite('</select>');
172: }
173:
174: function year() {
175: var thisyear=cdate.getFullYear();
1.19 www 176: var nowdate=new Date();
177: var nowyear=nowdate.getFullYear();
178: var loweryear=thisyear-2;
179: var upperyear=thisyear+5;
180: if (thisyear>nowyear) { loweryear=nowyear-2; }
181: if (thisyear<nowyear) { upperyear=nowyear+5; }
1.2 www 182: var i;
183: choicewrite('<select name=year onChange="parent.datecalc();">');
1.19 www 184: for (i=loweryear;i<=upperyear;i++) {
1.2 www 185: choicewrite('<option value='+i);
186: if (i==thisyear) {
187: choicewrite(' selected');
188: }
189: choicewrite('>'+i+'</option>');
190: }
191: choicewrite('</select>');
192: }
193:
194: function month() {
195: var thismonth=cdate.getMonth();
196: var i;
197: choicewrite('<select name=month onChange="parent.datecalc();">');
198: for (i=0;i<=11;i++) {
199: choicewrite('<option value='+i);
200: if (i==thismonth) {
201: choicewrite(' selected');
202: }
203: choicewrite('>'+months[i]+'</option>');
204: }
205: choicewrite('</select>');
206: }
207:
208:
209: function intminute() {
210: var thisminutes=cmins;
211: var i;
212: choicewrite('<select name=minutes onChange="parent.intcalc();">');
213: for (i=0;i<=59;i++) {
214: choicewrite('<option value='+i);
215: if (i==thisminutes) {
216: choicewrite(' selected');
217: }
218: choicewrite('>'+i+'</option>');
219: }
220: choicewrite('</select>');
221: }
222:
223: function inthour() {
224: var thishours=chours;
225: var i;
226: choicewrite('<select name=hours onChange="parent.intcalc();">');
227: for (i=0;i<=23;i++) {
228: choicewrite('<option value='+i);
229: if (i==thishours) {
230: choicewrite(' selected');
231: }
232: choicewrite('>'+i+'</option>');
233: }
234: choicewrite('</select>');
235: }
236:
237: function intsecond() {
238: var thisseconds=csecs;
239: var i;
240: choicewrite('<select name=seconds onChange="parent.intcalc();">');
241: for (i=0;i<=59;i++) {
242: choicewrite('<option value='+i);
243: if (i==thisseconds) {
244: choicewrite(' selected');
245: }
246: choicewrite('>'+i+'</option>');
247: }
248: choicewrite('</select>');
249: }
250:
251:
252: function intday() {
253: var thisdate=cdays;
254: var i;
255: choicewrite('<select name=date onChange="parent.intcalc();">');
256: for (i=0;i<=31;i++) {
257: choicewrite('<option value='+i);
258: if (i==thisdate) {
259: choicewrite(' selected');
260: }
261: choicewrite('>'+i+'</option>');
262: }
263: choicewrite('</select>');
264: }
265:
266: function intcalc() {
267: var sform=choices.document.forms.sch;
268: svalue=((sform.date.options[sform.date.selectedIndex].value*24+
269: sform.hours.options[sform.hours.selectedIndex].value*1)*60+
270: sform.minutes.options[sform.minutes.selectedIndex].value*1)*60+
271: sform.seconds.options[sform.seconds.selectedIndex].value*1;
272: draw();
273: }
274:
1.6 www 275: function integereval() {
276: svalue=choices.document.forms.sch.intval.value;
277: svalue=Math.round(svalue);
278: if (pscat=='zeropos') { svalue=Math.abs(svalue); }
279: if ((pscat=='pos') && (svalue==0)) {
280: svalue='';
281: }
1.12 www 282: if (pscat.indexOf('inrange')!=-1) {
1.10 www 283: var rangeparts=new Array;
284: rangeparts=split('_',pscat);
1.12 www 285: rangeparts=split(',',rangeparts[1]);
1.10 www 286: if (svalue<rangeparts[0]) { svalue=rangeparts[0]; }
287: if (svalue>rangeparts[1]) { svalue=rangeparts[1]; }
288: }
1.6 www 289: draw();
290: }
291:
292: function floateval() {
293: svalue=choices.document.forms.sch.floatval.value;
294: svalue=1.0*svalue;
295: if (pscat=='pos') { svalue=Math.abs(svalue); }
296: if ((pscat=='zeroone') && ((svalue<0) || (svalue>1))) {
297: svalue='';
298: }
299: draw();
300: }
301:
302: function stringeval() {
303: svalue=choices.document.forms.sch.stringval.value;
304: draw();
305: }
306:
1.2 www 307: function intervaldis() {
308: csecs=svalue;
309: cdays=Math.floor(csecs/86400);
310: csecs-=cdays*86400;
311: chours=Math.floor(csecs/3600);
312: csecs-=chours*3600;
313: cmins=Math.floor(csecs/60);
314: csecs-=cmins*60;
315: choicewrite(cdays+' days '+chours+' hours '
316: +cmins+' mins '+csecs+' secs');
317: }
1.21 www 318:
319: function pickcolor(picked) {
320: svalue=picked;
321: draw();
322: }
323:
324: function colorfield(ir,ig,ib) {
325: var col=new Array;
326: col=["00","11","22","33","44","55","66","77","88","99","AA","BB","CC","DD","EE","FF"];
327: var color='#'+col[ir]+col[ig]+col[ib];
328: var selection=" ";
329: if (color==svalue) { selection="X"; }
330: choicewrite('<td bgcolor="'+color+'"><a href="javascript:parent.pickcolor('+"'"+
331: color+"'"+')">'+selection+'</a></td>');
332:
333: }
334:
1.1 www 335: function draw() {
336: choicestart();
1.6 www 337: choicewrite('<form name=sch');
338: if (ptype=='int') {
339: choicewrite(' action="javascript:integereval();"');
340: }
341: if (ptype=='float') {
342: choicewrite(' action="javascript:floateval();"');
343: }
344: if (ptype=='string') {
345: choicewrite(' action="javascript:stringeval();"');
346: }
347: choicewrite('>');
1.1 www 348: if (ptype=='tolerance') {
1.2 www 349: // 0: pscat
350: if (pscat=='default') {
1.1 www 351: tablestart('Use default value or algorithm of resource');
352: }
1.2 www 353: if (pscat=='relative_sym') {
1.1 www 354: // 2: percentage
355: // 3: open
356: tablestart('Percentage error, symmetric around value');
357: valline('Percentage',2,3);
1.13 www 358: if ((svalue!='') && (typeof(svalue)!="undefined")) {
359: choices.document.forms.sch.val2.value=parseInt(svalue);
360: if (svalue.indexOf('+')!=-1) {
361: choices.document.forms.sch.val3.checked=true;
362: }
363: }
1.1 www 364: }
1.2 www 365: if (pscat=='relative') {
1.1 www 366: // 2: left
367: // 3: open
368: // 4: right
369: // 5: open
370: tablestart('Percentage error, asymmetric around value');
371: valline('Upper percentage',2,3);
372: valline('Lower percentage',4,5);
1.17 matthew 373: var range1=new Array;
1.13 www 374: if ((svalue!='') && (typeof(svalue)!="undefined")) {
1.17 matthew 375: range1=svalue.split(',');
376: if (typeof(range1[1])=='undefined') { range1[1]=range1[0]; }
377: choices.document.forms.sch.val2.value=parseFloat(range1[0]);
378: if (range1[0].indexOf('+')!=-1) {
1.13 www 379: choices.document.forms.sch.val3.checked=true;
380: }
1.17 matthew 381: choices.document.forms.sch.val4.value=parseFloat(range1[1]);
382: if (range1[1].indexOf('+')!=-1) {
1.13 www 383: choices.document.forms.sch.val5.checked=true;
384: }
385: }
1.1 www 386: }
1.2 www 387: if (pscat=='absolute_sym') {
1.1 www 388: tablestart('Absolute error, symmetric around value');
389: valline('Value',2,3);
1.13 www 390: if ((svalue!='') && (typeof(svalue)!="undefined")) {
1.15 www 391: choices.document.forms.sch.val2.value=parseFloat(svalue);
1.13 www 392: if (svalue.indexOf('+')!=-1) {
393: choices.document.forms.sch.val3.checked=true;
394: }
395: }
1.1 www 396: }
1.2 www 397: if (pscat=='absolute') {
1.1 www 398: tablestart('Absolute error, asymmetric around value');
399: valline('Upper value',2,3);
400: valline('Lower value',4,5);
1.17 matthew 401: var range2=new Array;
1.13 www 402: if ((svalue!='') && (typeof(svalue)!="undefined")) {
403: range=svalue.split(',');
1.17 matthew 404: if (typeof(range2[1])=='undefined') { range2[1]=range2[0]; }
405: choices.document.forms.sch.val2.value=parseFloat(range2[0]);
406: if (range2[0].indexOf('+')!=-1) {
1.13 www 407: choices.document.forms.sch.val3.checked=true;
408: }
1.17 matthew 409: choices.document.forms.sch.val4.value=parseFloat(range2[1]);
410: if (range2[1].indexOf('+')!=-1) {
1.13 www 411: choices.document.forms.sch.val5.checked=true;
412: }
413: }
1.1 www 414: }
415: }
416:
417: if (ptype=='date') {
1.2 www 418: if (pscat=='default') {
419: tablestart('Default value or none');
420: choicewrite('</table>');
421: } else {
422: if (pscat=='start') {
423: tablestart('Starting or opening date and time');
424: }
425: if (pscat=='end') {
426: tablestart('Ending or closing date and time');
427: }
428: if (pscat=='interval') {
429: tablestart('Time interval');
430: choicewrite('<tr bgcolor="#AAFFAA"><td colspan=3>');
431: intervaldis();
432: choicewrite('</td></tr><tr bgcolor="#AAFFAA"><td>Time:'
433: +'</td><td colspan=2>');
434: intday();choicewrite('days ');
435: inthour();choicewrite('hours ');
436: intminute(); choicewrite('mins '); intsecond();
437: choicewrite('secs</td></tr></table>');
438: } else {
439: choicewrite('<tr bgcolor="#AAFFAA"><td colspan=3>'
440: +cdate.toString()+
441: '</td></tr><tr bgcolor="#AAFFAA"><td>Date:</td><td colspan=2>');
442: month();date();year();
443: choicewrite('</td></tr><tr bgcolor="#AAFFAA"><td>Time:'
444: +'</td><td colspan=2>');hour();choicewrite('h ');minute();
445: choicewrite('m ');second();
446: choicewrite('s</td></tr></table>');
447: }
448: }
1.1 www 449: }
450:
1.6 www 451: if (ptype=='int') {
1.19 www 452: var pscatparts=new Array;
453: pscatparts=pscat.split(',');
454: pscat=pscatparts[0];
1.6 www 455: if (pscat=='default') {
456: tablestart('Default value or none');
1.14 www 457: choicewrite('</table>');
1.6 www 458: } else {
1.14 www 459: if (pscat=='range') {
460: tablestart('Integer range');
461: choicewrite('<tr bgcolor="#AAFFAA"><td>Lower Value:'+
462: '</td><td colspan=2><input type=text size=4 name=val2'+
463: '></td></tr>');
464: choicewrite('<tr bgcolor="#AAFFAA"><td>Upper Value:'+
465: '</td><td colspan=2><input type=text size=4 name=val4'+
466: '></td></tr></table>');
467: var range=new Array;
468: if ((svalue!='') && (typeof(svalue)!="undefined")) {
469: range=svalue.split(',');
470: if (typeof(range[1])=='undefined') { range[1]=range[0]; }
471: choices.document.forms.sch.val2.value=parseInt(range[0]);
472: choices.document.forms.sch.val4.value=parseInt(range[1]);
473: }
474: } else {
1.6 www 475: if (pscat=='pos') {
476: tablestart('Positive (non-zero) integer');
477: }
478: if (pscat=='zeropos') {
479: tablestart('Positive integer or zero');
480: }
1.12 www 481: if (pscat.indexOf('inrange')!=-1) {
1.10 www 482: var rangeparts=new Array;
1.12 www 483: rangeparts=split(',',pscat);
1.10 www 484: tablestart('Integer in the range ['+rangeparts[1]+']');
485: }
1.6 www 486: if (pscat=='any') {
487: tablestart('Integer');
488: }
489: choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
490: choicewrite('<input name=intval size=10 value="'+svalue+
491: '" name=intval onChange="parent.integereval()">');
492: choicewrite('</td></table>');
493: }
1.14 www 494: }
1.1 www 495: }
496:
1.6 www 497: if (ptype=='float') {
498: if (pscat=='default') {
499: tablestart('Default value or none');
500: choicewrite('</table>');
501: } else {
502: if (pscat=='pos') {
503: tablestart('Positive floating point number or zero');
504: }
505: if (pscat=='zeroone') {
506: tablestart('Floating point number between zero and one');
507: }
508: if (pscat=='any') {
509: tablestart('Floating point number');
510: }
511: choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
512: choicewrite('<input name=floatval size=10 value="'+svalue+
513: '" name=floatval onChange="parent.floateval()">');
514: choicewrite('</td></table>');
515: }
1.1 www 516: }
517:
1.6 www 518: if (ptype=='string') {
519: if (pscat=='default') {
520: tablestart('Default value or none');
521: choicewrite('</table>');
522: } else {
523: if (pscat=='any') {
524: tablestart('Text');
525: }
526: choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
1.18 albertel 527: choicewrite('<input name=stringval size=20 value="'+svalue+
1.6 www 528: '" name=stringval onChange="parent.stringeval()">');
529: choicewrite('</td></table>');
530: }
1.21 www 531: }
532:
533: if (ptype=='color') {
534: tablestart('Choose a Color');
535: choicewrite('<table>');
536: if (svalue) {
537: choicewrite('<tr><td colspan="10">Current choice:</td><td bgcolor="'+
538: svalue+'" colspan="6"> </td></tr>');
539: }
540: for (var ir=1; ir<=15; ir++) {
541: for (var ig=1; ig<=15; ig++) {
542: choicewrite('<tr>');
543: for (var ib=1; ib<=15; ib++) {
544: colorfield(ir,ig,ib);
545: }
546: choicewrite('</tr>');
547: }
548: }
549: choicewrite('</table></td></table>');
1.1 www 550: }
551:
552: choicewrite('</table></form>');
553: choiceend();
554: }
555:
556: function sopt(va,text) {
557: selwrite('<option value="'+va+'"');
1.2 www 558: if (va==pscat) {
1.1 www 559: selwrite(' selected');
560: }
561: selwrite('>'+text+'</option>');
562: }
563:
564: function catchange() {
565: var sform=selector.document.forms.fsel.fcat;
1.2 www 566: pscat=sform.options[sform.selectedIndex].value;
1.1 www 567: draw();
568: }
569:
570: function assemble() {
1.2 www 571: if ((ptype=='date') && (pscat!='interval')) {
572: svalue=Math.round(cdate.getTime()/1000);
573: }
1.12 www 574: if (ptype=='tolerance') {
575: if (pscat=='relative_sym') {
576: svalue=choices.document.forms.sch.val2.value+'%';
577: if (choices.document.forms.sch.val3.checked) {
578: svalue+='+';
579: }
580: }
581: if (pscat=='absolute_sym') {
582: svalue=choices.document.forms.sch.val2.value;
583: if (choices.document.forms.sch.val3.checked) {
584: svalue+='+';
585: }
586: }
587: if (pscat=='absolute') {
588: svalue=choices.document.forms.sch.val2.value;
589: if (choices.document.forms.sch.val3.checked) {
590: svalue+='+';
591: }
592: svalue+=','+choices.document.forms.sch.val4.value;
593: if (choices.document.forms.sch.val5.checked) {
594: svalue+='+';
595: }
596: }
597: if (pscat=='relative') {
598: svalue=choices.document.forms.sch.val2.value+'%';
599: if (choices.document.forms.sch.val3.checked) {
600: svalue+='+';
601: }
602: svalue+=','+choices.document.forms.sch.val4.value+'%';
603: if (choices.document.forms.sch.val5.checked) {
604: svalue+='+';
605: }
606: }
1.14 www 607: }
608: if ((ptype=='int') && (pscat=='range')) {
609: svalue=choices.document.forms.sch.val2.value+','+
610: choices.document.forms.sch.val4.value;
1.12 www 611: }
1.6 www 612: if (pscat=='default') { svalue=''; }
1.2 www 613: stype=ptype+'_'+pscat;
1.1 www 614: }
615:
616:
617: function init() {
618: var i;
1.2 www 619: var subs=new Array();
1.1 www 620: var namevalue=this.window.location.search.split('&');
621: namevalue[0]=namevalue[0].substr(1,namevalue[0].length-1);
622:
623: for (i=0;i<namevalue.length;i++) {
624: var pair=namevalue[i].split('=');
1.3 www 625: pair[1]=unescape(pair[1]);
1.1 www 626: if (pair[0]=='value') { pvalue=pair[1]; }
1.2 www 627: if (pair[0]=='type') { subs=pair[1].split('_');
628: ptype=subs[0];
629: pscat=subs[1];
1.11 www 630: if (typeof(subs[2])!="undefined") {
631: pscat+='_'+subs[2];
632: }
633: if ((pscat=='') || (typeof(pscat)=="undefined")) {
1.6 www 634: pscat='default';
635: }
1.2 www 636: }
1.1 www 637: if (pair[0]=='return') { preturn=pair[1]; }
638: if (pair[0]=='call') { pcode=pair[1]; }
1.2 www 639: if (pair[0]=='marker') { pmarker=pair[1]; }
1.1 www 640: if (pair[0]=='name') { pname=pair[1]; }
641: }
642:
643: svalue=pvalue;
1.6 www 644: if (((ptype=='float') || (ptype=='string') || (ptype=='int')) &&
645: (pscat=='default') &&
1.11 www 646: (typeof(svalue)!="undefined") &&
647: (svalue!=0) && (svalue!='')) { pscat='any'; }
1.1 www 648:
1.13 www 649: if (ptype=='tolerance') {
650: var tperc=0;
651: var trange=0;
652: if (typeof(svalue)!='undefined') {
653: if (svalue.indexOf('%')!=-1) { tperc=1; }
654: if (svalue.indexOf(',')!=-1) { trange=1; }
655: if (trange) {
656: if (tperc) { pscat='relative'; } else { pscat='absolute'; }
657: } else {
658: if (tperc) { pscat='relative_sym'; } else { pscat='absolute_sym'; }
659: }
660: }
661: }
662:
1.1 www 663: this.window.selector.document.clear();
664: selwrite('<html><body bgcolor="#FFFFFF">');
665:
1.8 www 666: selwrite('<form name="fsel"><b>'+pname+'</b><br>');
1.1 www 667: selwrite('<select name="fcat" onChange="parent.catchange();">');
1.12 www 668:
1.1 www 669: if (ptype=='tolerance') {
670: sopt('default','Default');
671: sopt('relative_sym','Relative Tolerance, Symmetric (percent)');
672: sopt('relative','Relative Tolerance (percentages)');
673: sopt('absolute_sym','Absolute Tolerance, Symmetric (value)');
674: sopt('absolute','Absolute Tolerance (values)');
675: }
676:
677: if (ptype=='date') {
678: sopt('default','Default');
679: sopt('start','Starting Date');
680: sopt('end','Ending Date');
1.2 www 681: sopt('interval','Time Interval');
682:
1.11 www 683: if ((pvalue!='') && (typeof(pvalue)!="undefined")) {
1.2 www 684: cdate.setTime(pvalue*1000);
685: }
686:
687: months[0]='January';
688: months[1]='February';
689: months[2]='March';
690: months[3]='April';
691: months[4]='May';
692: months[5]='June';
693: months[6]='July';
694: months[7]='August';
695: months[8]='September';
696: months[9]='October';
697: months[10]='November';
698: months[11]='December';
1.1 www 699: }
1.2 www 700:
1.6 www 701: if (ptype=='int') {
702: sopt('default','Default');
703: sopt('pos','Positive Integer, Not Zero');
704: sopt('zeropos','Positive Integer or Zero');
1.13 www 705: sopt('inrange','Integer in Range');
706: sopt('range','Range of Integers');
1.6 www 707: sopt('any','Integer');
1.1 www 708: }
709:
1.6 www 710: if (ptype=='float') {
711: sopt('default','Default');
712: sopt('zeroone','Floating Point between 0 and 1');
713: sopt('pos','Positive Floating Point');
714: sopt('any','Floating Point');
1.1 www 715:
716: }
717:
1.6 www 718: if (ptype=='string') {
719: sopt('default','Default');
720: sopt('string','String Value');
1.22 ! www 721: }
! 722:
! 723: if (ptype=='color') {
! 724: sopt('default','Use Default Color');
! 725: sopt('custom','Use Custom Color');
1.1 www 726: }
727:
728: selwrite('</select></form>');
729:
1.2 www 730: selwrite('<a href="javascript:parent.assemble();');
1.1 www 731: if (preturn!='') {
1.4 www 732: selwrite(
733: 'parent.opener.document.'+preturn+'_value.value=parent.window.svalue;');
734: selwrite(
735: 'parent.opener.document.'+preturn+'_type.value=parent.window.stype;');
1.2 www 736: }
737: if (pmarker!='') {
1.4 www 738: selwrite(
739: 'parent.opener.document.'+preturn+'_marker.value=parent.window.pmarker;');
1.1 www 740: }
741: if (pcode!='') {
1.4 www 742: selwrite('parent.opener.'+pcode+'();');
1.1 www 743: }
1.4 www 744: selwrite('">Store</a> ');
1.5 www 745:
746: selwrite('<a href="javascript:');
747: selwrite(
748: 'parent.opener.document.'+preturn+'_value.value='+"'';");
749: if (pmarker!='') {
750: selwrite(
751: 'parent.opener.document.'+preturn+'_marker.value=parent.window.pmarker;');
752: }
753: if (pcode!='') {
754: selwrite('parent.opener.'+pcode+'();');
755: }
756: selwrite('">Delete</a> ');
1.4 www 757:
758: selwrite('<a href="javascript:');
1.17 matthew 759: // Old code :
760: //----------------------------------------------------------------------
761: // if (preturn!='') {
762: // selwrite('parent.opener.document.'+preturn+'_value.value='+"'';");
763: // selwrite('parent.opener.document.'+preturn+'_type.value='+"'';");
764: // }
765: // if (pmarker!='') {
766: // selwrite('parent.opener.document.'+preturn+'_marker.value='+"'';");
767: // }
768: // if (pcode!='') {
769: // selwrite('parent.opener.'+pcode+'();');
770: // }
771: //----------------------------------------------------------------------
772: // Just close the window to 'cancel' the operation. There are javascript
773: // errors in the above commented out code that I have not been able to
774: // track down. I think they reside in 'parent.opener.'+pcode+'();'
775: //
776: selwrite('this.parent.close();');
1.4 www 777: selwrite('">Cancel</a>');
1.1 www 778:
779: selwrite('</body></html>');
780: this.window.selector.document.close();
1.2 www 781: draw();
1.1 www 782:
783: }
784:
785: </script>
786:
1.2 www 787: <frameset rows="120,*" onLoad="init();">
1.1 www 788: <frame name=selector src="empty.html">
789: <frame name=choices src="empty.html">
790: </frameset>
791:
792:
793:
1.16 albertel 794: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>