Commit 3a95aff8 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

Merge branch 'MLAB-576' into 'testing'

call a function from generalFunction.js

See merge request !72
parents 48a9606f ca127401
Pipeline #5058 passed with stage
in 27 seconds
......@@ -73,6 +73,8 @@ html(lang="de")
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// Header
script(src="/js/headfoot.js")
// General functions
script(src="/js/generalFunction.js")
script.
function searchFunction() {
var input = document.getElementById("searchInput")
......@@ -106,15 +108,6 @@ html(lang="de")
$("#sortingSelect").change(function() {
window.location.replace('/projektinformationen?sort='+$("#sortingSelect").val())
});
function getQueryStringParams(params, url) {
// first decode URL to get readable data
var href = decodeURIComponent(url || window.location.href);
// regular expression to get value
var regEx = new RegExp('[?&]' + params + '=([^&#]*)', 'i');
var value = regEx.exec(href);
// return the value if exist
return value ? value[1] : null;
}
function setSortSelect() {
let sortKeyword = getQueryStringParams('sort', window.location.href)
if (sortKeyword == "created_at") {
......
......@@ -73,6 +73,8 @@ html(lang="de")
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// Header
script(src="/js/headfoot.js")
// General functions
script(src="/js/generalFunction.js")
script.
function searchFunction() {
var input = document.getElementById("searchInput")
......@@ -106,15 +108,6 @@ html(lang="de")
$("#sortingSelect").change(function() {
window.location.replace('/projektdaten?sort='+$("#sortingSelect").val())
});
function getQueryStringParams(params, url) {
// first decode URL to get readable data
var href = decodeURIComponent(url || window.location.href);
// regular expression to get value
var regEx = new RegExp('[?&]' + params + '=([^&#]*)', 'i');
var value = regEx.exec(href);
// return the value if exist
return value ? value[1] : null;
}
function setSortSelect() {
let sortKeyword = getQueryStringParams('sort', window.location.href)
if (sortKeyword == "created_at") {
......
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