Sha256: e6e675246c70ae5ba108d0daa193c6af8c9e22a3180a51d4e32094c1a8e69db7
Contents?: true
Size: 1.53 KB
Versions: 5
Compression:
Stored size: 1.53 KB
Contents
/* various utilities for ocr search results display in Bootstrap modal and WDL-Viewer contexts */ /* pagination links should preserve the modal rather than reloading the page */ var top_pagination_selector = '#ocr_search_details .page_links a'; var bottom_pagination_selector = '#ocr_pagination #pagination_links a'; var relevancy_link_selector = '#sort-dropdown a'; $(top_pagination_selector + ", " + bottom_pagination_selector + ", " + relevancy_link_selector).on("click", Blacklight.ajaxModal.modalAjaxLinkClick); /* if the window is displayed in the WDL-Viewer context, page links should trigger page changes via JS */ if ($("body.wdl-viewer").length) { $(".book_page_link").on("click", function () { $('#ajax-modal').modal('hide'); $viewer.trigger("goto-page-search", [1, this.href.match(/\d+$/), this.href.match(/ocr_q=[\S]+\#/)[0].replace('ocr_q=','').slice(0, -1)]); return false; }); } /* so search queries entered by user don't accidentally trigger WDL-Viewer keyboard-based controls */ $('#ocr_q').on('keydown', function (e) { // Avoid keys bubbling up to our top-level input handler: e.stopPropagation(); }); /* toggle the ocr snippets collapse link text */ $('.ocr_snippets_expand').on('click', function() { if ($(this).text() === '<%= I18n.t('blacklight.ocr.search.results.snippets.more') %>') { $(this).text('<%= I18n.t('blacklight.ocr.search.results.snippets.less') %>'); } else { $(this).text('<%= I18n.t('blacklight.ocr.search.results.snippets.more') %>'); } });
Version data entries
5 entries across 5 versions & 1 rubygems