2015-01-07 16:18:41 -05:00
|
|
|
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
|
|
|
|
|
|
|
/*
|
|
|
|
Functions for use by searchIndex.ftl
|
|
|
|
*/
|
|
|
|
|
|
|
|
function updateSearchIndexerStatus() {
|
|
|
|
$.ajax({
|
|
|
|
url: searchIndexerStatusUrl,
|
|
|
|
dataType: "html",
|
|
|
|
complete: function(xhr, status) {
|
2015-01-20 14:06:11 -05:00
|
|
|
if (xhr.status == 200) {
|
|
|
|
updatePanelContents(xhr.responseText);
|
|
|
|
setTimeout(updateSearchIndexerStatus,5000);
|
|
|
|
} else {
|
|
|
|
displayErrorMessage(xhr.status + " " + xhr.statusText);
|
|
|
|
}
|
2015-01-07 16:18:41 -05:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function updatePanelContents(contents) {
|
|
|
|
document.getElementById("searchIndexerStatus").innerHTML = contents;
|
|
|
|
}
|
|
|
|
|
2015-01-20 14:06:11 -05:00
|
|
|
function displayErrorMessage(message) {
|
|
|
|
document.getElementById("searchIndexerError").innerHTML = "<h3>" + message + "</h3>";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-01-07 16:18:41 -05:00
|
|
|
$(document).ready(updateSearchIndexerStatus());
|