Erik Perrone 6 years ago
parent cee6ef152a
commit 4f161ecff4

@ -15,6 +15,7 @@ var checkedAnnotation = "";
var algIndexedArray = [];
var computedLanguage = "";
var dataMiner = "";
var appRoot = "/nlphub";
// ------------------------------------------------------------------------------------------------------
// Starting point: get the csv file with algorithm parameters and set the page
@ -36,7 +37,7 @@ checkInputLink = function() {
async : true,
success : function(data, stato) {
freeText = data;
var uploaderUrl = "/nlphub/nlphub-uploader-servlet?getlang=on&freetext="
var uploaderUrl = appRoot + "/nlphub-uploader-servlet?getlang=on&freetext="
+ encodeURIComponent(freeText) + "&dataminer=" + encodeURIComponent(dataMiner);
if(gCubeToken.length > 0)
uploaderUrl += "&gcube-token=" + gCubeToken;
@ -99,7 +100,7 @@ initApplication = function() {
});
disableExecuteButton();
var uploaderUrl = "/nlphub/nlphub-uploader-servlet?dataminer=" + encodeURIComponent(dataMiner);
var uploaderUrl = appRoot + "/nlphub-uploader-servlet?dataminer=" + encodeURIComponent(dataMiner);
if(gCubeToken.length > 0)
uploaderUrl += "&gcube-token=" + gCubeToken;
@ -243,36 +244,36 @@ setEventListeners = function() {
// must be written in the workspace and the public link
// is set.
if ($("#input-textarea").val().length > 0) {
if(publicLink == null) {
freeText = $("#input-textarea").val();
var uploaderUrl = "/nlphub/nlphub-uploader-servlet?freetext="
+ encodeURIComponent(freeText) + "&dataminer=" + encodeURIComponent(dataMiner);
if(gCubeToken.length > 0)
uploaderUrl += "&gcube-token=" + gCubeToken;
$.ajax({
url : uploaderUrl,
type : "POST",
async : true,
contentType : "text/plain; charset=utf-8",
success : function(data, stato) {
publicLink = data.message;
if (publicLink == null) {
alert("Error uploading file.");
}
runAlgorithm();
},
error : function(richiesta, stato,
errori) {
alert("Unexpected Error. Status: "
+ richiesta.status);
hideProgress();
textAreaEnable(true);
$("#file-info").empty();
//if(publicLink == null) {
freeText = $("#input-textarea").val();
var uploaderUrl = appRoot + "/nlphub-uploader-servlet?freetext="
+ encodeURIComponent(freeText) + "&dataminer=" + encodeURIComponent(dataMiner);
if(gCubeToken.length > 0)
uploaderUrl += "&gcube-token=" + gCubeToken;
$.ajax({
url : uploaderUrl,
type : "POST",
async : true,
contentType : "text/plain; charset=utf-8",
success : function(data, stato) {
publicLink = data.message;
if (publicLink == null) {
alert("Error uploading file.");
}
});
}
else runAlgorithm();
runAlgorithm();
},
error : function(richiesta, stato,
errori) {
alert("Unexpected Error. Status: "
+ richiesta.status);
hideProgress();
textAreaEnable(true);
$("#file-info").empty();
}
});
//}
//else runAlgorithm();
}
else {
@ -579,7 +580,7 @@ runAlgorithm = function() {
parameters += "&plink=" + encodeURIComponent(publicLink);
parameters += "&algs=" + algList;
var nlphubUrl = "/nlphub/nlphub-servlet?" + parameters;
var nlphubUrl = appRoot + "/nlphub-servlet?" + parameters;
if(gCubeToken.length > 0)
nlphubUrl += "&gcube-token=" + gCubeToken;
$.ajax({
@ -629,7 +630,7 @@ getOutputJson = function(message) {
parameters += "&tobemap=" + encodeURI(tobemap);
//console.log(parameters);
var mapperUrl = "/nlphub/nlphub-mapper-servlet?" + parameters;
var mapperUrl = appRoot + "/nlphub-mapper-servlet?" + parameters;
if(gCubeToken.length > 0)
mapperUrl += "&gcube-token=" + gCubeToken;
@ -1001,7 +1002,7 @@ resizeTable = function() {
+ "\" value=\"" + annotations[i]
+ "\" checked=\"checked\"></input> <label for=\"check-" + i
+ "\">" + annotations[i] + "</label>";
if(annotations[i].toLowerCase() == "keyword") {
if((annotations[i].toLowerCase() == "keyword") || (annotations[i].toLowerCase() == "event")) {
annotationElement = "<input type=\"checkbox\" id=\"check-" + i
+ "\" value=\"" + annotations[i]
+ "\"></input> <label for=\"check-" + i
@ -1081,7 +1082,6 @@ buildLanguageList = function() {
selectAnnotationsByLanguage();
});
$("#language-select").change();
}
/*

Loading…
Cancel
Save