]> matita.cs.unibo.it Git - helm.git/blob - helm/searchEngine/html/pdq.html
9088ad49585350eecd3bedbcaba73fc9d4bb4b7c
[helm.git] / helm / searchEngine / html / pdq.html
1 <HTML>
2 <HEAD>
3 <SCRIPT language="Javascript">
4 var mcq="";
5 var toq=0;
6 alist=new Array(10);
7 var calias=0;
8 function armageddon()
9         {
10         top.initialize();
11         top.window.open(top.topurl+"/getpage?url=start.html","qw");
12         top.window.open(top.topurl+"/getpage?url=blank.html","cw");
13         top.window.open(top.topurl+"/getpage?url=blank.html","hw");
14         top.window.open(top.topurl+"/getpage?url=blank.html","gw");
15         top.window.open(top.topurl+"/getpage?url=blank.html","sw");
16         }
17 function idcheck(ident)
18         {
19         lettera=/[a-zA-Z]/;
20         partediid=/[a-zA-Z0-9_\-\']/;
21         if (!lettera.test(ident.charAt(0))){alert("an Id must begin with a letter.");return(0)}
22         while (ident.length>0)
23                 {
24                 ident=ident.substring(1,(ident.length));
25                 if (ident.length>0){
26                 if (!partediid.test(ident.charAt(0))){alert(ident.charAt(0)+" is not a valid character for an Id.");return(0);}
27                 }}
28         return(1)
29         }
30 function uricheck(ident)
31         {
32         cifra=/[0-9]/
33         cic=ident.substring(0,5);//alert(cic);
34         if (cic!="cic:/"){alert("an Uri must begin with the string 'cic:/'");return(0);}
35         ident=ident.substring(5,ident.length);//alert(ident);
36         if (ident.indexOf(".")<0){alert("an Uri must contain a '.'");return(0);}
37         ident1=ident.substring(0,ident.indexOf("."));//alert(ident1);
38         ident2=ident.substring(ident.indexOf(".")+1,ident.length);//alert(ident2);
39         while (ident1.length>0)
40                 {       
41                 if (ident1.indexOf("/")>-1)             
42                         {
43                         if (idcheck(ident1.substring(0,ident1.indexOf("/")))==0){return (0)}
44                         ident1=ident1.substring(ident1.indexOf("/")+1,ident1.length);//alert(ident1);
45                         }
46                 else {if (idcheck(ident1)==0){return (0)}       
47                         ident1="";}
48                 }
49         if (ident2=="con"||ident2=="var"){return(1)}
50         if (ident2.substring(0,6)!="ind#1/"){alert ("syntax error in the Uri.");return(0);}
51         ident2=ident2.substring(6,ident2.length);//alert(ident2);
52         if (!cifra.test(ident2.charAt(0))){alert ("syntax error in the Uri.");return(0);}
53         if (ident2.indexOf("/")>-1)
54                 {
55                 while (ident2.charAt(0)!="/")
56                         {
57                         //alert(ident2);
58                         if (!cifra.test(ident2.charAt(0))){alert ("syntax error in the Uri.");return(0);}
59                         ident2=ident2.substring(1,ident2.length);
60                         }
61                 }
62         while (ident2.length>0)
63                 {
64                 //alert(ident2);
65                 ident2=ident2.substring(1,ident2.length);
66                 if (ident2.length>0){
67                 if (!cifra.test(ident2.charAt(0))){alert ("syntax error in the Uri.");return(0);}
68                 }}
69         
70         return(1)
71         }
72 function aggiorna()
73         {
74         window.open(top.topurl+"/getpage?url=aliaslist.html","bw");
75         top.cw.bw.document.aliaslist.idi.focus();
76         }
77 function aggiorna2()
78         {
79         window.open(top.topurl+"/getpage?url=expnamedsubst.html","bw");
80         bw.document.aliaslist.varid.focus();
81         }
82 function parse() 
83         {
84         //alert(mcq);
85         calias=0;
86         if (mcq.indexOf("[")>-1)
87                 {
88                 mcq=mcq.replace("[","<font color=\"#ff0000\">[");
89                 mcq=mcq.replace("]","]</font>");
90                 top.qw.document.close();
91                 top.qw.document.write(mcq);
92                 if (mcq.charAt(mcq.indexOf("[")+1)=="A")
93                         {
94                         window.open(top.topurl+"/getpage?url=aliaslist.html","bw")
95                         }
96                 if (mcq.charAt(mcq.indexOf("[")+1)=="E")
97                         {
98                         window.open(top.topurl+"/getpage?url=expr.html","bw")
99                         }
100                 if (mcq.charAt(mcq.indexOf("[")+1)=="G")
101                         {
102                         window.open(top.topurl+"/getpage?url=genid.html","bw")
103                         }
104                 if (mcq.charAt(mcq.indexOf("[")+1)=="e")
105                         {
106                         window.open(top.topurl+"/getpage?url=expnamedsubst.html","bw")
107                         }
108                 }
109                 else 
110                         {
111                         while (mcq.indexOf("&gt;")>-1)
112                                 {
113                                 mcq=mcq.replace("&gt;",">");
114                                 }
115                         top.window.sw.editexpr(mcq);
116                         window.open(top.topurl+"/getpage?url=blank.html","bw");
117                         window.open(top.topurl+"/getpage?url=blank.html","qw");
118                         }
119         }       
120 function aggq()
121         {
122         parse(mcq);
123         //top.qw.document.write(mcq);   
124         }
125 </SCRIPT>
126 </HEAD>
127 <script>
128   document.write(' <frameset rows="24%,76%" border="0" noresize> <frame name=tw src="'+top.topurl+'/getpage?url=query_choice.html";> <frame name=bw src="'+top.topurl+'/getpage?url=blank.html";> </frameset> ');
129 </script>
130 </HTML>