]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/searchEngine/html/index.html
Many changes in the client-side interfaces:
[helm.git] / helm / searchEngine / html / index.html
index d26024e56a08d6b045a812c32eb5f2f87d5d74a7..8cb492b1360cd39b4d98d6b794cfdebe24c585a0 100644 (file)
@@ -46,13 +46,15 @@ function help(w) // quando invocata, visualizza l' help relativo ad un oggetto.
        {
        hw.document.close();
        switch (w)      {
+                       case -10: hw.document.write("Insert an <a href=grammarpdq.html#Id target=gw>Id</a> or an <a href=grammarpdq.html#Uri target=gw>Uri</a> here.")
+                               break;
                        case -9: hw.document.write("By clicking this you may add or remove aliases as you wish.")
                                break;
                        case -81: hw.document.write("Allows you to recover your last input")
                                break;
                        case -8: hw.document.write("Allows you to delete your last input")
                                break;
-                       case -7: hw.document.write("Erases your query and starts a new pre-defined query.")
+                       case -7: hw.document.write("Erases your query and starts a new pre-defined query, you will keep your list of aliases.")
                                break;
                        case -6: hw.document.write("Puts this string in the current cursor position. This button works only with Internet Explorer.")
                                break;
@@ -98,6 +100,61 @@ function tpa(quotpath)
                {quotpath=quotpath.replace(">","&gt;");}
        return (quotpath);
        }
+function idcheck(ident)
+       {
+       lettera=/[a-zA-Z]/;
+       partediid=/[a-zA-Z0-9_\-\']/;
+       if (!lettera.test(ident.charAt(0))){alert("an Id must begin with a letter.");return(0)}
+       while (ident.length>0)
+               {
+               ident=ident.substring(1,(ident.length));
+               if (ident.length>0){
+               if (!partediid.test(ident.charAt(0))){alert(ident.charAt(0)+" is not a valid character for an Id.");return(0);}
+               }}
+       return(1)
+       }
+function uricheck(ident)
+       {
+       cifra=/[0-9]/
+       cic=ident.substring(0,5);//alert(cic);
+       if (cic!="cic:/"){alert("an Uri must begin with the string 'cic:/'");return(0);}
+       ident=ident.substring(5,ident.length);//alert(ident);
+       if (ident.indexOf(".")<0){alert("an Uri must contain a '.'");return(0);}
+       ident1=ident.substring(0,ident.indexOf("."));//alert(ident1);
+       ident2=ident.substring(ident.indexOf(".")+1,ident.length);//alert(ident2);
+       while (ident1.length>0)
+               {       
+               if (ident1.indexOf("/")>-1)             
+                       {
+                       if (idcheck(ident1.substring(0,ident1.indexOf("/")))==0){return (0)}
+                       ident1=ident1.substring(ident1.indexOf("/")+1,ident1.length);//alert(ident1);
+                       }
+               else {if (idcheck(ident1)==0){return (0)}       
+                       ident1="";}
+               }
+       if (ident2=="con"||ident2=="var"){return(1)}
+       if (ident2.substring(0,6)!="ind#1/"){alert ("syntax error in the Uri.");return(0);}
+       ident2=ident2.substring(6,ident2.length);//alert(ident2);
+       if (!cifra.test(ident2.charAt(0))){alert ("syntax error in the Uri.");return(0);}
+       if (ident2.indexOf("/")>-1)
+               {
+               while (ident2.charAt(0)!="/")
+                       {
+                       //alert(ident2);
+                       if (!cifra.test(ident2.charAt(0))){alert ("syntax error in the Uri.");return(0);}
+                       ident2=ident2.substring(1,ident2.length);
+                       }
+               }
+       while (ident2.length>0)
+               {
+               //alert(ident2);
+               ident2=ident2.substring(1,ident2.length);
+               if (ident2.length>0){
+               if (!cifra.test(ident2.charAt(0))){alert ("syntax error in the Uri.");return(0);}
+               }}
+       
+       return(1)
+       }
 function gramcheck(how,what) // esegue il controllo sintattico sulla stringa "what", controllando che rispetti i requisiti indicati dalla clausola "how". Se qualcosa non รจ ok, la variabile "wrong" viene posta ad 1 e la stringa da aggiungere viene ignorata, mentre viene visualizzato un apposito messaggio di errore.             
        {
        var slash=0;
@@ -214,12 +271,12 @@ function aggcw() // invocata automaticamente ad ogni modifica della variabile "q
                        ltr=pq.slice(pq.indexOf("[?"));
                        ltr=ltr.substring(ltr.indexOf("[?"),(ltr.length-ltr.indexOf("[?"))-(ltr.length-ltr.indexOf("]")-1));
                        wto=ltr.substring(2,5);
-                       if (wto=="set") {window.open(top.topurl+"/getpage?url=set.html","cw");pq="";}
-                       else if (wto=="val") {window.open(top.topurl+"/getpage?url=val.html","cw");pq="";}
-                       else if (wto=="bol") {window.open(top.topurl+"/getpage?url=boole.html","cw");pq="";}
+                       if (wto=="set") {window.open(top.topurl+action+"set.html","cw");pq="";}
+                       else if (wto=="val") {window.open(top.topurl+action+"val.html","cw");pq="";}
+                       else if (wto=="bol") {window.open(top.topurl+action+"boole.html","cw");pq="";}
                        else pq=pq.substring(pq.indexOf("[?")+2,pq.length);
                        }
-               else {window.open(top.topurl+"/getpage?url=blank.html","cw");pq="";}
+               else {window.open(top.topurl+action+"blank.html","cw");pq="";}
                } 
        }
 function aggform() // aggiorna il form nel frame centrale. Invocata ad ogni cambio della variabile "query".
@@ -293,7 +350,7 @@ function annulla()
                qw.document.write(query);
                aggform();
                sw.apply();
-               if (query=="*"){cw.location=top.topurl+"/getpage?url=set.html";ltr="*";} else {aggcw();}
+               if (query=="*"){cw.location=top.topurl+action+"set.html";ltr="*";} else {aggcw();}
                cw.focus();
                }
        }
@@ -302,34 +359,34 @@ function parse() // prende la stringa che si sta tentando di inserire nella quer
        while (fb.indexOf("[set]")>-1){
        if (fb.indexOf("set")>0)
                {
-      fb=fb.replace("[set]","<A HREF="+top.topurl+"/getpage?url=set.html target=cw onclick=top.savelink("+top.storeps+",'s')>[?set"+top.storeps+"]</A>");
+      fb=fb.replace("[set]","<A HREF="+top.topurl+action+"set.html target=cw onclick=top.savelink("+top.storeps+",'s')>[?set"+top.storeps+"]</A>");
                top.storeps++;
                }
                                         }
        while (fb.indexOf("[val]")>-1){
        if (fb.indexOf("val")>0)
                {
-      fb=fb.replace("[val]","<A HREF="+top.topurl+"/getpage?url=val.html target=cw onclick=top.savelink("+top.storepv+",'v')>[?val"+top.storepv+"]</A>");
+      fb=fb.replace("[val]","<A HREF="+top.topurl+action+"val.html target=cw onclick=top.savelink("+top.storepv+",'v')>[?val"+top.storepv+"]</A>");
                top.storepv++;
                }
                                         }
        while (fb.indexOf("[boole]")>-1){
        if (fb.indexOf("boole")>0)
                {
-               fb=fb.replace("[boole]","<A HREF="+top.topurl+"/getpage?url=boole.html target=cw onclick=top.savelink("+top.storepb+",'b')>[?bol"+top.storepb+"]</A>");
+               fb=fb.replace("[boole]","<A HREF="+top.topurl+action+"boole.html target=cw onclick=top.savelink("+top.storepb+",'b')>[?bol"+top.storepb+"]</A>");
                top.storepb++;
                }
                                         }
        }
 function aggq() // aggiorna la query sostituendo l' ultimo link editato con la stringa inserita, poi aggiorna tutti i frame.
        {
-       //window.open(top.topurl+"/getpage?url=summary.html","cw");
+       //window.open(top.topurl+action+"summary.html","cw");
        qw.document.close();
        fb=stadd;       
        nst=ltr.substring(5,(ltr.length-1));// alert(nst+" "+ltr);
-       query=query.replace("<A HREF="+top.topurl+"/getpage?url=set.html target=cw onclick=top.savelink("+nst+",'s')>"+ltr+"</A>",ltr);
-       query=query.replace("<A HREF="+top.topurl+"/getpage?url=val.html target=cw onclick=top.savelink("+nst+",'v')>"+ltr+"</A>",ltr);
-       query=query.replace("<A HREF="+top.topurl+"/getpage?url=boole.html target=cw onclick=top.savelink("+nst+",'b')>"+ltr+"</A>",ltr);
+       query=query.replace("<A HREF="+top.topurl+action+"set.html target=cw onclick=top.savelink("+nst+",'s')>"+ltr+"</A>",ltr);
+       query=query.replace("<A HREF="+top.topurl+action+"val.html target=cw onclick=top.savelink("+nst+",'v')>"+ltr+"</A>",ltr);
+       query=query.replace("<A HREF="+top.topurl+action+"boole.html target=cw onclick=top.savelink("+nst+",'b')>"+ltr+"</A>",ltr);
        parse();
        query=query.replace(ltr,fb);
        actinput++;storia[actinput]=query;numeroazioniannullate=0;//alert (actinput+" "+storia.length);
@@ -337,10 +394,13 @@ function aggq() // aggiorna la query sostituendo l' ultimo link editato con la s
        aggcw();
        cw.focus();
        }
-  var topurl=document.location.protocol+'//'+document.location.host;
+var topurl=document.location.protocol+'//'+document.location.host;
+//var topurl="";
+var action="/getpage?url=";
+//var action="";
 </SCRIPT>
 </HEAD>
   <script>
-    document.write(' <FRAMESET ROWS="69%,31%"> <FRAMESET COLS="40%,60%"> <FRAMESET ROWS="46%,54%"> <FRAME NAME="qw" SRC="'+topurl+'/getpage?url=start.html"> <FRAME NAME="sw" SRC="'+topurl+'/getpage?url=blank.html"> </FRAMESET> <FRAME NAME="cw" SRC="'+topurl+'/getpage?url=blank.html"> </FRAMESET> <FRAMESET COLS="49%,51%"> <FRAME NAME="gw" SRC="'+topurl+'/getpage?url=blank.html" onFocus="help(-1)";> <FRAME NAME="hw" SRC="'+topurl+'/getpage?url=blank.html"> </FRAMESET> </FRAMESET>');
+    document.write(' <FRAMESET ROWS="69%,31%"> <FRAMESET COLS="40%,60%"> <FRAMESET ROWS="46%,54%"> <FRAME NAME="qw" SRC="'+topurl+action+'start.html"> <FRAME NAME="sw" SRC="'+topurl+action+'blank.html"> </FRAMESET> <FRAME NAME="cw" SRC="'+topurl+action+'blank.html"> </FRAMESET> <FRAMESET COLS="49%,51%"> <FRAME NAME="gw" SRC="'+topurl+action+'blank.html" onFocus="help(-1)";> <FRAME NAME="hw" SRC="'+topurl+action+'blank.html"> </FRAMESET> </FRAMESET>');
   </script>
 </HTML>