]> matita.cs.unibo.it Git - helm.git/commitdiff
The JavaScript code is now defined in on-line/javascript/graphLinks.xsl and
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 25 Oct 2001 10:20:58 +0000 (10:20 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 25 Oct 2001 10:20:58 +0000 (10:20 +0000)
it is shared with medataLib.xsl.

helm/on-line/xslt/makeGraphLinks.xsl

index 96fd3165445d2c9239613c614e44c0fbf73db3da..f56026f40032966c888952482a9ba1bb4d29fabe 100644 (file)
@@ -45,6 +45,7 @@
    <subst:script language="JavaScript" src="/javascript/defaults.js"/>
    <subst:script language="JavaScript" src="/javascript/utils.js"/>
    <subst:script language="JavaScript" src="/javascript/control.js"/>
+   <subst:script language="JavaScript" src="/javascript/graphLinks.js"/>
    <script language="JavaScript" type="text/javascript">
     <!-- topurl will be used by the code in jsmenu/* -->
     var topurl = "<subst:topurl/>";
@@ -105,77 +106,6 @@ HM_PG_ShowLinkCursor = 1;
 HM_PG_NSFontOver = true;
 
 //HM_a_TreesToBuild = [2];
-]]>
-   </script>
-   <script>
-<![CDATA[
-function mkRDFURI(uri)
-{
-   var prefix = "helm:rdf:www.cs.unibo.it/helm/rdf/backward//";
-   var re1 = /#xpointer\(1\/(\d+)\/(\d+)\)/;
-   var re2 = /#xpointer\(1\/(\d+)\)/;
-   // Just one of the following replace will do something
-   uri = uri.replace(re1,",$1,$2");
-   uri = uri.replace(re2,",$1");
-
-   return (prefix + uri);
-}
-
-function removeXPointer(uri)
-{
-   //var re = /#xpointer(\.*)/;
-   // CSC: Why the r.e.s below work and the one above does not?
-   var re1 = /#xpointer\(1\/(\d+)\/(\d+)\)/;
-   var re2 = /#xpointer\(1\/(\d+)\)/;
-   var res = uri.replace(re1,"");
-   res = res.replace(re2,"");
-
-   return res;
-}
-
-
-// (use_rdf_uri==true) if the stylesheet must be applied to the
-// metadata; (use_rdf_uri==false) otherwise
-function mkGraphURL(uri,keys,use_rdf_uri)
-{
-   var getterURL = unescape(getParam("param.getterURL"));
-   var draw_graphURL = unescape(getParam("param.draw_graphURL"));
-   var url= setParam(location.href,"keys",keys);
-   var rdfuri = mkRDFURI(uri);
-   url = setParam(url,"xmluri", getterURL + 'getxml%3Furi%3D' +
-    (use_rdf_uri ? rdfuri : removeXPointer(uri)));
-   url = setParam(url,"param.CICURI",escape(uri));
-   var uri_set_size = document.uri_set_size.elements[0].value;
-   url = setParam(url,"param.uri_set_size",uri_set_size);
-   url = draw_graphURL + 'draw?url=' + escape(url);
-   var url2 = setParam(location.href,"keys","MGL,RT");
-   url2 = setParam(url2,"xmluri",escape(url));
-   url2 = setParam(url2,"param.uri_set_size",uri_set_size);
-   return url2;
-}
-
-function mkDepURL(uri)
-{
-   return mkGraphURL(uri,"MDG",0);
-}
-
-
-function mkMetaURL(uri)
-{
-   return mkGraphURL(uri,"MMG",1);
-}
-
-function mkCICURL(uri)
-{
-   var rawuri = removeXPointer(uri);
-   var getterURL = getParam("param.getterURL");
-   var interfaceURL = unescape(getParam("param.interfaceURL"));
-   var url= setParam(location.href,"keys",getParam("param.keys"));
-   url = setParam(url,"xmluri", getterURL + 'getxml%3Furi%3D' + rawuri);
-   url = setParam(url,"param.CICURI",rawuri);
-   url = interfaceURL + "?url=" + escape(url);
-   return url;
-}
 ]]>
    </script>
    <xsl:apply-templates/>
@@ -196,9 +126,9 @@ HM_Array1 = [
 [,,,
 ,,,,,,,,,,,,,,,,
 1,true],
-["Objects this one depends on.","javascript:window.open(mkDepURL(selectedURI),'graph')",1,0,0],
+["Objects this one depends on.","javascript:window.open(mkDepURL(selectedURI,false),'graph')",1,0,0],
 ["Render this object.","javascript:window.open(mkCICURL(selectedURI),'cic')",1,0,0],
-["Objects depending on this one.","javascript:window.open(mkMetaURL(selectedURI),'graph')",1,0,0]
+["Objects depending on this one.","javascript:window.open(mkMetaURL(selectedURI,false),'graph')",1,0,0]
 ];
 ]]>
    </script>