Commit ca127401 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

call a function from generalFunction.js

parent 1c93eed7
...@@ -72,6 +72,8 @@ html(lang="de") ...@@ -72,6 +72,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") script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// Header // Header
script(src="/js/headfoot.js") script(src="/js/headfoot.js")
// General functions
script(src="/js/generalFunction.js")
script. script.
function searchFunction() { function searchFunction() {
var input = document.getElementById("searchInput") var input = document.getElementById("searchInput")
...@@ -105,15 +107,6 @@ html(lang="de") ...@@ -105,15 +107,6 @@ html(lang="de")
$("#sortingSelect").change(function() { $("#sortingSelect").change(function() {
window.location.replace('/projektinformationen?sort='+$("#sortingSelect").val()) 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() { function setSortSelect() {
let sortKeyword = getQueryStringParams('sort', window.location.href) let sortKeyword = getQueryStringParams('sort', window.location.href)
if (sortKeyword == "created_at") { if (sortKeyword == "created_at") {
......
...@@ -72,6 +72,8 @@ html(lang="de") ...@@ -72,6 +72,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") script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
// Header // Header
script(src="/js/headfoot.js") script(src="/js/headfoot.js")
// General functions
script(src="/js/generalFunction.js")
script. script.
function searchFunction() { function searchFunction() {
var input = document.getElementById("searchInput") var input = document.getElementById("searchInput")
...@@ -105,15 +107,6 @@ html(lang="de") ...@@ -105,15 +107,6 @@ html(lang="de")
$("#sortingSelect").change(function() { $("#sortingSelect").change(function() {
window.location.replace('/projektdaten?sort='+$("#sortingSelect").val()) 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() { function setSortSelect() {
let sortKeyword = getQueryStringParams('sort', window.location.href) let sortKeyword = getQueryStringParams('sort', window.location.href)
if (sortKeyword == "created_at") { if (sortKeyword == "created_at") {
......
Supports Markdown
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