]> matita.cs.unibo.it Git - helm.git/commitdiff
escape/unescape no longer works with '+';
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Tue, 9 Mar 2004 16:29:49 +0000 (16:29 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Tue, 9 Mar 2004 16:29:49 +0000 (16:29 +0000)
replaced with encodeURIComponent and decodeURIComponent

helm/searchEngine/html/editor.html
helm/searchEngine/html/editorpdq.html
helm/searchEngine/html/index.html

index 1e6afe7d06e9f5c35cd821f4370833caedc6c7f4..683b2003010a7c19a0fc5439f8a2500daf16d4a8 100644 (file)
@@ -4,7 +4,7 @@
 qbf=/[[^\[\]<>]*|<set>|<val>|<boole>]*/
 function invia()
        {
-       window.open(top.ask_uwobo(top.topurl+"/execute?query="+escape(document.edit.qta.value)),"cw");
+       window.open(top.ask_uwobo(top.topurl+"/execute?query="+encodeURIComponent(document.edit.qta.value)),"cw");
        }
 function parse1()
        {
index 21e803906077a8244a0f342428dbb85c1cd24fad..4e82f8faa77aca8f652ffe7174c0e503eb8593b2 100644 (file)
@@ -21,7 +21,7 @@ function nuovapdqsa()
        if (confirm("Are you sure you want to change expression?"))
                {
                top.terminecic="";
-               document.invio.expression.value="";document.invio.aliaslist.value=unescape(top.listaliases);
+               document.invio.expression.value="";document.invio.aliaslist.value=decodeURIComponent(top.listaliases);
                top.ricordaliaslist=1;
                window.open(top.topurl+top.action+"pdq.html","cw");
                window.open(top.topurl+top.action+"editorpdq.html","sw");
@@ -30,14 +30,14 @@ function nuovapdqsa()
 function invia()
        {
        if (document.invio.expression.value!="")
-               {top.terminecic=escape(document.invio.expression.value);
+               {top.terminecic=encodeURIComponent(document.invio.expression.value);
     top.listaliases="";
                for (i=0;i<top.aliasglob.length;i++)
                        {
-                       top.listaliases=top.listaliases+escape(top.aliasglob[i]+" ");
+                       top.listaliases=top.listaliases+encodeURIComponent(top.aliasglob[i]+" ");
                        }
                //alert(top.listaliases);
-    window.open(top.ask_uwobo(top.topurl+"/"+top.current_query+"?term="+escape(document.invio.expression.value)+"&aliases="+top.listaliases),"cw");
+    window.open(top.ask_uwobo(top.topurl+"/"+top.current_query+"?term="+encodeURIComponent(document.invio.expression.value)+"&aliases="+top.listaliases),"cw");
         }
                //window.open(top.topurl+top.action+"templateambigpdq2.html","bw")}     
        else {alert("Please complete the query before.")}
@@ -68,7 +68,7 @@ function listalias()
        }
 function editaalias()
        {
-       if (document.invio.expression.value!=""){top.terminecic=escape(document.invio.expression.value)}
+       if (document.invio.expression.value!=""){top.terminecic=encodeURIComponent(document.invio.expression.value)}
        top.window.open(top.topurl+top.action+"aliaslist.html",(top.cw.frames.length==0?"cw":"bw"));
        }
 </SCRIPT>
@@ -85,6 +85,6 @@ function editaalias()
 <input type=button value="Restart" onMouseOver="top.help(-5)" onClick="armageddon()"></input>
 <input type=button value="New expression" onMouseOver="top.help(-7)" onClick="nuovapdqsa()"></input>
 </form>
-<SCRIPT language=Javascript>document.invio.expression.value=unescape(top.terminecic); </script>
+<SCRIPT language=Javascript>document.invio.expression.value=decodeURIComponent(top.terminecic); </script>
 </BODY>
 </HTML>
index f047610b2379e32896b00c737f57a609cdbcbadd..7e0dc270f48ee9f4e358c43ac61dfa398d16391e 100644 (file)
@@ -69,29 +69,29 @@ var interface_topurl="@topurl@";
 function ask_uwobo(url)
        {
          return (top.topurl+"/ask_uwobo?url="+
-                 escape(processorURL + "apply?" +
-                         "xmluri=" + escape(url) +
-                         "&keys=" + escape(thkeys) +
-                         "&param.processorURL=" + escape(processorURL) +
-                         "&param.getterURL=" + escape(getterURL) +
-                         "&param.proofcheckerURL=" + escape(proofcheckerURL) +
-                         "&param.draw_graphURL=" + escape(draw_graphURL) +
-                         "&param.uri_set_queueURL=" + escape(uri_set_queueURL) +
-                         "&param.UNICODEvsSYMBOL=" + escape(UNICODEvsSYMBOL) +
-                         "&param.keys=" + escape(keys) +
-                         "&param.thkeys=" + escape(thkeys) +
-                         "&param.embedkeys=" + escape(embedkeys) +
-                         "&param.doctype-public=" + escape(doctype_public) +
-                         "&param.encoding=" + escape(encoding) +
-                         "&param.thencoding=" + escape(thencoding) +
-                         "&param.media-type=" + escape(media_type) +
-                         "&param.thmedia-type=" + escape(thmedia_type) +
-                         "&param.interfaceURL=" + escape(interfaceURL) +
-                         "&param.thinterfaceURL=" + escape(thinterfaceURL) +
-                         "&param.CICURI=" + escape(CICURI) +
-                         "&param.naturalLanguage=" + escape(naturalLanguage) +
-                         "&param.annotations=" + escape(annotations) +
-                         "&param.topurl=" + escape(interface_topurl) +
+                 encodeURIComponent(processorURL + "apply?" +
+                         "xmluri=" + encodeURIComponent(url) +
+                         "&keys=" + encodeURIComponent(thkeys) +
+                         "&param.processorURL=" + encodeURIComponent(processorURL) +
+                         "&param.getterURL=" + encodeURIComponent(getterURL) +
+                         "&param.proofcheckerURL=" + encodeURIComponent(proofcheckerURL) +
+                         "&param.draw_graphURL=" + encodeURIComponent(draw_graphURL) +
+                         "&param.uri_set_queueURL=" + encodeURIComponent(uri_set_queueURL) +
+                         "&param.UNICODEvsSYMBOL=" + encodeURIComponent(UNICODEvsSYMBOL) +
+                         "&param.keys=" + encodeURIComponent(keys) +
+                         "&param.thkeys=" + encodeURIComponent(thkeys) +
+                         "&param.embedkeys=" + encodeURIComponent(embedkeys) +
+                         "&param.doctype-public=" + encodeURIComponent(doctype_public) +
+                         "&param.encoding=" + encodeURIComponent(encoding) +
+                         "&param.thencoding=" + encodeURIComponent(thencoding) +
+                         "&param.media-type=" + encodeURIComponent(media_type) +
+                         "&param.thmedia-type=" + encodeURIComponent(thmedia_type) +
+                         "&param.interfaceURL=" + encodeURIComponent(interfaceURL) +
+                         "&param.thinterfaceURL=" + encodeURIComponent(thinterfaceURL) +
+                         "&param.CICURI=" + encodeURIComponent(CICURI) +
+                         "&param.naturalLanguage=" + encodeURIComponent(naturalLanguage) +
+                         "&param.annotations=" + encodeURIComponent(annotations) +
+                         "&param.topurl=" + encodeURIComponent(interface_topurl) +
                          "&prop.method=html"));
        }
 function help(w) // quando invocata, visualizza l' help relativo ad un oggetto. Di solito รจ legata ad un evento onFocus o onMouseOver.  
@@ -499,11 +499,11 @@ function templateambigpdq1_invia(document,top,elenco,ident)
        top.vlds[top.vlds.length]=";";
        for (j=0;j<top.vlds.length;j++)
        {
-           choices=choices+(top.vlds[j]==";"?";":escape(top.vlds[j]))+" ";
+           choices=choices+(top.vlds[j]==";"?";":encodeURIComponent(top.vlds[j]))+" ";
        }
        choices=choices.substring(0,choices.length-2);
   top.choices = choices;
-  stringa=stringa+escape(choices);
+  stringa=stringa+encodeURIComponent(choices);
        if (top.vlds.length==vecchiavlds){alert("You must select at least one of the options.");}
        else
        {
@@ -551,14 +551,14 @@ function templateambigpdq2_listainterpretazioni(document,elenco,labels)
 function templateambigpdq2_invia(document,elenco)
        {
        stringa=top.topurl+"/"+top.current_query+"?term="+top.terminecic;
-       stringa=stringa+"&aliases="+escape(top.listaliases)+"&choices="+escape(top.choices)+"&interpretation_choices=";
+       stringa=stringa+"&aliases="+encodeURIComponent(top.listaliases)+"&choices="+encodeURIComponent(top.choices)+"&interpretation_choices=";
   var parsa = "";
        controllo=parsa.length;
        for (j=0;j<elenco.length;j++)
                {
                if (document.disamb.interp[j].checked)
                        {
-                       parsa=parsa+escape(elenco[j]);
+                       parsa=parsa+encodeURIComponent(elenco[j]);
 
       // TODO da implementare nella terza fase
                        //top.aliasglob[top.aliasglob.length]=document.disamb.interp[j].value;
@@ -599,9 +599,9 @@ function get_value_of_checkbox(checkbox)
 function constraints_choice_template_invia(document,aliases,constr_obj_len,constr_rel_len,constr_sort_len)
        {
        stringa=top.topurl+"/"+top.current_query+"?term="+top.terminecic;
-       stringa=stringa+"&aliases="+escape(aliases);
-       stringa=stringa+"&choices="+escape(top.choices);
-       stringa=stringa+"&interpretation_choices="+escape(top.interpretation_choices);
+       stringa=stringa+"&aliases="+encodeURIComponent(aliases);
+       stringa=stringa+"&choices="+encodeURIComponent(top.choices);
+       stringa=stringa+"&interpretation_choices="+encodeURIComponent(top.interpretation_choices);
        stringa=stringa+"&constraints=";
        for (j=0;j<constr_obj_len;j++)
         {