Skip to content

Commit

Permalink
Merge branch 'dev' into combined-no-results-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Dec 12, 2023
2 parents 870f921 + 275a68e commit 3b7cf5e
Show file tree
Hide file tree
Showing 14 changed files with 149 additions and 45 deletions.
Binary file modified import/browse-indexing.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions index-alphabetic-browse.bat
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ mkdir "%index_dir%"

rem These parameters should match the ones in solr/vufind/biblio/conf/solrconfig.xml - BrowseRequestHandler
call %VUFIND_HOME%\index-alphabetic-browse.bat build_browse hierarchy hierarchy_browse
call %VUFIND_HOME%\index-alphabetic-browse.bat build_browse title title_fullStr 1 "-Dbibleech=StoredFieldLeech -Dsortfield=title_sort -Dvaluefield=title_fullStr -Dbrowse.normalizer=org.vufind.util.TitleNormalizer"
call %VUFIND_HOME%\index-alphabetic-browse.bat build_browse title title_fullStr 1 "-Dbib_field_iterator=org.vufind.solr.indexing.StoredFieldIterator -Dsortfield=title_sort -Dvaluefield=title_fullStr -Dbrowse.normalizer=org.vufind.util.TitleNormalizer"
call %VUFIND_HOME%\index-alphabetic-browse.bat build_browse topic topic_browse
call %VUFIND_HOME%\index-alphabetic-browse.bat build_browse author author_browse
call %VUFIND_HOME%\index-alphabetic-browse.bat build_browse lcc callnumber-raw 1 "-Dbrowse.normalizer=org.vufind.util.LCCallNormalizer"
Expand Down Expand Up @@ -113,7 +113,7 @@ set args="%bib_index%" "%field%" "%auth_index%" "%browse%.tmp"
:skipauth

rem Get the browse headings from Solr
%JAVA% %jvmopts% -Dfile.encoding="UTF-8" -Dfield.preferred=heading -Dfield.insteadof=use_for -cp %CLASSPATH% PrintBrowseHeadings %args%
%JAVA% %jvmopts% -Dfile.encoding="UTF-8" -Dfield.preferred=heading -Dfield.insteadof=use_for -cp %CLASSPATH% org.vufind.solr.indexing.PrintBrowseHeadings %args%

rem Sort the browse headings
sort %browse%.tmp /o sorted-%browse%.tmp /rec 65535
Expand All @@ -122,7 +122,7 @@ rem Remove duplicate lines
php %VUFIND_HOME%\util\dedupe.php "sorted-%browse%.tmp" "unique-%browse%.tmp"

rem Build the SQLite database
%JAVA% -Dfile.encoding="UTF-8" -cp %CLASSPATH% CreateBrowseSQLite "unique-%browse%.tmp" "%browse%_browse.db"
%JAVA% -Dfile.encoding="UTF-8" -cp %CLASSPATH% org.vufind.solr.indexing.CreateBrowseSQLite "unique-%browse%.tmp" "%browse%_browse.db"

rem Clear up temp files
del /q *.tmp > nul
Expand Down
8 changes: 4 additions & 4 deletions index-alphabetic-browse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ function build_browse

# Get the browse headings from Solr
if [ "$skip_authority" = "1" ]; then
if ! output=$($JAVA ${extra_jvm_opts} -Dfile.encoding="UTF-8" -Dfield.preferred=heading -Dfield.insteadof=use_for -cp $CLASSPATH PrintBrowseHeadings "$bib_index" "$field" "${browse}.tmp" 2>&1); then
if ! output=$($JAVA ${extra_jvm_opts} -Dfile.encoding="UTF-8" -Dfield.preferred=heading -Dfield.insteadof=use_for -cp $CLASSPATH org.vufind.solr.indexing.PrintBrowseHeadings "$bib_index" "$field" "${browse}.tmp" 2>&1); then
echo "ERROR: Failed to create browse headings for ${browse}. ${output}."
exit 1
fi
else
if ! output=$($JAVA ${extra_jvm_opts} -Dfile.encoding="UTF-8" -Dfield.preferred=heading -Dfield.insteadof=use_for -cp $CLASSPATH PrintBrowseHeadings "$bib_index" "$field" "$auth_index" "${browse}.tmp" 2>&1); then
if ! output=$($JAVA ${extra_jvm_opts} -Dfile.encoding="UTF-8" -Dfield.preferred=heading -Dfield.insteadof=use_for -cp $CLASSPATH org.vufind.solr.indexing.PrintBrowseHeadings "$bib_index" "$field" "$auth_index" "${browse}.tmp" 2>&1); then
echo "ERROR: Failed to create browse headings for ${browse}. ${output}."
exit 1
fi
Expand All @@ -105,7 +105,7 @@ function build_browse
fi

# Build the SQLite database
if ! output=$($JAVA -Dfile.encoding="UTF-8" -cp $CLASSPATH CreateBrowseSQLite "sorted-${browse}.tmp" "${browse}_browse.db" 2>&1); then
if ! output=$($JAVA -Dfile.encoding="UTF-8" -cp $CLASSPATH org.vufind.solr.indexing.CreateBrowseSQLite "sorted-${browse}.tmp" "${browse}_browse.db" 2>&1); then
echo "ERROR: Failed to build the SQLite database for ${browse}. ${output}."
exit 1
fi
Expand All @@ -130,7 +130,7 @@ function build_browse
}
# These parameters should match the ones in solr/vufind/biblio/conf/solrconfig.xml - BrowseRequestHandler
build_browse "hierarchy" "hierarchy_browse"
build_browse "title" "title_fullStr" 1 "-Dbibleech=StoredFieldLeech -Dsortfield=title_sort -Dvaluefield=title_fullStr -Dbrowse.normalizer=org.vufind.util.TitleNormalizer"
build_browse "title" "title_fullStr" 1 "-Dbib_field_iterator=org.vufind.solr.indexing.StoredFieldIterator -Dsortfield=title_sort -Dvaluefield=title_fullStr -Dbrowse.normalizer=org.vufind.util.TitleNormalizer"
build_browse "topic" "topic_browse"
build_browse "author" "author_browse"
build_browse "lcc" "callnumber-raw" 1 "-Dbrowse.normalizer=org.vufind.util.LCCallNormalizer"
Expand Down
Binary file modified solr/vufind/jars/browse-handler.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions themes/bootprint3/css/compiled.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions themes/bootstrap3/css/compiled.css

Large diffs are not rendered by default.

24 changes: 21 additions & 3 deletions themes/bootstrap3/js/searchbox_controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ VuFind.register('searchbox_controls', function SearchboxControls() {
if (triggerInputEvent) {
_textInput.dispatchEvent(new Event('input'));
}
if ( typeof _keyboard !== 'undefined' && triggerInputEvent) {
let caretPos = _keyboard.getCaretPosition();
if (caretPos) {
_textInput.setSelectionRange(caretPos, caretPos);
}
}
}

function _showKeyboard() {
Expand Down Expand Up @@ -97,14 +103,19 @@ VuFind.register('searchbox_controls', function SearchboxControls() {
_showKeyboard();
});
document.addEventListener("click", (event) => {
if (!_keyboard.options.theme.includes('show-keyboard')) {
return;
}
function hasClass(el, className) {
return el.className !== undefined && el.className.includes(className);
}
function hasId(el, id) {
return el.id === id;
}
if (
event.target.parentNode == null ||
event.target.parentNode.parentNode == null || (
_keyboard.options.theme.includes('show-keyboard')
&& !hasClass(event.target, 'searchForm_lookfor')
!hasClass(event.target, 'searchForm_lookfor')
&& !hasClass(event.target, 'keyboard-selection')
&& !hasClass(event.target, 'hg-button')
&& !hasClass(event.target, 'hg-row')
Expand All @@ -116,6 +127,12 @@ VuFind.register('searchbox_controls', function SearchboxControls() {
)
) {
_hideKeyboard();
} else if (event.target.parentNode == null || (
!hasId(event.target, 'keyboard-selection-button')
&& !hasId(event.target.parentNode, 'keyboard-selection-button')
)
) {
_textInput.focus();
}
});

Expand All @@ -126,7 +143,8 @@ VuFind.register('searchbox_controls', function SearchboxControls() {
display: _display,
syncInstanceInputs: true,
mergeDisplay: true,
physicalKeyboardHighlight: true
physicalKeyboardHighlight: true,
preventMouseDownDefault: true
});

let layout = window.Cookies.get("keyboard");
Expand Down
39 changes: 39 additions & 0 deletions themes/bootstrap3/less/bootstrap.less
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,45 @@ ul.list-group {
}
}

/* ------ Responsive table for small screen size ------ */
@media screen and (max-width: 768px) {
.table-responsive {
border: none;
thead {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
tr {
display: block;
margin-bottom: @line-height-computed;
border-left: 1px solid @table-border-color;
border-right: 1px solid @table-border-color;
border-bottom: 4px solid @table-border-color;
}
td {
display: flex;
align-items: first baseline;
background: #fff;
&:before {
display: flex;
flex-basis: 40%;
flex-shrink: 0;
font-weight: bold;
content: attr(data-label);
}
}
td:nth-child(even) {
background-color: @table-bg-accent;
}
}
}

/* ------ Visualization View ------ */
.node {
position: absolute;
Expand Down
9 changes: 6 additions & 3 deletions themes/bootstrap3/less/components/search.less
Original file line number Diff line number Diff line change
Expand Up @@ -667,13 +667,16 @@ body.rtl {
.search-history-table {
&:extend(.table all);
&:extend(.table-striped all);
&:extend(.table-responsive all);
}
table.search-history-table {
table-layout: auto;

tbody > tr > td { vertical-align: middle; }
.history_time {
width: 20%;
@media screen and (min-width: 768px) {
tbody > tr > td { vertical-align: middle; }
.history_time {
width: 20%;
}
}
}

Expand Down
39 changes: 39 additions & 0 deletions themes/bootstrap3/scss/bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,45 @@ ul.list-group {
}
}

/* ------ Responsive table for small screen size ------ */
@media screen and (max-width: 768px) {
.table-responsive {
border: none;
thead {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
tr {
display: block;
margin-bottom: $line-height-computed;
border-left: 1px solid $table-border-color;
border-right: 1px solid $table-border-color;
border-bottom: 4px solid $table-border-color;
}
td {
display: flex;
align-items: first baseline;
background: #fff;
&:before {
display: flex;
flex-basis: 40%;
flex-shrink: 0;
font-weight: bold;
content: attr(data-label);
}
}
td:nth-child(even) {
background-color: $table-bg-accent;
}
}
}

/* ------ Visualization View ------ */
.node {
position: absolute;
Expand Down
9 changes: 6 additions & 3 deletions themes/bootstrap3/scss/components/search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -667,13 +667,16 @@ body.rtl {
.search-history-table {
@extend .table;
@extend .table-striped;
@extend .table-responsive;
}
table.search-history-table {
table-layout: auto;

tbody > tr > td { vertical-align: middle; }
.history_time {
width: 20%;
@media screen and (min-width: 768px) {
tbody > tr > td { vertical-align: middle; }
.history_time {
width: 20%;
}
}
}

Expand Down
44 changes: 23 additions & 21 deletions themes/bootstrap3/templates/search/history-table.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,38 @@
<tbody>
<?php foreach (($this->showSaved ? array_reverse($this->saved) : array_reverse($this->unsaved)) as $iteration => $info): ?>
<tr class="<?=$iteration % 2 == 1 ? 'even' : 'odd'?>row">
<td class="history_time"><?=$this->escapeHtml($this->dateTime()->convertToDisplayDateAndTime('U', $info->getStartTime()))?></td>
<td class="history_search">
<td class="history_time" data-label="<?=$this->transEscAttr('history_time')?>"><?=$this->escapeHtml($this->dateTime()->convertToDisplayDateAndTime('U', $info->getStartTime()))?></td>
<td class="history_search" data-label="<?=$this->transEscAttr('history_search')?>">
<?=$this->historylabel($info->getParams()->getSearchClassId())?>
<a href="<?=$this->url($info->getOptions()->getSearchAction()) . $info->getUrlQuery()->getParams()?>"><?php
$desc = $info->getParams()->getDisplayQuery();
echo empty($desc) ? $this->transEsc('history_empty_search') : $this->escapeHtml($desc);
?></a>
</td>
<td class="history_limits">
<?php foreach ($info->getParams()->getFilterList(true) as $field => $filters): ?>
<?php foreach ($filters as $i => $filter): ?>
<?php
if ($filter['operator'] == 'NOT') {
echo $this->transEsc('NOT') . ' ';
} elseif ($filter['operator'] == 'OR' && $i > 0) {
echo $this->transEsc('OR') . ' ';
}
?>
<strong><?=$this->transEsc($field)?></strong>: <?=$this->escapeHtml($filter['displayText'])?><br>
<td class="history_limits" data-label="<?=$this->transEscAttr('history_limits')?>">
<span class="history_limits_field">
<?php foreach ($info->getParams()->getFilterList(true) as $field => $filters): ?>
<?php foreach ($filters as $i => $filter): ?>
<?php
if ($filter['operator'] == 'NOT') {
echo $this->transEsc('NOT') . ' ';
} elseif ($filter['operator'] == 'OR' && $i > 0) {
echo $this->transEsc('OR') . ' ';
}
?>
<strong><?=$this->transEsc($field)?></strong>: <?=$this->escapeHtml($filter['displayText'])?><br>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endforeach; ?>
<?php foreach ($info->getParams()->getCheckboxFacets() as $facet): ?>
<?php if ($facet['selected']): ?>
<strong><?=$this->transEsc($facet['desc'])?></strong><br>
<?php endif; ?>
<?php endforeach; ?>
<?php foreach ($info->getParams()->getCheckboxFacets() as $facet): ?>
<?php if ($facet['selected']): ?>
<strong><?=$this->transEsc($facet['desc'])?></strong><br>
<?php endif; ?>
<?php endforeach; ?>
</span>
</td>
<td class="history_results"><?=$this->escapeHtml($this->localizedNumber($info->getResultTotal()))?></td>
<td class="history_results" data-label="<?=$this->transEscAttr('history_results')?>"><?=$this->escapeHtml($this->localizedNumber($info->getResultTotal()))?></td>
<?php if ($scheduleSupported): ?>
<td class="search-schedule-header">
<td class="search-schedule-header" data-label="<?=$this->transEscAttr('history_schedule')?>">
<?php if (isset($this->schedule[$info->getSearchId()])): ?>
<?php $schedule = $this->schedule[$info->getSearchId()]; ?>
<form class="form-inline jumpMenuForm" action="<?= $this->url('myresearch-savesearch')?>" method="get" name="schedule">
Expand Down
4 changes: 2 additions & 2 deletions themes/local_theme_example/css/compiled.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions themes/sandal/css/compiled.css

Large diffs are not rendered by default.

0 comments on commit 3b7cf5e

Please sign in to comment.