]> matita.cs.unibo.it Git - helm.git/commitdiff
Files control.js graphLinks.js utils.js no longer in use.
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Fri, 28 May 2004 12:21:14 +0000 (12:21 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Fri, 28 May 2004 12:21:14 +0000 (12:21 +0000)
helm/on-line/javascript/Makefile
helm/on-line/javascript/control.js [deleted file]
helm/on-line/javascript/graphLinks.js [deleted file]
helm/on-line/javascript/utils.js [deleted file]

index 1a6baf65e056fd71e04faa7bed1a263540743968..33ab1ed1cd191aa99e8aa498f1683772242d9fcf 100644 (file)
@@ -1,5 +1,5 @@
 
-TARGETS = control.js_xml defaults.js_xml utils.js_xml graphLinks.js_xml helmjsmenu.js_xml
+TARGETS = defaults.js_xml helmjsmenu.js_xml
 
 .SUFFIXES:
 .SUFFIXES: .js .js_xml
diff --git a/helm/on-line/javascript/control.js b/helm/on-line/javascript/control.js
deleted file mode 100644 (file)
index 0e6e566..0000000
+++ /dev/null
@@ -1,261 +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,processorURL,interfaceURL)
-{
-  var theoryuri = top.theoryuri;
-  var cicuri = top.cicuri;
-  var mode = top.mode;
-  var mode_list = mode.split(",");
-  var new_mode = output.options[output.selectedIndex].value;
-  var dest = "?theoryuri=" + theoryuri + "&cicuri=" + cicuri + "&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);
-
-    var href =
-     processorURL + 'apply' +
-     '?keys=RT' +
-     '&param.topurl=' + topurl +
-     '&xmluri=' +
-     escape(interfaceURL + '/html/library/control.html' + dest + top.mode);
-    
-    location.href = href;
-  }
-}
-
-function updateFormat(format,profile,processorURL,interfaceURL)
-{
-  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(profile,processorURL,interfaceURL);
-}
-
-function updateNatural(checkbox,profile,processorURL,interfaceURL)
-{
-  if (checkbox.checked) updateMode(3, "yes");
-  else updateMode(3, "no");
-  refreshReload(profile,processorURL,interfaceURL);
-}
-
-function updateAnnotations(checkbox,profile,processorURL,interfaceURL)
-{
-  if (checkbox.checked) updateMode(4, "yes");
-  else updateMode(4, "no");
-  refreshReload(profile,processorURL,interfaceURL);
-}
-
-function updateCompressed(checkbox,profile,processorURL,interfaceURL)
-{
-  if (checkbox.checked) updateMode(5, "gz");
-  else updateMode(5, "normal");
-  refreshReload(profile,processorURL,interfaceURL);
-}
-
-function updateDTDPatched(checkbox,profile,processorURL,interfaceURL)
-{
-  if (checkbox.checked) updateMode(6, "yes");
-  else updateMode(6, "no");
-  refreshReload(profile,processorURL,interfaceURL);
-}
-
-function refreshReload(profile, processorURL, interfaceURL)
-{
-   var search = 
-      "?mode=" + top.mode +
-      "&cicuri=" + top.cicuri +
-      "&theoryuri=" + top.theoryuri;
-
-   var href = processorURL +
-    'apply' +
-    '?keys=RT' +
-    '&profile=' + profile +
-    '&param.profile=' + profile +
-    '&xmluri=' +
-    escape(interfaceURL + '/html/library/index.html' + search);
-    
-   top.frames[0].document.links[0].href = href;
-   top.frames[0].document.links[1].href =
-    interfaceURL + '/html/index.html' + 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()
-{
-  return escape("d_c,C1,G,C2,L");
-}
-
-function getTheoryKeys()
-{
-  return escape("T1,T2,L,E");
-}
-
-function getEmbedKeys()
-{
-  return escape("d_c,TC1,HC2,L");
-}
-
-function getCICHTMLKeys()
-{
-  return escape("d_c,C1,HC2,L");
-}
-
-function getCICProofTreeXHTMLMathMLKeys()
-{
-  return escape("HAT,G,HAO,L");
-}
-
-function makeURL(type,uri,cicflags,typesflags,profile,processorURL,interfaceURL,getterURL)
-{
-  var mode = top.mode;
-  var mode_list = mode.split(",");
-  
-  var keys = "";
-  var url = "";
-
-  var interfaceURLidx = interfaceURL + "/html/cic/index.html";
-  var thinterfaceURLidx = interfaceURL + "/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 = "";
-    var rdfprefix = "";
-    if (format == "types") ext = ".types"
-    else if (format == "ann") ext = ".ann"
-    else if (format == "fwd") rdfprefix = "helm:rdf:www.cs.unibo.it/helm/rdf/forward//"
-    else if (format == "bwd") rdfprefix = "helm:rdf:www.cs.unibo.it/helm/rdf/backward//";
-    url = getterURL + "getxml?uri=" + rdfprefix + uri + ext + "&format=" +
-          mode_list[5] + "&patch_dtd=" + mode_list[6];
-  } else {
-    var uri_len = uri.length;
-    if (format == "html" && type == "cic" && uri.substring(uri.length - 10, uri.length) == "proof_tree") {
-      keys = getCICProofTreeXHTMLMathMLKeys() +
-       "&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" +
-       "&prop.media-type=text/xml" +
-       "&prop.method=xml" +
-       "&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.framewidth=150";
-    } else if (format == "html" && type == "cic") {
-      keys = getCICHTMLKeys() +
-       "&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" +
-       "&prop.method=html" +
-       "&param.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
-       "&param.encoding=iso-8859-1" +
-       "&param.media-type=text/html" +
-       "&param.keys=" + getCICHTMLKeys();
-    } else if (format == "html" && type == "theory") {
-      keys = getTheoryKeys()+
-       "&profile=" + profile +
-       "&param.profile=" + profile +
-       "&param.keys=" + getCICHTMLKeys() +
-       "&param.thkeys=" + getTheoryKeys() +
-       "&param.embedkeys=" + getEmbedKeys() +
-       "&param.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+
-       "&param.encoding=iso-8859-1" +
-       "&param.thencoding=iso-8859-1" +
-       "&param.media-type=text/html" +
-       "&param.thmedia-type=text/html";
-    } else if (format == "mml_cont" && type == "cic") {
-      keys = escape("d_c,C1")+
-       "&profile=" + profile +
-       "&param.profile=" + profile +
-       "&prop.doctype-public="+
-       "&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")+
-       "&profile=" + profile +
-       "&param.profile=" + profile +
-       "&param.keys=" + escape("d_c,C1") +
-       "&param.thkeys=T1,L,E" +
-       "&param.embedkeys=" + escape("d_c,TC1") +
-       "&param.doctype-public=" +
-       "&param.encoding=" +
-       "&param.thencoding=iso-8859-1" +
-       "&param.media-type=text/xml" +
-       "&param.thmedia-type=text/html";
-    } else if (format == "mml_pres" && type == "cic") {
-      keys = getCICMathMLKeys()+
-       "&profile=" + profile +
-       "&param.profile=" + profile +
-       "&prop.doctype-public="+
-       "&prop.media-type=text/xml" +
-       "&param.doctype-public=" +
-       "&param.encoding=" +
-       "&param.media-type=text/xml" +
-       "&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.doctype-public=" +
-       "&param.encoding=" +
-       "&param.thencoding=iso-8859-1" +
-       "&param.media-type=text/xml" +
-       "&param.thmedia-type=text/html";
-    }
-  }
-
-  if (output == "raw")
-   return url;
-  else if (type == "cic")
-   return processorURL + "apply?keys=RT&xmluri=" + escape(interfaceURLidx) + "&param.ignore=" + keys + "&param.CICURI=" + uri;
-  else if (type == "theory")
-   return processorURL + "apply?keys=RT&xmluri=" + escape(thinterfaceURLidx) + "&param.ignore=" + keys + "&param.CICURI=" + uri;
-}
-
diff --git a/helm/on-line/javascript/graphLinks.js b/helm/on-line/javascript/graphLinks.js
deleted file mode 100644 (file)
index 05ce3f9..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-function mkBackwardRDFURI(uri)
-{
-   var prefix = "helm:rdf:www.cs.unibo.it/helm/rdf/backward//";
-   var re1 = /#xpointer\(1\/(\d+)\/(\d+)\)/;
-   var re2 = /#xpointer\(1\/(\d+)\)/;
-   // Just one of the following replace will do something
-   uri = uri.replace(re1,",$1,$2");
-   uri = uri.replace(re2,",$1");
-
-   return (prefix + uri);
-}
-
-function removeXPointer(uri)
-{
-   //var re = /#xpointer(\.*)/;
-   // CSC: Why the r.e.s below work and the one above does not?
-   var re1 = /#xpointer\(1\/(\d+)\/(\d+)\)/;
-   var re2 = /#xpointer\(1\/(\d+)\)/;
-   var res = uri.replace(re1,"");
-   res = res.replace(re2,"");
-
-   return res;
-}
-
-
-function mkGraphURL(uri,keys)
-{
-   var getterURL = unescape(getParam("param.getterURL"));
-   var draw_graphURL = unescape(getParam("param.draw_graphURL"));
-   var url= setParam(location.href,"keys",keys);
-   url = setParam(url,"xmluri", getterURL + 'getempty');
-   url = setParam(url,"param.CICURI",escape(uri));
-   var uri_set_size = document.uri_set_size.elements[0].value;
-   url = setParam(url,"param.uri_set_size",uri_set_size);
-
-   // The generated URL is sometimes too long for I.E.
-   // So it is now better to remove some unuseful pararams from the inner URL
-   url = dropParam(url,"param.processorURL");
-
-   url = draw_graphURL + 'draw?url=' + escape(url);
-   var url2 = setParam(location.href,"keys","MGL,RT");
-   url2 = setParam(url2,"xmluri",escape(url));
-   url2 = setParam(url2,"param.uri_set_size",uri_set_size);
-   return url2;
-}
-
-function mkDepURL(uri)
-{
-   return mkGraphURL(uri,"MDG");
-}
-
-
-function mkMetaURL(uri)
-{
-   return mkGraphURL(uri,"MMG");
-}
-
-function mkCICURL(uri)
-{
-   var rawuri = removeXPointer(uri);
-   var getterURL = getParam("param.getterURL");
-   var interfaceURL = unescape(getParam("param.interfaceURL"));
-   var url= setParam(location.href,"keys",getParam("param.keys"));
-   url = setParam(url,"xmluri", getterURL + 'getxml%3Furi%3D' + rawuri);
-   url = setParam(url,"param.CICURI",rawuri);
-   url = interfaceURL + "?url=" + escape(url);
-   return url;
-}
-
-function mkMetaTheoryURL(uri)
-{
-   var rdflyURL = "http://mowgli.cs.unibo.it:58086/";
-   var url = setParam(location.href,"keys","meta_theory," + unescape(getTheoryKeys()));
-   url = setParam(url,"param.embedkeys", getEmbedKeys());
-   url = setParam(url,"xmluri", rdflyURL + "get%3Fkind%3Dbackward%26object%3D" + escape(escape(uri)));
-   return url;
-}
diff --git a/helm/on-line/javascript/utils.js b/helm/on-line/javascript/utils.js
deleted file mode 100644 (file)
index a4ca9cc..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-function dropBodySuffix(url)
-{ var length = url.length;
-  if (url.slice(length - 5, length) == '.body')
-   return (url.slice(0, length - 5));
-  else
-   return url;
-}
-
-function chopSlash(url)
-{
-  return url.slice(0,url.lastIndexOf('/'));
-}
-
-function dropParam(url,name)
-{
-  var urla = url.split("?");
-  var search = urla[1];
-  var args = search.split("&");
-  var newargs = new Array();
-  var j = 0;
-
-  for (var i = 0 ; i < args.length ; i++) {
-     var couple = args[i].split("=");
-     if (couple[0] != name) {
-        newargs[j] = args[i];
-        j++;
-     }
-  }
-
-  return (urla[0] + "?" + newargs.join("&"));
-}
-
-function setParam(url,name,value)
-{
-  var urla = url.split("?");
-  var search = urla[1];
-  var args = search.split("&");
-  var found = false;
-
-  for (var i = 0 ; i < args.length ; i++) {
-     var couple = args[i].split("=");
-     if (couple[0] == name) {
-        found = true;
-        args[i] = name + "=" + value;
-     }
-  }
-
-  return (urla[0] + "?" + args.join("&") + (found ? "" : ("&" + name + "=" + value)));
-}
-
-function extractParam(url,name)
-{
-  var search = url.split("?")[1];
-  search = search.split("#")[0];
-  var args = search.split("&");
-  var value = "???";
-
-  for (var i = 0 ; i < args.length ; i++) {
-     var couple = args[i].split("=");
-     if (couple[0] == name) value = couple[1];
-  }
-
-  if (value == "???") value = getDefaultParam(name);
-
-  return value;
-}
-
-function getParam0(search,name)
-{
-  var args = search.split("&");
-  var value = "???";
-
-  for (var i = 0 ; i < args.length ; i++) {
-     var couple = args[i].split("=");
-     if (couple[0] == name) value = couple[1];
-  }
-
-  if (value == "???") value = getDefaultParam(name);
-
-  return value;
-}
-
-function getParam(name)
-{
-  return getParam0(location.search.slice(1),name);
-}
-
-function getParam2(name)
-{
-  var url = unescape(getParam('xmluri'));
-  var tmp = url.split("?");
-
-  if (tmp.length > 1)
-     return getParam0(tmp[1],name);
-  else
-     return getDefaultParam(name);
-}
-
-
-function outputOption(doc, value, content, selected)
-{
-  doc.write("<option value=\"" + value + "\" ");
-  if (value == selected) doc.write("selected ");
-  doc.write(">" + content + "</option>");
-}
-
-function outputCheckbox(doc, onclick, content, checked)
-{
-  doc.write("<input type=\"checkbox\" onClick=\"" + onclick + "\" ");
-  if (checked) doc.write("checked");
-  doc.write(">" + content + "</input>");
-}
-