]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/on-line/javascript/prelude.js
Many modifications to avoid JavaScript security rules of
[helm.git] / helm / on-line / javascript / prelude.js
index 12862e545024b4b116acc010a9f5555063c6667c..8b44e1471b6256f5ffbc7fcb71deffc36a8a6370 100644 (file)
@@ -75,6 +75,11 @@ function getUNICODEvsSYMBOL()
    return document.UNICODEvsSYMBOL.radioUNICODEvsSYMBOL[1].value;
 }
 
+function chopSlash(url)
+{
+  return url.slice(0,url.lastIndexOf('/'));
+}
+
 function refreshLinks()
 {
   var search = top.location.search;
@@ -99,12 +104,25 @@ function refreshLinks()
     "?processorURL=" + getUwoboURL() +
     "&getterURL=" + getGetterURL();
 
-  document.links[4].href = "../html/library/index.html?cicuri=" + cicuri
-     + "&theoryuri=" + theoryuri
-     + "&mode=" + mode
-     + "&processorURL=" + getUwoboURL()
-     + "&getterURL=" + getGetterURL()
-     + "&UNICODEvsSYMBOL=" + getUNICODEvsSYMBOL();
+  var topurl =
+   chopSlash(chopSlash(
+    document.location.protocol + '//' +
+    document.location.host +
+    document.location.pathname));
+  document.links[4].href =
+     getUwoboURL() + "apply" +
+      "?keys=RT" +
+      "&param.topurl=" + topurl +
+      "&xmluri=" +
+      escape(
+       topurl + "/html/library/index.html" +
+       "?cicuri=" + cicuri +
+       "&theoryuri=" + theoryuri +
+       "&mode=" + mode +
+       "&processorURL=" + getUwoboURL() +
+       "&getterURL=" + getGetterURL() +
+       "&UNICODEvsSYMBOL=" + getUNICODEvsSYMBOL()
+      );
 }
 
 function selectUwoboURL(ss)