diff --git a/Resources/Public/JavaScript/PageView/ImageManipulationControl.js b/Resources/Public/JavaScript/PageView/ImageManipulationControl.js index 3f5fe0f09..d5265cc66 100644 --- a/Resources/Public/JavaScript/PageView/ImageManipulationControl.js +++ b/Resources/Public/JavaScript/PageView/ImageManipulationControl.js @@ -45,7 +45,7 @@ dlfViewerImageManipulationControl = function(options) { * @type {Element} * @private */ - this.toolContainerEl_ = dlfUtils.exists(options.toolContainer) ? options.toolContainer : $(this.dic['parentContainer'])[0]; + this.toolContainerEl_ = dlfUtils.exists(options.toolContainer) ? options.toolContainer : $.find(this.dic['parentContainer'])[0]; // // Append open/close behavior to toolbox diff --git a/Resources/Public/JavaScript/PageView/PageView.js b/Resources/Public/JavaScript/PageView/PageView.js index 40c94cb93..bf5b39186 100644 --- a/Resources/Public/JavaScript/PageView/PageView.js +++ b/Resources/Public/JavaScript/PageView/PageView.js @@ -447,8 +447,7 @@ dlfViewer.prototype.displayHighlightWord = function(highlightWords = null) { // exctract highlighWords from URL if (this.highlightWords === null) { - var urlParams = dlfUtils.getUrlParams(); - this.highlightWords = urlParams['tx_dlf[highlight_word]']; + this.highlightWords = dlfUtils.getUrlParam('tx_dlf[highlight_word]'); } if (!dlfUtils.exists(this.highlightLayer)) { diff --git a/Resources/Public/JavaScript/PageView/SearchInDocument.js b/Resources/Public/JavaScript/PageView/SearchInDocument.js index b4df74d4d..6890ca3b8 100644 --- a/Resources/Public/JavaScript/PageView/SearchInDocument.js +++ b/Resources/Public/JavaScript/PageView/SearchInDocument.js @@ -133,12 +133,12 @@ function getCurrentQueryParams(baseUrl) { function getNavigationButtons(start, numFound) { var buttons = ""; - if (start > 0) { - buttons += ''; + if(start > 0) { + buttons += ''; } - if (numFound > (start + 20)) { - buttons += ''; + if(numFound > (start + 20)) { + buttons += ''; } return buttons; } @@ -265,11 +265,14 @@ $(document).ready(function() { addImageHighlight(data); } else { - resultList += '
  • ' + $('#tx-dlf-search-in-document-label-noresult').text() + '
  • '; + resultList += '
  • '; } resultList += ''; resultList += getNavigationButtons(start, data['numFound']); $('#tx-dlf-search-in-document-results').html(resultList); + $('.noresult').text($('#tx-dlf-search-in-document-label-noresult').text()); + $('.button-previous').attr('value', $('#tx-dlf-search-in-document-label-previous').text()); + $('.button-next').attr('value', $('#tx-dlf-search-in-document-label-next').text()); }, "json" ) diff --git a/Resources/Public/JavaScript/PageView/Utility.js b/Resources/Public/JavaScript/PageView/Utility.js index 7354f8279..82ea85c3f 100644 --- a/Resources/Public/JavaScript/PageView/Utility.js +++ b/Resources/Public/JavaScript/PageView/Utility.js @@ -507,21 +507,14 @@ dlfUtils.getCookie = function (name) { /** * Returns url parameters - * @returns {Object|undefined} + * @returns {string|null} */ -dlfUtils.getUrlParams = function () { +dlfUtils.getUrlParam = function (param) { if (Object.prototype.hasOwnProperty.call(location, 'search')) { - var search = decodeURIComponent(location.search).slice(1).split('&'), - params = {}; - - search.forEach(function (item) { - var s = item.split('='); - params[s[0]] = s[1]; - }); - - return params; + const urlParams = new URLSearchParams(location.search); + return urlParams.get(param); } - return undefined; + return null; }; /**