Skip to content

Commit

Permalink
Adding optional virtual keyboard to searchbox (#2952)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThoWagen committed Nov 10, 2023
1 parent 4438319 commit 07eb39f
Show file tree
Hide file tree
Showing 25 changed files with 703 additions and 55 deletions.
4 changes: 4 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@
<exclude name="themes/default-dark/" />
</fileset>
</copy>
<!-- simple-keyboard -->
<copy file="${srcdir}/node_modules/simple-keyboard/build/index.js" todir="${srcdir}/themes/bootstrap3/js/vendor/simple-keyboard" overwrite="true" />
<copy file="${srcdir}/node_modules/simple-keyboard/build/css/index.css" todir="${srcdir}/themes/bootstrap3/css/vendor/simple-keyboard" overwrite="true" />
<copy file="${srcdir}/node_modules/simple-keyboard-layouts/build/index.js" todir="${srcdir}/themes/bootstrap3/js/vendor/simple-keyboard-layouts" overwrite="true" />
<!-- vanilla-cookieconsent -->
<copy file="${srcdir}/node_modules/vanilla-cookieconsent/dist/cookieconsent.umd.js" todir="${srcdir}/themes/bootstrap3/js/vendor" overwrite="true" />
</target>
Expand Down
47 changes: 47 additions & 0 deletions config/vufind/searchbox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,50 @@ type[] = External
target[] = "http://www.google.com/search?q="
label[] = Google
group[] = "Other Sites"

; Uncomment one or more of the lines below to enable virtual on-screen keyboard support
; using the specified layout(s).
[VirtualKeyboard]
;layouts[] = "arabic"
;layouts[] = "assamese"
;layouts[] = "balochi"
;layouts[] = "belarusian"
;layouts[] = "bengali"
;layouts[] = "brazilian"
;layouts[] = "burmese"
;layouts[] = "chinese"
;layouts[] = "czech"
;layouts[] = "english"
;layouts[] = "farsi"
;layouts[] = "french"
;layouts[] = "georgian"
;layouts[] = "german"
;layouts[] = "gilaki"
;layouts[] = "greek"
;layouts[] = "hebrew"
;layouts[] = "hindi"
;layouts[] = "hungarian"
;layouts[] = "italian"
;layouts[] = "japanese"
;layouts[] = "kannada"
;layouts[] = "korean"
;layouts[] = "kurdish"
;layouts[] = "malayalm"
;layouts[] = "nigerian"
;layouts[] = "nko"
;layouts[] = "norwegian"
;layouts[] = "odia"
;layouts[] = "polish"
;layouts[] = "punjabi"
;layouts[] = "russian"
;layouts[] = "russianOld"
;layouts[] = "sindhi"
;layouts[] = "spanish"
;layouts[] = "swedish"
;layouts[] = "telugu"
;layouts[] = "thai"
;layouts[] = "turkish"
;layouts[] = "ukrainian"
;layouts[] = "urdu"
;layouts[] = "urduStandard"
;layouts[] = "uyghur"
10 changes: 10 additions & 0 deletions module/VuFind/src/VuFind/View/Helper/Root/SearchBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,16 @@ public function getPlaceholderText($activeSearchClass)
return null;
}

/**
* Get an array of the configured virtual keyboard layouts
*
* @return array
*/
public function getKeyboardLayouts()
{
return $this->config['VirtualKeyboard']['layouts'] ?? [];
}

/**
* Get an array of information on search handlers for use in generating a
* drop-down or hidden field. Returns an array of arrays with 'value', 'label',
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
"grunt-contrib-watch": "^1.1.0",
"jshint": "^2.13.4",
"jstree": "3.3.15",
"simple-keyboard": "^3.6.0",
"simple-keyboard-layouts": "^3.0.0",
"vanilla-cookieconsent": "3.0.0-rc.16"
}
}
2 changes: 1 addition & 1 deletion themes/bootprint3/css/compiled.css

Large diffs are not rendered by default.

43 changes: 42 additions & 1 deletion themes/bootprint3/less/search.less
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
.btn-primary[multiple],
.form-control[multiple] { height: auto; }
@media (min-width: 768px) {
.search-query { width: 400px; }
.input-group {
width: 400px;
}
.form-control.search-query { width: 400px; }
}
.nav-tabs {
border-bottom: 0;
Expand All @@ -65,6 +68,44 @@
text-decoration: none;
z-index: 5;
}

.keyboard-selection {
button.dropdown-toggle {
color: @input-color;
background-color: white;

&:hover, &:focus {
color: white;
background-color: @brand-primary;
}
}

&:not(.open) {
.activated:not(:hover){
background: lighten(@brand-primary, 35%);
}
}

.btn-primary {
height: 20px;
}
}
}

.keyboard-box {
width: 85%;

@media (min-width: 768px) {
width: 635px;
}

@media (min-width: 992px) {
width: 832px;
}

@media (min-width: 1200px) {
width: 832px;
}
}

.top-facets .facet a { vertical-align: middle; }
Expand Down
43 changes: 42 additions & 1 deletion themes/bootprint3/scss/search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
.btn-primary[multiple],
.form-control[multiple] { height: auto; }
@media (min-width: 768px) {
.search-query { width: 400px; }
.input-group {
width: 400px;
}
.form-control.search-query { width: 400px; }
}
.nav-tabs {
border-bottom: 0;
Expand All @@ -65,6 +68,44 @@
text-decoration: none;
z-index: 5;
}

.keyboard-selection {
button.dropdown-toggle {
color: $input-color;
background-color: white;

&:hover, &:focus {
color: white;
background-color: $brand-primary;
}
}

&:not(.open) {
.activated:not(:hover){
background: lighten($brand-primary, 35%);
}
}

.btn-primary {
height: 20px;
}
}
}

.keyboard-box {
width: 85%;

@media (min-width: 768px) {
width: 635px;
}

@media (min-width: 992px) {
width: 832px;
}

@media (min-width: 1200px) {
width: 832px;
}
}

.top-facets .facet a { vertical-align: middle; }
Expand Down
2 changes: 1 addition & 1 deletion themes/bootstrap3/css/compiled.css

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions themes/bootstrap3/css/vendor/simple-keyboard/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 07eb39f

Please sign in to comment.