]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/on-line/javascript/control.js
annotationHelper now working again. A control frame has been added to
[helm.git] / helm / on-line / javascript / control.js
index 8ad40ce64ceaa580520e4dd13919c9a28aa1179c..fbc08f3f9b692e38f3fd33c53992cb3fa308b93d 100644 (file)
@@ -103,6 +103,12 @@ function refreshtheoryHeader(headerURL)
    return true;
 }
 
+function getCICMathMLKeys()
+{
+  //Important note: do not modify this function without modifying makeURL
+  return escape("C1,C2,L");
+}
+
 function makeURL(type,uri,cicflags,typesflags)
 {
   var mode = top.mode;
@@ -113,6 +119,9 @@ function makeURL(type,uri,cicflags,typesflags)
   var keys = "";
   var url = "";
 
+  var interfaceURL = chopSlash(chopSlash(top.topurl)) +
+   ((type == "cic") ? "/cic/index.html" : "/theory/index.html");
+
   var output = mode_list[0];
   var format;
   if (output == "raw") format = mode_list[1];
@@ -123,10 +132,12 @@ function makeURL(type,uri,cicflags,typesflags)
     if (format == "types") ext = ".types"
     else if (format == "ann") ext = ".ann";
     url = getterURL + "getxml?uri=" + uri + ext + "&format=" + mode_list[5] +
-     "&patched_dtd=" + mode_list[6];
+     "&patch_dtd=" + mode_list[6];
   } else {
     if (format == "html" && type == "cic") {
-      keys = "C1,HC2,L&param.processorURL=" + escape(processorURL) +
+      //Important note: do not modify this function without modifying
+      //getCICMathMLKeys
+      keys = escape("C1,HC2,L")+"&param.processorURL=" + escape(processorURL) +
        "&param.getterURL=" + escape(getterURL) +
        "&prop.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
        "&prop.encoding=iso-8859-1" +
@@ -134,21 +145,23 @@ function makeURL(type,uri,cicflags,typesflags)
        "&param.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
        "&param.encoding=iso-8859-1" +
        "&param.media-type=text/html" +
-       "&param.keys=" + escape("C1,HC2,L");
+       "&param.keys=" + escape("C1,HC2,L") +
+       "&param.interfaceURL=" + escape(interfaceURL);
     } else if (format == "html" && type == "theory") {
-      keys = "T1,T2,L,E&param.processorURL=" + escape(processorURL) +
+      keys = escape("T1,T2,L,E")+"&param.processorURL=" + escape(processorURL) +
        "&param.getterURL=" + escape(getterURL) +
        "&param.thkeys=" + escape("TC1,HC2,L") +
        "&param.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
        "&param.encoding=iso-8859-1" +
        "&param.media-type=text/html" +
-       "&param.keys=" + escape("C1,HC2,L");
+       "&param.keys=" + escape("C1,HC2,L") +
+       "&param.interfaceURL=" + escape(interfaceURL);
     } else if (format == "mml_cont" && type == "cic") {
       keys = "C1";
     } else if (format == "mml_cont" && type == "theory") {
-      keys = "T1,E&param.keys=C1&param.thkeys=TC1";
+      keys = escape("T1,E")+"&param.keys=C1&param.thkeys=TC1";
     } else if (format == "mml_pres" && type == "cic") {
-      keys = "C1,C2,L&param.processorURL=" + escape(processorURL) +
+      keys = escape("C1,C2,L")+"&param.processorURL=" + escape(processorURL) +
        "&param.getterURL=" + escape(getterURL) +
        "&prop.doctype-public="+
        "&prop.encoding=" +
@@ -156,12 +169,16 @@ function makeURL(type,uri,cicflags,typesflags)
        "&param.doctype-public=" +
        "&param.encoding=" +
        "&param.media-type=text/xml" +
-       "&param.keys=" + escape("C1,C2,L");
+       "&param.keys=" + escape("C1,C2,L") +
+       "&param.interfaceURL=" + escape(interfaceURL);
     } else if (format == "mml_pres" && type == "theory") {
-      keys = "T1,T2,L,E&param.keys=C1,C2&param.thkeys=TC1,C2,L" +
+      keys = escape("T1,T2,L,E")+"&param.keys=C1,C2,L&param.thkeys=TC1,C2,L" +
+       "&param.processorURL=" + escape(processorURL) +
+       "&param.getterURL=" + escape(getterURL) +
        "&param.doctype-public=" +
        "&param.encoding=" +
-       "&param.media-type=text/xml";
+       "&param.media-type=text/xml" +
+       "&param.interfaceURL=" + escape(interfaceURL);
     }
 
     var naturalLanguage = typesflags;
@@ -175,6 +192,9 @@ function makeURL(type,uri,cicflags,typesflags)
     url = processorURL + "apply?xmluri=" + escape(getterURL + "getxml?uri=" + uri) + "&keys=" + keys + "&param.CICURI=" + uri + "&param.naturalLanguage=" + naturalLanguage + "&param.annotations=" + annotations;
   }
 
-  return url;
+  if (output == "raw")
+   return url
+  else
+   return interfaceURL + "?url=" + escape(url);
 }