X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fon-line%2Fjavascript%2Fcontrol.js;h=fbc08f3f9b692e38f3fd33c53992cb3fa308b93d;hb=3924d3a11a488176c28af5e82ee3810d9a6350ed;hp=1b00d17e7e7606373eae82bc9a600a27df54f2fb;hpb=97087e29c26ea3a8f46c880e1dc07ee68a396a43;p=helm.git diff --git a/helm/on-line/javascript/control.js b/helm/on-line/javascript/control.js index 1b00d17e7..fbc08f3f9 100644 --- a/helm/on-line/javascript/control.js +++ b/helm/on-line/javascript/control.js @@ -1,4 +1,3 @@ - function updateMode(i, s) { var mode = top.mode; @@ -63,6 +62,20 @@ function updateAnnotations(checkbox) 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 = @@ -90,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; @@ -100,30 +119,66 @@ 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]; else format = mode_list[2]; if (output == "raw") { - url = getterURL + "getciconly?uri=" + uri; + 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") { - keys = "C1,HC2¶m.processorURL=" + escape(processorURL) + + //Important note: do not modify this function without modifying + //getCICMathMLKeys + keys = escape("C1,HC2,L")+"¶m.processorURL=" + escape(processorURL) + "¶m.getterURL=" + escape(getterURL) + - "¶m.keys=" + escape("C1,HC2"); + "&prop.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+ + "&prop.encoding=iso-8859-1" + + "&prop.media-type=text/html" + + "¶m.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+ + "¶m.encoding=iso-8859-1" + + "¶m.media-type=text/html" + + "¶m.keys=" + escape("C1,HC2,L") + + "¶m.interfaceURL=" + escape(interfaceURL); } else if (format == "html" && type == "theory") { - keys = "T1,T2,E¶m.processorURL=" + escape(processorURL) + + keys = escape("T1,T2,L,E")+"¶m.processorURL=" + escape(processorURL) + "¶m.getterURL=" + escape(getterURL) + - "¶m.keys=" + escape("C1,HC2"); + "¶m.thkeys=" + escape("TC1,HC2,L") + + "¶m.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+ + "¶m.encoding=iso-8859-1" + + "¶m.media-type=text/html" + + "¶m.keys=" + escape("C1,HC2,L") + + "¶m.interfaceURL=" + escape(interfaceURL); } else if (format == "mml_cont" && type == "cic") { keys = "C1"; } else if (format == "mml_cont" && type == "theory") { - keys = "T1,E¶m.keys=C1"; + keys = escape("T1,E")+"¶m.keys=C1¶m.thkeys=TC1"; } else if (format == "mml_pres" && type == "cic") { - keys = "C1,C2"; + keys = escape("C1,C2,L")+"¶m.processorURL=" + escape(processorURL) + + "¶m.getterURL=" + escape(getterURL) + + "&prop.doctype-public="+ + "&prop.encoding=" + + "&prop.media-type=text/xml" + + "¶m.doctype-public=" + + "¶m.encoding=" + + "¶m.media-type=text/xml" + + "¶m.keys=" + escape("C1,C2,L") + + "¶m.interfaceURL=" + escape(interfaceURL); } else if (format == "mml_pres" && type == "theory") { - keys = "T1,T2,E¶m.keys=C1,C2"; + keys = escape("T1,T2,L,E")+"¶m.keys=C1,C2,L¶m.thkeys=TC1,C2,L" + + "¶m.processorURL=" + escape(processorURL) + + "¶m.getterURL=" + escape(getterURL) + + "¶m.doctype-public=" + + "¶m.encoding=" + + "¶m.media-type=text/xml" + + "¶m.interfaceURL=" + escape(interfaceURL); } var naturalLanguage = typesflags; @@ -134,9 +189,12 @@ function makeURL(type,uri,cicflags,typesflags) if (cicflags != "NO" || type == "theory") { annotations = mode_list[4]; } - url = processorURL + "apply?xmluri=" + escape(getterURL + "getciconly?uri=" + uri) + "&keys=" + keys + "¶m.CICURI=" + uri + "¶m.naturalLanguage=" + naturalLanguage + "¶m.annotations=" + annotations; + url = processorURL + "apply?xmluri=" + escape(getterURL + "getxml?uri=" + uri) + "&keys=" + keys + "¶m.CICURI=" + uri + "¶m.naturalLanguage=" + naturalLanguage + "¶m.annotations=" + annotations; } - return url; + if (output == "raw") + return url + else + return interfaceURL + "?url=" + escape(url); }