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