--- a/tool/run/plugins/spdx/show.java
+++ b/tool/run/plugins/spdx/show.java
@@ -30,6 +30,7 @@
import main.param;
import script.log;
import utils.html;
+import www.RequestOrigin;
import www.WebRequest;
@@ -92,6 +93,16 @@
counterLicensesDeclared += doStatistics(spdx);
}
+ String reviewerList = "";
+ // just one reviewer
+ if(counterCreators == 1){
+ reviewerList = counterCreators + " reviewer" + html.br;
+ }
+ if(counterCreators > 1){
+ reviewerList = counterCreators + " reviewers" + html.br;
+ }
+
+
// calculate percentage of files with a license declared
// String percentage =
// " ("
@@ -126,7 +137,7 @@
+ html.br
//+ percentage
//+ html.getCommonFolderIcon("stickman.png")
- + counterCreators + " reviewers" + html.br
+ + reviewerList
+ html.br
;
@@ -285,14 +296,24 @@
// read the whole file
String result = utils.files.readAsString(file);
+
+
+ // what happens when we want to see this file from a browser?
+ if(request.requestOrigin == RequestOrigin.BROWSER){
// we have to make it web-ready, replace break lines with BR tags
result =
"<p>"
+ result.replace("\n", "<br>")
+ "</p>";
-
// output the file
request.setAnswer(result);
+ return;
+ }
+
+ request.setAnswer("Loading text..");
+ // we just want to just this on the GUI
+ core.studio.editorPane(is.contentText, false, 0, result);
+
}