Skip to content

Commit

Permalink
new child element functions #21482
Browse files Browse the repository at this point in the history
  • Loading branch information
nczirjak-acdh committed Sep 3, 2024
1 parent d479dc0 commit 381573c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions js/smartsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jQuery(function ($) {
function showJustSearchFacets() {
window.token++;
var localToken = window.token;
var pagerPage = (window.getGuiSearchParams('actualPage') ?? 1) - 1;
var pagerPage = (window.getGuiSearchParams('page') ?? 1) - 1;
$('.main-content-warnings').html('');
var param = {
url: '/browser/api/smartsearch',
Expand All @@ -209,10 +209,10 @@ jQuery(function ($) {
};
param.fail = function (xhr, status, error) {
if (xhr.status === 404) {
$('.main-content-row').html('<div class="alert alert-danger" role="alert">' + Drupal.t("Error! Search API has the following error: " + error) + '</div>');
$('.main-content-row').html('<div class="alert alert-danger" role="alert">' + Drupal.t("Error! Search API has the following error:11 " + error) + '</div>');
}
alert(xhr.responseText);
$('.main-content-row').html('<div class="alert alert-danger" role="alert">' + Drupal.t("Error! Search API has the following error: " + error) + '</div>');
$('.main-content-row').html('<div class="alert alert-danger" role="alert">' + Drupal.t("Error! Search API has the following error:22 " + error) + '</div>');
};
/*
param.statusCode = function (response) {
Expand All @@ -224,7 +224,7 @@ jQuery(function ($) {
if (error === 'timeout') {
$('.main-content-row').html('<div class="alert alert-danger" role="alert">' + Drupal.t("Timeout error, please refine your Query!") + '</div>');
} else {
$('.main-content-row').html('<div class="alert alert-danger" role="alert">' + Drupal.t("Error! Search API has the following error: " + xhr.responseText) + '</div>');
$('.main-content-row').html('<div class="alert alert-danger" role="alert">' + Drupal.t("Error! Search API has the following error:33 " + xhr.responseText) + '</div>');
}
};
param.timeout = 60000;
Expand Down Expand Up @@ -352,6 +352,9 @@ jQuery(function ($) {

var searchStr = $('#sm-hero-str').val();
var pagerPage = (window.getGuiSearchParams('page') ?? 1) - 1;
if(pagerPage === -1) {
pagerPage = 0;
}

//var guiFacets_ = (getGuiSearchParams('facets')) ? getGuiSearchParams('facets') : {};

Expand All @@ -362,8 +365,6 @@ jQuery(function ($) {
updateSearchStrInput(searchStr);

var param = window.buildParams(searchStr, pagerPage);

//updateUrl(param.data);
var t0 = new Date();
param.success = function (x) {
if (window.token === localToken) {
Expand All @@ -375,15 +376,15 @@ jQuery(function ($) {

param.fail = function (xhr, textStatus, errorThrown) {
alert(xhr.responseText);
$('.main-content-row').html('<div class="alert alert-danger" role="alert">' + Drupal.t("Error! Search API has the following error: " + error) + '</div>');
$('.main-content-row').html('<div class="alert alert-danger" role="alert">' + Drupal.t("Error! Search API has the following error: 44" + error) + '</div>');
};

param.error = function (xhr, status, error) {
if (error === 'timeout') {
$('.main-content-row').html('<div class="alert alert-danger" role="alert">' + Drupal.t("Timeout error, please refine your Query!") + '</div>');
$(".discover-left input, .discover-left textarea, .discover-left select, .discover-left button").prop("disabled", false);
} else {
$('.main-content-row').html('<div class="alert alert-danger" role="alert">' + Drupal.t("Error! Search API has the following error: " + xhr.responseText) + '</div>');
$('.main-content-row').html('<div class="alert alert-danger" role="alert">' + Drupal.t("Error! Search API has the following error:55 " + xhr.responseText) + '</div>');
$(".discover-left input, .discover-left textarea, .discover-left select, .discover-left button").prop("disabled", false);
}
};
Expand Down

0 comments on commit 381573c

Please sign in to comment.