X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fon-line%2Fjavascript%2Fprelude.js;h=69479641cd5af9ee32d8ae20aa3d678ee60df6d6;hb=d42f916052e67304e8b46e537b9a4bbaf2c2607e;hp=dff8c31fa0ae580a235d8de6ad20940ffb2594ee;hpb=97829180b4bc5a72291eeb8156b15b3922f07048;p=helm.git diff --git a/helm/on-line/javascript/prelude.js b/helm/on-line/javascript/prelude.js index dff8c31fa..69479641c 100644 --- a/helm/on-line/javascript/prelude.js +++ b/helm/on-line/javascript/prelude.js @@ -27,6 +27,36 @@ function getInitialGetterURL() return getterURL; } +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() +{ + if (getInitialUNICODEvsSYMBOL() == "symbol") + return "CHECKED"; + else + return ""; +} + +function getInitialUNICODEvsSYMBOLunicode() +{ + if (getInitialUNICODEvsSYMBOL() == "unicode") + return "CHECKED"; + else + return ""; +} + function getUwoboURL() { return document.uwoboURL.elements[0].value; @@ -37,6 +67,19 @@ function getGetterURL() return document.getterURL.elements[0].value; } +function getUNICODEvsSYMBOL() +{ + if (document.UNICODEvsSYMBOL.radioUNICODEvsSYMBOL[0].checked) + return document.UNICODEvsSYMBOL.radioUNICODEvsSYMBOL[0].value; + else + return document.UNICODEvsSYMBOL.radioUNICODEvsSYMBOL[1].value; +} + +function chopSlash(url) +{ + return url.slice(0,url.lastIndexOf('/')); +} + function refreshLinks() { var search = top.location.search; @@ -46,26 +89,47 @@ function refreshLinks() for (var i = 0 ; i < args.length ; i++) { var couple = args[i].split("="); switch (couple[0]) { - case "cicuri" : cicuri =couple[1]; break; - case "theoryuri" : theoryicuri =couple[1]; break; - case "mode" : mode =couple[1]; break; + 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].search = "?getterURL=" + getGetterURL(); - - document.links[3].search = - "?processorURL=" + getUwoboURL() + - "&getterURL=" + getGetterURL(); - - document.links[4].href = "../html/library/index.html?cicuri=" + cicuri - + "&theoryuri=" + theoryuri - + "&mode=" + mode - + "&processorURL=" + getUwoboURL() - + "&getterURL=" + getGetterURL(); + 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() + + "&UNICODEvsSYMBOL=" + getUNICODEvsSYMBOL() + ); } function selectUwoboURL(ss) @@ -76,7 +140,7 @@ function selectUwoboURL(ss) document.uwoboURL.elements[0].value = "http://" + ss.options[ss.selectedIndex].value + ":8080/helm/servlet/uwobo/"; } - refreshLink(); + refreshLinks(); } function selectGetterURL(ss) @@ -87,5 +151,5 @@ function selectGetterURL(ss) document.getterURL.elements[0].value = "http://" + ss.options[ss.selectedIndex].value + ":8081/"; } - refreshLink(); + refreshLinks(); }