]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/on-line/javascript/control.js
This commit was manufactured by cvs2svn to create branch 'xmltheory'.
[helm.git] / helm / on-line / javascript / control.js
diff --git a/helm/on-line/javascript/control.js b/helm/on-line/javascript/control.js
deleted file mode 100644 (file)
index fbc08f3..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-function updateMode(i, s)
-{
-  var mode = top.mode;
-  var mode_list = mode.split(",");
-  var res = "";
-  var j;
-
-  for (j = 0; j < mode_list.length; j++) {
-    if (j == i) res += s;
-    else res += mode_list[j];
-    if (j < mode_list.length - 1) res += ",";
-  }
-  
-  top.mode = res;
-}
-
-function updateOutput(output,format)
-{
-  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 mode_list = mode.split(",");
-  var new_mode = output.options[output.selectedIndex].value;
-  var dest = "?theoryuri=" + theoryuri + "&cicuri=" + cicuri + "&topurl=" + topurl + "&processorURL=" + processorURL + "&getterURL=" + getterURL + "&mode=";
-  
-  if (new_mode != mode_list[0]) {
-    updateMode(0, new_mode);
-    if (new_mode == "raw") updateMode(2, format.options[format.selectedIndex].value);
-    else updateMode(1, format.options[format.selectedIndex].value);
-    location.search = dest + top.mode;
-  }
-}
-
-function updateFormat(format)
-{
-  var mode = top.mode;
-  var mode_list = mode.split(",");
-
-  if (mode_list[0] == "raw") {
-    updateMode(1, format.options[format.selectedIndex].value);
-  } else {
-    updateMode(2, format.options[format.selectedIndex].value);
-  }
-
-  refreshReload();
-}
-
-function updateNatural(checkbox)
-{
-  if (checkbox.checked) updateMode(3, "yes");
-  else updateMode(3, "no");
-  refreshReload();
-}
-
-function updateAnnotations(checkbox)
-{
-  if (checkbox.checked) updateMode(4, "yes");
-  else updateMode(4, "no");
-  refreshReload();
-}
-
-function updateCompressed(checkbox)
-{
-  if (checkbox.checked) updateMode(5, "gz");
-  else updateMode(5, "normal");
-  refreshReload();
-}
-
-function updateDTDPatched(checkbox)
-{
-  if (checkbox.checked) updateMode(6, "yes");
-  else updateMode(6, "no");
-  refreshReload();
-}
-
-function refreshReload()
-{
-   var search = 
-      "?mode=" + top.mode +
-      "&cicuri=" + top.cicuri +
-      "&theoryuri=" + top.theoryuri +
-      "&processorURL=" + top.processorURL +
-      "&getterURL=" + top.getterURL;
-
-   top.frames[0].document.links[0].search = search;
-   top.frames[0].document.links[1].search = search;
-
-   return true;
-}
-
-function refreshcicHeader(headerURL)
-{
-   top.cicheader.location.search = "?keys=GP&xmluri=" + headerURL + "&param.uri=" + top.cicuri;
-   return true;
-}
-
-function refreshtheoryHeader(headerURL)
-{
-   top.theoryheader.location.search = "?keys=GP&xmluri=" + headerURL + "&param.uri=" + top.theoryuri;
-   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;
-  var processorURL = top.processorURL;
-  var getterURL = top.getterURL;
-  var mode_list = mode.split(",");
-  
-  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];
-  else format = mode_list[2];
-  
-  if (output == "raw") {
-    var ext = "";
-    if (format == "types") ext = ".types"
-    else if (format == "ann") ext = ".ann";
-    url = getterURL + "getxml?uri=" + uri + ext + "&format=" + mode_list[5] +
-     "&patch_dtd=" + mode_list[6];
-  } else {
-    if (format == "html" && type == "cic") {
-      //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" +
-       "&prop.media-type=text/html" +
-       "&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.interfaceURL=" + escape(interfaceURL);
-    } else if (format == "html" && type == "theory") {
-      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.interfaceURL=" + escape(interfaceURL);
-    } else if (format == "mml_cont" && type == "cic") {
-      keys = "C1";
-    } else if (format == "mml_cont" && type == "theory") {
-      keys = escape("T1,E")+"&param.keys=C1&param.thkeys=TC1";
-    } else if (format == "mml_pres" && type == "cic") {
-      keys = escape("C1,C2,L")+"&param.processorURL=" + escape(processorURL) +
-       "&param.getterURL=" + escape(getterURL) +
-       "&prop.doctype-public="+
-       "&prop.encoding=" +
-       "&prop.media-type=text/xml" +
-       "&param.doctype-public=" +
-       "&param.encoding=" +
-       "&param.media-type=text/xml" +
-       "&param.keys=" + escape("C1,C2,L") +
-       "&param.interfaceURL=" + escape(interfaceURL);
-    } else if (format == "mml_pres" && type == "theory") {
-      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.interfaceURL=" + escape(interfaceURL);
-    }
-
-    var naturalLanguage = typesflags;
-    if (typesflags != "NO" || type == "theory") {
-       naturalLanguage = mode_list[3];
-    }
-    var annotations = cicflags;
-    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;
-  }
-
-  if (output == "raw")
-   return url
-  else
-   return interfaceURL + "?url=" + escape(url);
-}
-