X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fon-line%2Fjavascript%2Fprelude.js;h=d89ae566d333ae2b54a70c88f8adec07c2697ade;hb=4167cea65ca58897d1a3dbb81ff95de5074700cc;hp=fc3b2470e51749b0f2553fabb5f3d733321c6f02;hpb=aacc5f566b60763bede71263cb9441b5b2fb04a1;p=helm.git diff --git a/helm/on-line/javascript/prelude.js b/helm/on-line/javascript/prelude.js index fc3b2470e..d89ae566d 100644 --- a/helm/on-line/javascript/prelude.js +++ b/helm/on-line/javascript/prelude.js @@ -1,105 +1,3 @@ - -function getInitialProcessorURL() -{ - var search = top.location.search; - search = search.slice(1); - var args = search.split("&"); - var processorURL = "-1"; - for (var i = 0 ; i < args.length ; i++) { - var couple = args[i].split("="); - if (couple[0] == "processorURL") processorURL = couple[1]; - } - if (processorURL == "-1") processorURL = getDefaultParam("processorURL"); - return processorURL; -} - -function getInitialGetterURL() -{ - var search = top.location.search; - search = search.slice(1); - var args = search.split("&"); - var getterURL = "-1"; - for (var i = 0 ; i < args.length ; i++) { - var couple = args[i].split("="); - if (couple[0] == "getterURL") getterURL = couple[1]; - } - if (getterURL == "-1") getterURL = getDefaultParam("getterURL"); - return getterURL; -} - -function getInitialProofCheckerURL() -{ - var search = top.location.search; - search = search.slice(1); - var args = search.split("&"); - var proofcheckerURL = "-1"; - for (var i = 0 ; i < args.length ; i++) { - var couple = args[i].split("="); - if (couple[0] == "proofcheckerURL") proofcheckerURL = couple[1]; - } - if (proofcheckerURL == "-1") - proofcheckerURL = getDefaultParam("proofcheckerURL"); - return proofcheckerURL; -} - -function getInitialDrawGraphURL() -{ - var search = top.location.search; - search = search.slice(1); - var args = search.split("&"); - var draw_graphURL = "-1"; - for (var i = 0 ; i < args.length ; i++) { - var couple = args[i].split("="); - if (couple[0] == "draw_graphURL") draw_graphURL = couple[1]; - } - if (draw_graphURL == "-1") draw_graphURL = getDefaultParam("draw_graphURL"); - return draw_graphURL; -} - -function getInitialURISetQueueURL() -{ - var search = top.location.search; - search = search.slice(1); - var args = search.split("&"); - var uri_set_queueURL = "-1"; - for (var i = 0 ; i < args.length ; i++) { - var couple = args[i].split("="); - if (couple[0] == "uri_set_queueURL") uri_set_queueURL = couple[1]; - } - if (uri_set_queueURL == "-1") uri_set_queueURL = getDefaultParam("uri_set_queueURL"); - return uri_set_queueURL; -} - -function getInitialUNICODEvsSYMBOL() -{ - var search = top.location.search; - search = search.slice(1); - var args = search.split("&"); - var UNICODEvsSYMBOL = "-1"; - for (var i = 0 ; i < args.length ; i++) { - var couple = args[i].split("="); - if (couple[0] == "UNICODEvsSYMBOL") UNICODEvsSYMBOL = couple[1]; - } - if (UNICODEvsSYMBOL == "-1") UNICODEvsSYMBOL = getDefaultParam("UNICODEvsSYMBOL"); - return UNICODEvsSYMBOL; -} - -function getInitialUNICODEvsSYMBOLsymbol(defaultValue) -{ - if (defaultValue == "symbol") - return "CHECKED"; - else - return ""; -} - -function getInitialUNICODEvsSYMBOLunicode(defaultValue) -{ - if (defaultValue == "unicode") - return "CHECKED"; - else - return ""; -} - function getProfileId() { return document.profile.elements[0].value; @@ -120,6 +18,11 @@ function getProofCheckerURL() return document.proofcheckerURL.elements[0].value; } +function getSearchEngineURL() +{ + return document.searchengineURL.elements[0].value; +} + function getDrawGraphURL() { return document.draw_graphURL.elements[0].value; @@ -135,6 +38,11 @@ function getRdflyURL() return document.rdflyURL.elements[0].value; } +function getInterfaceURL() +{ + return document.interfaceURL.elements[0].value; +} + function getUNICODEvsSYMBOL() { if (document.UNICODEvsSYMBOL.radioUNICODEvsSYMBOL[0].checked) @@ -163,72 +71,14 @@ function getUpdateURL() '¶m.uri_set_queueURL=' + escape(getURISetQueueURL()) + '¶m.draw_graphURL=' + escape(getDrawGraphURL()) + '¶m.proofcheckerURL=' + escape(getProofCheckerURL()) + + '¶m.searchengineURL=' + escape(getSearchEngineURL()) + '¶m.rdflyURL=' + escape(getRdflyURL()) + + '¶m.interfaceURL=' + escape(getInterfaceURL()) + '¶m.naturalLanguage=' + escape(getNaturalLanguage()) + '¶m.uri_set_size=' + escape(getMaxGraphSize()) + '¶m.UNICODEvsSYMBOL=' + escape(getUNICODEvsSYMBOL()); } -function chopSlash(url) -{ - return url.slice(0,url.lastIndexOf('/')); -} - -function refreshLinks() -{ - var search = top.location.search; - search = search.slice(1); - var args = search.split("&"); - var cicuri = "-1", theoryuri = "-1", mode = "-1"; - for (var i = 0 ; i < args.length ; i++) { - var couple = args[i].split("="); - switch (couple[0]) { - case "cicuri" : cicuri =couple[1]; break; - case "theoryuri" : theoryuri =couple[1]; break; - case "mode" : mode =couple[1]; break; - } - } - if (cicuri == "-1") cicuri = getDefaultParam("cicuri"); - if (theoryuri == "-1") theoryuri = getDefaultParam("theoryuri"); - if (mode == "-1") mode = getDefaultParam("mode"); - - document.links[2].href = - document.links[2].protocol + '//' + - document.links[2].host + - document.links[2].pathname + - "?getterURL=" + getGetterURL(); - - document.links[3].href = - document.links[3].protocol + '//' + - document.links[3].host + - document.links[3].pathname + - "?processorURL=" + getUwoboURL() + - "&getterURL=" + getGetterURL(); - - var topurl = - chopSlash(chopSlash( - document.location.protocol + '//' + - document.location.host + - document.location.pathname)); - document.links[4].href = - getUwoboURL() + "apply" + - "?keys=RT" + - "¶m.topurl=" + topurl + - "&xmluri=" + - escape( - topurl + "/html/library/index.html" + - "?cicuri=" + cicuri + - "&theoryuri=" + theoryuri + - "&mode=" + mode + - "&processorURL=" + getUwoboURL() + - "&getterURL=" + getGetterURL() + - "&proofcheckerURL=" + getProofCheckerURL() + - "&draw_graphURL=" + getDrawGraphURL() + - "&uri_set_queueURL=" + getURISetQueueURL() + - "&UNICODEvsSYMBOL=" + getUNICODEvsSYMBOL() - ); -} - function selectUwoboURL(ss) { if (ss.selectedIndex == 0) { @@ -237,7 +87,7 @@ function selectUwoboURL(ss) document.uwoboURL.elements[0].value = "http://" + ss.options[ss.selectedIndex].value + ":58080/"; } } - + function selectGetterURL(ss) { if (ss.selectedIndex == 0) { @@ -256,6 +106,15 @@ function selectProofCheckerURL(ss) } } +function selectSearchEngineURL(ss) +{ + if (ss.selectedIndex == 0) { + document.searchengineURL.elements[0].value = ""; + } else { + document.searchengineURL.elements[0].value = "http://" + ss.options[ss.selectedIndex].value + ":58085/"; + } +} + function selectDrawGraphURL(ss) { if (ss.selectedIndex == 0) { @@ -283,6 +142,15 @@ function selectRdflyURL(ss) } } +function selectInterfaceURL(ss) +{ + if (ss.selectedIndex == 0) { + document.interfaceURL.elements[0].value = ""; + } else { + document.interfaceURL.elements[0].value = "http://helm.cs.unibo.it/helm"; + } +} + function selectProfile(ss, interfaceURL) { location = getUwoboURL() +