]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/on-line/javascript/control.js
###############################################################
[helm.git] / helm / on-line / javascript / control.js
index 79ed47fd7ef1c626592192a7c9852bc3c2175e1c..bc52d02b617d6a2948d56b65dcaf4d103528d862 100644 (file)
@@ -14,20 +14,14 @@ function updateMode(i, s)
   top.mode = res;
 }
 
-function updateOutput(output,format)
+function updateOutput(output,format,processorURL,interfaceURL)
 {
   var theoryuri = top.theoryuri;
   var cicuri = top.cicuri;
   var mode = top.mode;
-  var topurl = top.topurl;
-  var processorURL = top.processorURL;
-  var getterURL = top.getterURL;
-  var proofcheckerURL = top.proofcheckerURL;
-  var draw_graphURL = top.draw_graphURL;
-  var uri_set_queueURL = top.uri_set_queueURL;
   var mode_list = mode.split(",");
   var new_mode = output.options[output.selectedIndex].value;
-  var dest = "?theoryuri=" + theoryuri + "&cicuri=" + cicuri + "&topurl=" + topurl + "&processorURL=" + processorURL + "&getterURL=" + getterURL + "&proofcheckerURL=" + proofcheckerURL + "&draw_graphURL=" + draw_graphURL + "&uri_set_queueURL=" + uri_set_queueURL + "&mode=";
+  var dest = "?theoryuri=" + theoryuri + "&cicuri=" + cicuri + "&mode=";
   
   if (new_mode != mode_list[0]) {
     updateMode(0, new_mode);
@@ -35,17 +29,17 @@ function updateOutput(output,format)
     else updateMode(1, format.options[format.selectedIndex].value);
 
     var href =
-     top.processorURL + 'apply' +
+     processorURL + 'apply' +
      '?keys=RT' +
      '&param.topurl=' + topurl +
      '&xmluri=' +
-     escape(top.topurl + '/html/library/control.html' + dest + top.mode);
+     escape(interfaceURL + '/html/library/control.html' + dest + top.mode);
     
     location.href = href;
   }
 }
 
-function updateFormat(format)
+function updateFormat(format,profile,processorURL,interfaceURL)
 {
   var mode = top.mode;
   var mode_list = mode.split(",");
@@ -56,60 +50,55 @@ function updateFormat(format)
     updateMode(2, format.options[format.selectedIndex].value);
   }
 
-  refreshReload();
+  refreshReload(profile,processorURL,interfaceURL);
 }
 
-function updateNatural(checkbox)
+function updateNatural(checkbox,profile,processorURL,interfaceURL)
 {
   if (checkbox.checked) updateMode(3, "yes");
   else updateMode(3, "no");
-  refreshReload();
+  refreshReload(profile,processorURL,interfaceURL);
 }
 
-function updateAnnotations(checkbox)
+function updateAnnotations(checkbox,profile,processorURL,interfaceURL)
 {
   if (checkbox.checked) updateMode(4, "yes");
   else updateMode(4, "no");
-  refreshReload();
+  refreshReload(profile,processorURL,interfaceURL);
 }
 
-function updateCompressed(checkbox)
+function updateCompressed(checkbox,profile,processorURL,interfaceURL)
 {
   if (checkbox.checked) updateMode(5, "gz");
   else updateMode(5, "normal");
-  refreshReload();
+  refreshReload(profile,processorURL,interfaceURL);
 }
 
-function updateDTDPatched(checkbox)
+function updateDTDPatched(checkbox,profile,processorURL,interfaceURL)
 {
   if (checkbox.checked) updateMode(6, "yes");
   else updateMode(6, "no");
-  refreshReload();
+  refreshReload(profile,processorURL,interfaceURL);
 }
 
-function refreshReload()
+function refreshReload(profile, processorURL, interfaceURL)
 {
    var search = 
       "?mode=" + top.mode +
       "&cicuri=" + top.cicuri +
-      "&theoryuri=" + top.theoryuri +
-      "&processorURL=" + top.processorURL +
-      "&getterURL=" + top.getterURL +
-      "&proofcheckerURL=" + top.proofcheckerURL +
-      "&draw_graphURL=" + top.draw_graphURL +
-      "&uri_set_queueURL=" + top.uri_set_queueURL +
-      "&UNICODEvsSYMBOL=" + top.UNICODEvsSYMBOL;
+      "&theoryuri=" + top.theoryuri;
 
-   var href =
-    top.processorURL + 'apply' +
+   var href = processorURL +
+    'apply' +
     '?keys=RT' +
-    '&param.topurl=' + top.topurl +
+    '&profile=' + profile +
+    '&param.profile=' + profile +
     '&xmluri=' +
-    escape(top.topurl + '/html/library/index.html' + search);
+    escape(interfaceURL + '/html/library/index.html' + search);
     
    top.frames[0].document.links[0].href = href;
    top.frames[0].document.links[1].href =
-    top.topurl + '/html/index.html' + search;
+    interfaceURL + '/html/index.html' + search;
 
    return true;
 }
@@ -151,22 +140,16 @@ function getCICProofTreeXHTMLMathMLKeys()
   return escape("HAT,G,HAO,L");
 }
 
-function makeURL(type,uri,cicflags,typesflags)
+function makeURL(type,uri,cicflags,typesflags,profile,processorURL,interfaceURL,getterURL)
 {
   var mode = top.mode;
-  var processorURL = top.processorURL;
-  var getterURL = top.getterURL;
-  var proofcheckerURL = top.proofcheckerURL;
-  var draw_graphURL = top.draw_graphURL;
-  var uri_set_queueURL = top.uri_set_queueURL;
-  var UNICODEvsSYMBOL = top.UNICODEvsSYMBOL;
   var mode_list = mode.split(",");
   
   var keys = "";
   var url = "";
 
-  var interfaceURL = top.topurl + "/html/cic/index.html";
-  var thinterfaceURL = top.topurl + "/html/theory/index.html";
+  var interfaceURLidx = interfaceURL + "/html/cic/index.html";
+  var thinterfaceURLidx = interfaceURL + "/html/theory/index.html";
 
   var output = mode_list[0];
   var format;
@@ -186,12 +169,8 @@ function makeURL(type,uri,cicflags,typesflags)
     var uri_len = uri.length;
     if (format == "html" && type == "cic" && uri.substring(uri.length - 10, uri.length) == "proof_tree") {
       keys = getCICProofTreeXHTMLMathMLKeys() +
-       "&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) +
+       "&profile=" + profile +
+       "&default.profile=" + profile +
        "&prop.doctype-public="+escape("-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN")+
        "&prop.doctype-system="+escape("http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd")+
        "&prop.encoding=iso-8859-1" +
@@ -201,16 +180,11 @@ function makeURL(type,uri,cicflags,typesflags)
        "&param.encoding=iso-8859-1" +
        "&param.media-type=text/html" +
        "&param.keys=" + getCICHTMLKeys() +
-       "&param.interfaceURL=" + escape(interfaceURL) +
        "&param.framewidth=150";
     } else if (format == "html" && type == "cic") {
       keys = getCICHTMLKeys() +
-       "&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) +
+       "&profile=" + profile +
+       "&param.profile=" + profile +
        "&prop.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
        "&prop.encoding=iso-8859-1" +
        "&prop.media-type=text/html" +
@@ -218,16 +192,11 @@ 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=" + getCICHTMLKeys() +
-       "&param.interfaceURL=" + escape(interfaceURL);
+       "&param.keys=" + getCICHTMLKeys();
     } else if (format == "html" && type == "theory") {
       keys = getTheoryKeys()+
-       "&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) +
+       "&profile=" + profile +
+       "&param.profile=" + profile +
        "&param.keys=" + getCICHTMLKeys() +
        "&param.thkeys=" + getTheoryKeys() +
        "&param.embedkeys=" + getEmbedKeys() +
@@ -235,89 +204,57 @@ function makeURL(type,uri,cicflags,typesflags)
        "&param.encoding=iso-8859-1" +
        "&param.thencoding=iso-8859-1" +
        "&param.media-type=text/html" +
-       "&param.thmedia-type=text/html" +
-       "&param.interfaceURL=" + escape(interfaceURL) +
-       "&param.thinterfaceURL=" + escape(thinterfaceURL);
+       "&param.thmedia-type=text/html";
     } else if (format == "mml_cont" && type == "cic") {
       keys = escape("d_c,C1")+
-       "&param.processorURL=" + escape(processorURL) +
-       "&param.getterURL=" + escape(getterURL) +
+       "&profile=" + profile +
+       "&param.profile=" + profile +
        "&prop.doctype-public="+
-       //"&prop.encoding=" +
        "&prop.media-type=text/xml" +
        "&param.doctype-public=" +
        "&param.encoding=" +
        "&param.media-type=text/xml";
     } else if (format == "mml_cont" && type == "theory") {
       keys = escape("T1,L,E")+
-       "&param.processorURL=" + escape(processorURL) +
-       "&param.getterURL=" + escape(getterURL) +
+       "&profile=" + profile +
+       "&param.profile=" + profile +
        "&param.keys=" + escape("d_c,C1") +
        "&param.thkeys=T1,L,E" +
        "&param.embedkeys=" + escape("d_c,TC1") +
-
-       "&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.doctype-public=" +
        "&param.encoding=" +
        "&param.thencoding=iso-8859-1" +
        "&param.media-type=text/xml" +
-       "&param.thmedia-type=text/html" +
-       "&param.interfaceURL=" + escape(interfaceURL) +
-       "&param.thinterfaceURL=" + escape(thinterfaceURL);
+       "&param.thmedia-type=text/html";
     } else if (format == "mml_pres" && type == "cic") {
       keys = getCICMathMLKeys()+
-       "&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) +
+       "&profile=" + profile +
+       "&param.profile=" + profile +
        "&prop.doctype-public="+
-       //"&prop.encoding=" +
        "&prop.media-type=text/xml" +
        "&param.doctype-public=" +
        "&param.encoding=" +
        "&param.media-type=text/xml" +
-       "&param.keys=" + getCICMathMLKeys() +
-       "&param.interfaceURL=" + escape(interfaceURL);
+       "&param.keys=" + getCICMathMLKeys();
     } else if (format == "mml_pres" && type == "theory") {
       keys = getTheoryKeys()+
+       "&profile=" + profile +
+       "&param.profile=" + profile +
        "&param.keys=" + getCICMathMLKeys() +
        "&param.thkeys=" + getTheoryKeys() +
        "&param.embedkeys=" + escape("d_c,TC1,G,C2,L") +
-       "&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.doctype-public=" +
        "&param.encoding=" +
        "&param.thencoding=iso-8859-1" +
        "&param.media-type=text/xml" +
-       "&param.thmedia-type=text/html" +
-       "&param.interfaceURL=" + escape(interfaceURL) +
-       "&param.thinterfaceURL=" + escape(thinterfaceURL);
+       "&param.thmedia-type=text/html";
     }
-
-    var naturalLanguage = typesflags.toLowerCase();
-    if (typesflags != "NO" || type == "theory") {
-       naturalLanguage = mode_list[3];
-    }
-    var annotations = cicflags.toLowerCase();
-    if (cicflags != "NO" || type == "theory") {
-       annotations = mode_list[4];
-    }
-    url = processorURL + "apply?xmluri=" + escape(getterURL + "getxml?uri=" + uri) + "&keys=" + keys + "&param.CICURI=" + uri + "&param.naturalLanguage=" + naturalLanguage + "&param.annotations=" + annotations + "&param.topurl=" + top.topurl;
   }
 
   if (output == "raw")
    return url;
   else if (type == "cic")
-   return interfaceURL + "?url=" + escape(url);
+   return processorURL + "apply?keys=RT&xmluri=" + escape(interfaceURLidx) + "&param.ignore=" + keys + "&param.CICURI=" + uri;
   else if (type == "theory")
-   return thinterfaceURL + "?url=" + escape(url)
+   return processorURL + "apply?keys=RT&xmluri=" + escape(thinterfaceURLidx) + "&param.ignore=" + keys + "&param.CICURI=" + uri;
 }
-