Commit aced3ddb authored by matthias.lang's avatar matthias.lang
Browse files

web: read url parameters as default values

parent c10c801e
......@@ -156,7 +156,7 @@
</div>
<div class="row" style="margin-top: 4em">
<em>{{ filteredData.length }} Treffer</em>
<em>Zeige {{ filteredData.length }} von {{ resultData.length }} Treffern</em>
</div>
<table class="u-full-width" v-if="filteredData.length">
......@@ -373,6 +373,14 @@
// TODO: error handling
},
// provisorium. TODO: replace with URLSearchParams polyfill or VueRouter
getUrlParameter: function(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
},
/*
getShibSessionData: function() {
url = location.protocol + '//' + location.host + '/dumpreq';
......@@ -423,6 +431,20 @@
this.sortOrders = sortOrders;
//this.getShibSessionData();
if (this.getUrlParameter('filter') == 'none') {
// disable all filters
for (var filterCategory in this.filterShow) {
for (var elem in this.filterShow[filterCategory].filters) {
this.filterShow[filterCategory].filters[elem].buttonState = true
}
}
}
this.query = this.getUrlParameter('q')
if (this.query) {
this.search()
}
}
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment