Annotation of rat/client/parameter.html, revision 1.20
1.1 www 1: <html>
2: <!--
3: The LearningOnline Network with CAPA
4: Parameter Input Window
1.16 albertel 5: //
1.20 ! harris41 6: // $Id: parameter.html,v 1.19 2002/10/25 13:47:37 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: }
318:
1.1 www 319: function draw() {
320: choicestart();
1.6 www 321: choicewrite('<form name=sch');
322: if (ptype=='int') {
323: choicewrite(' action="javascript:integereval();"');
324: }
325: if (ptype=='float') {
326: choicewrite(' action="javascript:floateval();"');
327: }
328: if (ptype=='string') {
329: choicewrite(' action="javascript:stringeval();"');
330: }
331: choicewrite('>');
1.1 www 332: if (ptype=='tolerance') {
1.2 www 333: // 0: pscat
334: if (pscat=='default') {
1.1 www 335: tablestart('Use default value or algorithm of resource');
336: }
1.2 www 337: if (pscat=='relative_sym') {
1.1 www 338: // 2: percentage
339: // 3: open
340: tablestart('Percentage error, symmetric around value');
341: valline('Percentage',2,3);
1.13 www 342: if ((svalue!='') && (typeof(svalue)!="undefined")) {
343: choices.document.forms.sch.val2.value=parseInt(svalue);
344: if (svalue.indexOf('+')!=-1) {
345: choices.document.forms.sch.val3.checked=true;
346: }
347: }
1.1 www 348: }
1.2 www 349: if (pscat=='relative') {
1.1 www 350: // 2: left
351: // 3: open
352: // 4: right
353: // 5: open
354: tablestart('Percentage error, asymmetric around value');
355: valline('Upper percentage',2,3);
356: valline('Lower percentage',4,5);
1.17 matthew 357: var range1=new Array;
1.13 www 358: if ((svalue!='') && (typeof(svalue)!="undefined")) {
1.17 matthew 359: range1=svalue.split(',');
360: if (typeof(range1[1])=='undefined') { range1[1]=range1[0]; }
361: choices.document.forms.sch.val2.value=parseFloat(range1[0]);
362: if (range1[0].indexOf('+')!=-1) {
1.13 www 363: choices.document.forms.sch.val3.checked=true;
364: }
1.17 matthew 365: choices.document.forms.sch.val4.value=parseFloat(range1[1]);
366: if (range1[1].indexOf('+')!=-1) {
1.13 www 367: choices.document.forms.sch.val5.checked=true;
368: }
369: }
1.1 www 370: }
1.2 www 371: if (pscat=='absolute_sym') {
1.1 www 372: tablestart('Absolute error, symmetric around value');
373: valline('Value',2,3);
1.13 www 374: if ((svalue!='') && (typeof(svalue)!="undefined")) {
1.15 www 375: choices.document.forms.sch.val2.value=parseFloat(svalue);
1.13 www 376: if (svalue.indexOf('+')!=-1) {
377: choices.document.forms.sch.val3.checked=true;
378: }
379: }
1.1 www 380: }
1.2 www 381: if (pscat=='absolute') {
1.1 www 382: tablestart('Absolute error, asymmetric around value');
383: valline('Upper value',2,3);
384: valline('Lower value',4,5);
1.17 matthew 385: var range2=new Array;
1.13 www 386: if ((svalue!='') && (typeof(svalue)!="undefined")) {
387: range=svalue.split(',');
1.17 matthew 388: if (typeof(range2[1])=='undefined') { range2[1]=range2[0]; }
389: choices.document.forms.sch.val2.value=parseFloat(range2[0]);
390: if (range2[0].indexOf('+')!=-1) {
1.13 www 391: choices.document.forms.sch.val3.checked=true;
392: }
1.17 matthew 393: choices.document.forms.sch.val4.value=parseFloat(range2[1]);
394: if (range2[1].indexOf('+')!=-1) {
1.13 www 395: choices.document.forms.sch.val5.checked=true;
396: }
397: }
1.1 www 398: }
399: }
400:
401: if (ptype=='date') {
1.2 www 402: if (pscat=='default') {
403: tablestart('Default value or none');
404: choicewrite('</table>');
405: } else {
406: if (pscat=='start') {
407: tablestart('Starting or opening date and time');
408: }
409: if (pscat=='end') {
410: tablestart('Ending or closing date and time');
411: }
412: if (pscat=='interval') {
413: tablestart('Time interval');
414: choicewrite('<tr bgcolor="#AAFFAA"><td colspan=3>');
415: intervaldis();
416: choicewrite('</td></tr><tr bgcolor="#AAFFAA"><td>Time:'
417: +'</td><td colspan=2>');
418: intday();choicewrite('days ');
419: inthour();choicewrite('hours ');
420: intminute(); choicewrite('mins '); intsecond();
421: choicewrite('secs</td></tr></table>');
422: } else {
423: choicewrite('<tr bgcolor="#AAFFAA"><td colspan=3>'
424: +cdate.toString()+
425: '</td></tr><tr bgcolor="#AAFFAA"><td>Date:</td><td colspan=2>');
426: month();date();year();
427: choicewrite('</td></tr><tr bgcolor="#AAFFAA"><td>Time:'
428: +'</td><td colspan=2>');hour();choicewrite('h ');minute();
429: choicewrite('m ');second();
430: choicewrite('s</td></tr></table>');
431: }
432: }
1.1 www 433: }
434:
1.6 www 435: if (ptype=='int') {
1.19 www 436: var pscatparts=new Array;
437: pscatparts=pscat.split(',');
438: pscat=pscatparts[0];
1.6 www 439: if (pscat=='default') {
440: tablestart('Default value or none');
1.14 www 441: choicewrite('</table>');
1.6 www 442: } else {
1.14 www 443: if (pscat=='range') {
444: tablestart('Integer range');
445: choicewrite('<tr bgcolor="#AAFFAA"><td>Lower Value:'+
446: '</td><td colspan=2><input type=text size=4 name=val2'+
447: '></td></tr>');
448: choicewrite('<tr bgcolor="#AAFFAA"><td>Upper Value:'+
449: '</td><td colspan=2><input type=text size=4 name=val4'+
450: '></td></tr></table>');
451: var range=new Array;
452: if ((svalue!='') && (typeof(svalue)!="undefined")) {
453: range=svalue.split(',');
454: if (typeof(range[1])=='undefined') { range[1]=range[0]; }
455: choices.document.forms.sch.val2.value=parseInt(range[0]);
456: choices.document.forms.sch.val4.value=parseInt(range[1]);
457: }
458: } else {
1.6 www 459: if (pscat=='pos') {
460: tablestart('Positive (non-zero) integer');
461: }
462: if (pscat=='zeropos') {
463: tablestart('Positive integer or zero');
464: }
1.12 www 465: if (pscat.indexOf('inrange')!=-1) {
1.10 www 466: var rangeparts=new Array;
1.12 www 467: rangeparts=split(',',pscat);
1.10 www 468: tablestart('Integer in the range ['+rangeparts[1]+']');
469: }
1.6 www 470: if (pscat=='any') {
471: tablestart('Integer');
472: }
473: choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
474: choicewrite('<input name=intval size=10 value="'+svalue+
475: '" name=intval onChange="parent.integereval()">');
476: choicewrite('</td></table>');
477: }
1.14 www 478: }
1.1 www 479: }
480:
1.6 www 481: if (ptype=='float') {
482: if (pscat=='default') {
483: tablestart('Default value or none');
484: choicewrite('</table>');
485: } else {
486: if (pscat=='pos') {
487: tablestart('Positive floating point number or zero');
488: }
489: if (pscat=='zeroone') {
490: tablestart('Floating point number between zero and one');
491: }
492: if (pscat=='any') {
493: tablestart('Floating point number');
494: }
495: choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
496: choicewrite('<input name=floatval size=10 value="'+svalue+
497: '" name=floatval onChange="parent.floateval()">');
498: choicewrite('</td></table>');
499: }
1.1 www 500: }
501:
1.6 www 502: if (ptype=='string') {
503: if (pscat=='default') {
504: tablestart('Default value or none');
505: choicewrite('</table>');
506: } else {
507: if (pscat=='any') {
508: tablestart('Text');
509: }
510: choicewrite('<tr bgcolor="#AAFFAA"><td>Value:</td><td colspan=2>');
1.18 albertel 511: choicewrite('<input name=stringval size=20 value="'+svalue+
1.6 www 512: '" name=stringval onChange="parent.stringeval()">');
513: choicewrite('</td></table>');
514: }
1.1 www 515: }
516:
517: choicewrite('</table></form>');
518: choiceend();
519: }
520:
521: function sopt(va,text) {
522: selwrite('<option value="'+va+'"');
1.2 www 523: if (va==pscat) {
1.1 www 524: selwrite(' selected');
525: }
526: selwrite('>'+text+'</option>');
527: }
528:
529: function catchange() {
530: var sform=selector.document.forms.fsel.fcat;
1.2 www 531: pscat=sform.options[sform.selectedIndex].value;
1.1 www 532: draw();
533: }
534:
535: function assemble() {
1.2 www 536: if ((ptype=='date') && (pscat!='interval')) {
537: svalue=Math.round(cdate.getTime()/1000);
538: }
1.12 www 539: if (ptype=='tolerance') {
540: if (pscat=='relative_sym') {
541: svalue=choices.document.forms.sch.val2.value+'%';
542: if (choices.document.forms.sch.val3.checked) {
543: svalue+='+';
544: }
545: }
546: if (pscat=='absolute_sym') {
547: svalue=choices.document.forms.sch.val2.value;
548: if (choices.document.forms.sch.val3.checked) {
549: svalue+='+';
550: }
551: }
552: if (pscat=='absolute') {
553: svalue=choices.document.forms.sch.val2.value;
554: if (choices.document.forms.sch.val3.checked) {
555: svalue+='+';
556: }
557: svalue+=','+choices.document.forms.sch.val4.value;
558: if (choices.document.forms.sch.val5.checked) {
559: svalue+='+';
560: }
561: }
562: if (pscat=='relative') {
563: svalue=choices.document.forms.sch.val2.value+'%';
564: if (choices.document.forms.sch.val3.checked) {
565: svalue+='+';
566: }
567: svalue+=','+choices.document.forms.sch.val4.value+'%';
568: if (choices.document.forms.sch.val5.checked) {
569: svalue+='+';
570: }
571: }
1.14 www 572: }
573: if ((ptype=='int') && (pscat=='range')) {
574: svalue=choices.document.forms.sch.val2.value+','+
575: choices.document.forms.sch.val4.value;
1.12 www 576: }
1.6 www 577: if (pscat=='default') { svalue=''; }
1.2 www 578: stype=ptype+'_'+pscat;
1.1 www 579: }
580:
581:
582: function init() {
583: var i;
1.2 www 584: var subs=new Array();
1.1 www 585: var namevalue=this.window.location.search.split('&');
586: namevalue[0]=namevalue[0].substr(1,namevalue[0].length-1);
587:
588: for (i=0;i<namevalue.length;i++) {
589: var pair=namevalue[i].split('=');
1.3 www 590: pair[1]=unescape(pair[1]);
1.1 www 591: if (pair[0]=='value') { pvalue=pair[1]; }
1.2 www 592: if (pair[0]=='type') { subs=pair[1].split('_');
593: ptype=subs[0];
594: pscat=subs[1];
1.11 www 595: if (typeof(subs[2])!="undefined") {
596: pscat+='_'+subs[2];
597: }
598: if ((pscat=='') || (typeof(pscat)=="undefined")) {
1.6 www 599: pscat='default';
600: }
1.2 www 601: }
1.1 www 602: if (pair[0]=='return') { preturn=pair[1]; }
603: if (pair[0]=='call') { pcode=pair[1]; }
1.2 www 604: if (pair[0]=='marker') { pmarker=pair[1]; }
1.1 www 605: if (pair[0]=='name') { pname=pair[1]; }
606: }
607:
608: svalue=pvalue;
1.6 www 609: if (((ptype=='float') || (ptype=='string') || (ptype=='int')) &&
610: (pscat=='default') &&
1.11 www 611: (typeof(svalue)!="undefined") &&
612: (svalue!=0) && (svalue!='')) { pscat='any'; }
1.1 www 613:
1.13 www 614: if (ptype=='tolerance') {
615: var tperc=0;
616: var trange=0;
617: if (typeof(svalue)!='undefined') {
618: if (svalue.indexOf('%')!=-1) { tperc=1; }
619: if (svalue.indexOf(',')!=-1) { trange=1; }
620: if (trange) {
621: if (tperc) { pscat='relative'; } else { pscat='absolute'; }
622: } else {
623: if (tperc) { pscat='relative_sym'; } else { pscat='absolute_sym'; }
624: }
625: }
626: }
627:
1.1 www 628: this.window.selector.document.clear();
629: selwrite('<html><body bgcolor="#FFFFFF">');
630:
1.8 www 631: selwrite('<form name="fsel"><b>'+pname+'</b><br>');
1.1 www 632: selwrite('<select name="fcat" onChange="parent.catchange();">');
1.12 www 633:
1.1 www 634: if (ptype=='tolerance') {
635: sopt('default','Default');
636: sopt('relative_sym','Relative Tolerance, Symmetric (percent)');
637: sopt('relative','Relative Tolerance (percentages)');
638: sopt('absolute_sym','Absolute Tolerance, Symmetric (value)');
639: sopt('absolute','Absolute Tolerance (values)');
640: }
641:
642: if (ptype=='date') {
643: sopt('default','Default');
644: sopt('start','Starting Date');
645: sopt('end','Ending Date');
1.2 www 646: sopt('interval','Time Interval');
647:
1.11 www 648: if ((pvalue!='') && (typeof(pvalue)!="undefined")) {
1.2 www 649: cdate.setTime(pvalue*1000);
650: }
651:
652: months[0]='January';
653: months[1]='February';
654: months[2]='March';
655: months[3]='April';
656: months[4]='May';
657: months[5]='June';
658: months[6]='July';
659: months[7]='August';
660: months[8]='September';
661: months[9]='October';
662: months[10]='November';
663: months[11]='December';
1.1 www 664: }
1.2 www 665:
1.6 www 666: if (ptype=='int') {
667: sopt('default','Default');
668: sopt('pos','Positive Integer, Not Zero');
669: sopt('zeropos','Positive Integer or Zero');
1.13 www 670: sopt('inrange','Integer in Range');
671: sopt('range','Range of Integers');
1.6 www 672: sopt('any','Integer');
1.1 www 673: }
674:
1.6 www 675: if (ptype=='float') {
676: sopt('default','Default');
677: sopt('zeroone','Floating Point between 0 and 1');
678: sopt('pos','Positive Floating Point');
679: sopt('any','Floating Point');
1.1 www 680:
681: }
682:
1.6 www 683: if (ptype=='string') {
684: sopt('default','Default');
685: sopt('string','String Value');
1.1 www 686: }
687:
688: selwrite('</select></form>');
689:
1.2 www 690: selwrite('<a href="javascript:parent.assemble();');
1.1 www 691: if (preturn!='') {
1.4 www 692: selwrite(
693: 'parent.opener.document.'+preturn+'_value.value=parent.window.svalue;');
694: selwrite(
695: 'parent.opener.document.'+preturn+'_type.value=parent.window.stype;');
1.2 www 696: }
697: if (pmarker!='') {
1.4 www 698: selwrite(
699: 'parent.opener.document.'+preturn+'_marker.value=parent.window.pmarker;');
1.1 www 700: }
701: if (pcode!='') {
1.4 www 702: selwrite('parent.opener.'+pcode+'();');
1.1 www 703: }
1.4 www 704: selwrite('">Store</a> ');
1.5 www 705:
706: selwrite('<a href="javascript:');
707: selwrite(
708: 'parent.opener.document.'+preturn+'_value.value='+"'';");
709: if (pmarker!='') {
710: selwrite(
711: 'parent.opener.document.'+preturn+'_marker.value=parent.window.pmarker;');
712: }
713: if (pcode!='') {
714: selwrite('parent.opener.'+pcode+'();');
715: }
716: selwrite('">Delete</a> ');
1.4 www 717:
718: selwrite('<a href="javascript:');
1.17 matthew 719: // Old code :
720: //----------------------------------------------------------------------
721: // if (preturn!='') {
722: // selwrite('parent.opener.document.'+preturn+'_value.value='+"'';");
723: // selwrite('parent.opener.document.'+preturn+'_type.value='+"'';");
724: // }
725: // if (pmarker!='') {
726: // selwrite('parent.opener.document.'+preturn+'_marker.value='+"'';");
727: // }
728: // if (pcode!='') {
729: // selwrite('parent.opener.'+pcode+'();');
730: // }
731: //----------------------------------------------------------------------
732: // Just close the window to 'cancel' the operation. There are javascript
733: // errors in the above commented out code that I have not been able to
734: // track down. I think they reside in 'parent.opener.'+pcode+'();'
735: //
736: selwrite('this.parent.close();');
1.4 www 737: selwrite('">Cancel</a>');
1.1 www 738:
739: selwrite('</body></html>');
740: this.window.selector.document.close();
1.2 www 741: draw();
1.1 www 742:
743: }
744:
745: </script>
746:
1.2 www 747: <frameset rows="120,*" onLoad="init();">
1.1 www 748: <frame name=selector src="empty.html">
749: <frame name=choices src="empty.html">
750: </frameset>
751:
752:
753:
1.16 albertel 754: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>