2019-01-13 14:10:54 +00:00
|
|
|
app = new Vue({
|
|
|
|
el: '#app',
|
2019-03-09 11:56:11 +00:00
|
|
|
data: { showsearchbox: false, error: "", resultPage: "", resultPageHeight: 1, entries: -1 }
|
2019-01-13 14:10:54 +00:00
|
|
|
})
|
|
|
|
window.addEventListener("message", receiveMessage, false);
|
|
|
|
|
2019-03-09 11:56:11 +00:00
|
|
|
function receiveMessage(event) {
|
2019-01-13 14:10:54 +00:00
|
|
|
app.resultPageHeight = event.data
|
2019-01-13 18:59:46 +00:00
|
|
|
}
|
2021-02-28 07:32:38 +00:00
|
|
|
|
|
|
|
const searchbox = document.getElementById('searchbox')
|
2019-03-09 11:56:11 +00:00
|
|
|
if (searchbox != null) {
|
|
|
|
searchbox.onkeydown = function (event) {
|
|
|
|
if (event.keyCode == 13) {
|
|
|
|
searchTriggered()
|
|
|
|
}
|
2019-01-13 18:59:46 +00:00
|
|
|
}
|
2021-02-28 07:32:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const urlParams = new URLSearchParams(window.location.search);
|
|
|
|
const query = urlParams.get('q');
|
|
|
|
if (query != null) {
|
|
|
|
searchbox.value = query
|
|
|
|
searchTriggered()
|
|
|
|
}
|