Skip to content

Commit

Permalink
clickable elements
Browse files Browse the repository at this point in the history
  • Loading branch information
roclas committed Dec 17, 2014
1 parent 42ee83b commit 832346c
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 45 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/roclas/PomDependencyChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static Object[] getDependencies(String filename) {
dependency.put(name3, node3.getTextTrim());
}
}
dependencies.add(dependency.get("groupId") + ":" + dependency.get("artifactId") );//+depencency.get("version")
dependencies.add(dependency.get("groupId") + "__" + dependency.get("artifactId") );//+depencency.get("version")
}
}
}
Expand All @@ -82,7 +82,7 @@ private static String getProjectName(String filename) throws JDOMException, IOEx
file_id.put(name, node.getTextTrim());
}
}
String id = file_id.get("groupId") + ":" + file_id.get("artifactId");
String id = file_id.get("groupId") + "__" + file_id.get("artifactId");
return id;
}

Expand Down
16 changes: 9 additions & 7 deletions src/main/static/header_template.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ Explanation:<br>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script>
$(document).ready(function(){
//$("span.reverse").click(function(event){
//var id=this.getAttribute("class").split(" ")[1];
//var links=jQuery("a[href='#"+id+"']");
//links.each(function(i,e){ console.debug(e.getAttribute("class")); });
//event.preventDefault();
//});
$("span.dependsOnMe").hover(function(event){
$(this).css('cursor','pointer');
});
$("span.dependsOnMe").click(function(event){
//var id="null__crossdata-server";
var id=this.innerHTML;
$(document).scrollTop( $("#"+id).offset().top );
});
});
</script>
</script>
26 changes: 14 additions & 12 deletions src/main/static/test_files/output/dependencies.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,23 @@
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script>
$(document).ready(function(){
//$("span.reverse").click(function(event){
//var id=this.getAttribute("class").split(" ")[1];
//var links=jQuery("a[href='#"+id+"']");
//links.each(function(i,e){ console.debug(e.getAttribute("class")); });
//event.preventDefault();
//});
$("span.dependsOnMe").hover(function(event){
$(this).css('cursor','pointer');
});
$("span.dependsOnMe").click(function(event){
//var id="null__crossdata-server";
var id=this.innerHTML;
$(document).scrollTop( $("#"+id).offset().top );
});
});
</script>

<br /><strong id='com.mycompany:jdbc'>com.mycompany:jdbc</strong> (depends on 3) (0 depend on it):<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span class='dependsOnMe'>com.microsoft:mssqlserver</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span class='dependsOnMe'>com.microsoft:msutil</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span class='dependsOnMe'>com.microsoft:msbase</span><br />
<br /><strong id='com.mycompany__jdbc'>com.mycompany__jdbc</strong> (depends on 3) (0 depend on it):<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span class='dependsOnMe'>com.microsoft__mssqlserver</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span class='dependsOnMe'>com.microsoft__msutil</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span class='dependsOnMe'>com.microsoft__msbase</span><br />

<br /><strong id='com.roclas:jdbc'>com.roclas:jdbc</strong> (depends on 1) (0 depend on it):<br />
&nbsp;&nbsp;&nbsp;&nbsp;<a class='com.roclas:jdbc dependsOnMe' href='#com.mycompany:jdbc'>com.mycompany:jdbc</a><br />
<br /><strong id='com.roclas__jdbc'>com.roclas__jdbc</strong> (depends on 1) (0 depend on it):<br />
&nbsp;&nbsp;&nbsp;&nbsp;<a class='com.roclas__jdbc dependsOnMe' href='#com.mycompany__jdbc'>com.mycompany__jdbc</a><br />
</body>
</html>
48 changes: 24 additions & 24 deletions src/test/java/com/roclas/AppTest.java
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package com.roclas;

import java.io.File;
import java.io.IOException;

import org.junit.Test;

import com.roclas.PomDependencyChecker;

/**
* Unit test for simple App.
*/
public class AppTest {


@Test
public void testApp() throws IOException {
//String input_dir="D:/MyCode/Mypoms";
//String output_dir="D:\\MyCode";
package com.roclas;

import java.io.File;
import java.io.IOException;

import org.junit.Test;

import com.roclas.PomDependencyChecker;

/**
* Unit test for simple App.
*/
public class AppTest {


@Test
public void testApp() throws IOException {
//String input_dir="D:/MyCode/Mypoms";
//String output_dir="D:\\MyCode";
String input_dir = "src/main/static/test_files/input";
String output_dir = "src/main/static/test_files/output";
PomDependencyChecker.printDependencyTree(input_dir,output_dir);
//assertTrue( true );
}

}
PomDependencyChecker.printDependencyTree(input_dir,output_dir);
//assertTrue( true );
}

}

0 comments on commit 832346c

Please sign in to comment.