-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a53866
commit 79abe49
Showing
3 changed files
with
80 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
$(document).ready(function(){ | ||
|
||
$('#push-to-sparql-btn').click(function(){ | ||
let endPoint = $('#push-to-sparql-url').val(); | ||
$.ajax({ | ||
url: endPoint, | ||
method: "GET", | ||
dataType: "json", | ||
success: function(responseData) { | ||
if (responseData["_result"]){ | ||
createSuccessAlert(); | ||
|
||
} | ||
}, | ||
error: function(jqXHR, textStatus, errorThrown) { | ||
createFailAlert(); | ||
} | ||
}); | ||
}); | ||
|
||
|
||
$('#delete-sparql-btn').click(function(){ | ||
let endPoint = $('#delete-sparql-url').val(); | ||
$.ajax({ | ||
url: endPoint, | ||
method: "GET", | ||
dataType: "json", | ||
success: function(responseData) { | ||
console.info(responseData) | ||
if (responseData["_result"]){ | ||
createSuccessAlert(); | ||
|
||
} | ||
}, | ||
error: function(jqXHR, textStatus, errorThrown) { | ||
createFailAlert(); | ||
} | ||
}); | ||
}); | ||
|
||
|
||
|
||
}); | ||
|
||
|
||
|
||
function createSuccessAlert(){ | ||
let alertDiv = document.createElement("div"); | ||
alertDiv.classList.add("alert", "alert-success"); | ||
let strongElement = document.createElement("strong"); | ||
strongElement.textContent = "Job is in queue!"; | ||
let textNode = document.createTextNode(" It may take some time to finish. You can check the result in the CKAN log."); | ||
alertDiv.appendChild(strongElement); | ||
alertDiv.appendChild(textNode); | ||
let container = document.getElementById("alert_container"); | ||
container.appendChild(alertDiv); | ||
} | ||
|
||
|
||
|
||
function createFailAlert(){ | ||
let alertDiv = document.createElement("div"); | ||
alertDiv.classList.add("alert", "alert-danger"); | ||
let strongElement = document.createElement("strong"); | ||
strongElement.textContent = "Something wen wrong!"; | ||
let textNode = document.createTextNode("Please try later or check CKAN for possible bugs/issues!"); | ||
alertDiv.appendChild(strongElement); | ||
alertDiv.appendChild(textNode); | ||
let container = document.getElementById("alert_container"); | ||
container.appendChild(alertDiv); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters