X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=blobdiff_plain;f=helm%2Fon-line%2Fjavascript%2Fcontrol.js;fp=helm%2Fon-line%2Fjavascript%2Fcontrol.js;h=0000000000000000000000000000000000000000;hp=d49da35ba42c81d687d55c431b919bf47ecb0f5c;hb=869549224eef6278a48c16ae27dd786376082b38;hpb=89262281b6e83bd2321150f81f1a0583645eb0c8 diff --git a/helm/on-line/javascript/control.js b/helm/on-line/javascript/control.js deleted file mode 100644 index d49da35ba..000000000 --- a/helm/on-line/javascript/control.js +++ /dev/null @@ -1,293 +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 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="; - - 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 = - top.processorURL + 'apply' + - '?keys=RT' + - '¶m.topurl=' + topurl + - '&xmluri=' + - escape(top.topurl + '/html/library/control.html' + dest + top.mode); - - location.href = href; - } -} - -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 + - "&proofcheckerURL=" + top.proofcheckerURL + - "&draw_graphURL=" + top.draw_graphURL + - "&uri_set_queueURL=" + top.uri_set_queueURL + - "&UNICODEvsSYMBOL=" + top.UNICODEvsSYMBOL; - - var href = - top.processorURL + 'apply' + - '?keys=RT' + - '¶m.topurl=' + top.topurl + - '&xmluri=' + - escape(top.topurl + '/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; - - return true; -} - -function refreshcicHeader(headerURL) -{ - top.cicheader.location.search = "?keys=GP&xmluri=" + headerURL + "¶m.uri=" + top.cicuri; - return true; -} - -function refreshtheoryHeader(headerURL) -{ - top.theoryheader.location.search = "?keys=GP&xmluri=" + headerURL + "¶m.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 makeURL(type,uri,cicflags,typesflags) -{ - 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 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 { - if (format == "html" && type == "cic") { - keys = getCICHTMLKeys() + - "¶m.processorURL=" + escape(processorURL) + - "¶m.getterURL=" + escape(getterURL) + - "¶m.proofcheckerURL=" + escape(proofcheckerURL) + - "¶m.draw_graphURL=" + escape(draw_graphURL) + - "¶m.uri_set_queueURL=" + escape(uri_set_queueURL) + - "¶m.UNICODEvsSYMBOL=" + escape(UNICODEvsSYMBOL) + - "&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=" + getCICHTMLKeys() + - "¶m.interfaceURL=" + escape(interfaceURL); - } else if (format == "html" && type == "theory") { - keys = getTheoryKeys()+ - "¶m.processorURL=" + escape(processorURL) + - "¶m.getterURL=" + escape(getterURL) + - "¶m.proofcheckerURL=" + escape(proofcheckerURL) + - "¶m.draw_graphURL=" + escape(draw_graphURL) + - "¶m.uri_set_queueURL=" + escape(uri_set_queueURL) + - "¶m.UNICODEvsSYMBOL=" + escape(UNICODEvsSYMBOL) + - "¶m.keys=" + getCICHTMLKeys() + - "¶m.thkeys=" + getTheoryKeys() + - "¶m.embedkeys=" + getEmbedKeys() + - "¶m.doctype-public="+escape("-//W3C//DTD XHTML 1.0 Transitional//EN")+ - "¶m.encoding=iso-8859-1" + - "¶m.thencoding=iso-8859-1" + - "¶m.media-type=text/html" + - "¶m.thmedia-type=text/html" + - "¶m.interfaceURL=" + escape(interfaceURL) + - "¶m.thinterfaceURL=" + escape(thinterfaceURL); - } else if (format == "mml_cont" && type == "cic") { - keys = escape("d_c,C1")+ - "&prop.doctype-public="+ - "&prop.encoding=" + - "&prop.media-type=text/xml" + - "¶m.doctype-public=" + - "¶m.encoding=" + - "¶m.media-type=text/xml"; - } else if (format == "mml_cont" && type == "theory") { - keys = escape("T1,L,E")+ - "¶m.keys=" + escape("d_c,C1") + - "¶m.thkeys=T1,L,E" + - "¶m.embedkeys=" + escape("d_c,TC1") + - - "¶m.processorURL=" + escape(processorURL) + - "¶m.getterURL=" + escape(getterURL) + - "¶m.proofcheckerURL=" + escape(proofcheckerURL) + - "¶m.draw_graphURL=" + escape(draw_graphURL) + - "¶m.uri_set_queueURL=" + escape(uri_set_queueURL) + - "¶m.doctype-public=" + - "¶m.encoding=" + - "¶m.thencoding=iso-8859-1" + - "¶m.media-type=text/xml" + - "¶m.thmedia-type=text/html" + - "¶m.interfaceURL=" + escape(interfaceURL) + - "¶m.thinterfaceURL=" + escape(thinterfaceURL); - } else if (format == "mml_pres" && type == "cic") { - keys = getCICMathMLKeys()+ - "¶m.processorURL=" + escape(processorURL) + - "¶m.getterURL=" + escape(getterURL) + - "¶m.proofcheckerURL=" + escape(proofcheckerURL) + - "¶m.draw_graphURL=" + escape(draw_graphURL) + - "¶m.uri_set_queueURL=" + escape(uri_set_queueURL) + - "&prop.doctype-public="+ - "&prop.encoding=" + - "&prop.media-type=text/xml" + - "¶m.doctype-public=" + - "¶m.encoding=" + - "¶m.media-type=text/xml" + - "¶m.keys=" + getCICMathMLKeys() + - "¶m.interfaceURL=" + escape(interfaceURL); - } else if (format == "mml_pres" && type == "theory") { - keys = getTheoryKeys()+ - "¶m.keys=" + getCICMathMLKeys() + - "¶m.thkeys=" + getTheoryKeys() + - "¶m.embedkeys=" + escape("d_c,TC1,G,C2,L") + - "¶m.processorURL=" + escape(processorURL) + - "¶m.getterURL=" + escape(getterURL) + - "¶m.proofcheckerURL=" + escape(proofcheckerURL) + - "¶m.draw_graphURL=" + escape(draw_graphURL) + - "¶m.uri_set_queueURL=" + escape(uri_set_queueURL) + - "¶m.doctype-public=" + - "¶m.encoding=" + - "¶m.thencoding=iso-8859-1" + - "¶m.media-type=text/xml" + - "¶m.thmedia-type=text/html" + - "¶m.interfaceURL=" + escape(interfaceURL) + - "¶m.thinterfaceURL=" + escape(thinterfaceURL); - } - - 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 + "¶m.CICURI=" + uri + "¶m.naturalLanguage=" + naturalLanguage + "¶m.annotations=" + annotations + "¶m.topurl=" + top.topurl; - } - - if (output == "raw") - return url; - else if (type == "cic") - return interfaceURL + "?url=" + escape(url); - else if (type == "theory") - return thinterfaceURL + "?url=" + escape(url) -} -