123 lines
2.9 KiB
JavaScript
123 lines
2.9 KiB
JavaScript
function getUrlVars() {
|
|
let vars = [], hash;
|
|
let href = window.location.href;
|
|
let start = href.indexOf('?');
|
|
let end = href.indexOf('#');
|
|
if(end < 0) {
|
|
end = href.length;
|
|
}
|
|
console.log(end);
|
|
var hashes = href.slice(start + 1, end).split('&');
|
|
for(let i = 0; i < hashes.length; i++) {
|
|
hash = hashes[i].split('=');
|
|
vars.push(hash[0]);
|
|
vars[hash[0]] = hash[1];
|
|
}
|
|
return vars;
|
|
}
|
|
|
|
let query_string = getUrlVars();
|
|
let hash_string = window.location.hash;
|
|
|
|
console.log(query_string);
|
|
console.log(hash_string);
|
|
|
|
let search = "";
|
|
|
|
if(query_string["contact"] != "" && query_string["contact"] != undefined) {
|
|
search = query_string["contact"];
|
|
}
|
|
|
|
if("contact" in query_string) {
|
|
document.getElementById('contact').scrollIntoView(true);
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
$('#contact-table').DataTable( {
|
|
"order": [[0, "asc"]],
|
|
"paging": false,
|
|
"ordering": false,
|
|
"info": false,
|
|
"search": {
|
|
"search": search
|
|
},
|
|
"language": {
|
|
"decimal": "",
|
|
"emptyTable": "Gibt nix zu zeigen",
|
|
"info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",
|
|
"infoEmpty": "Zeige 0 bis 0 von 0 Einträgen",
|
|
"infoFiltered": "(aus _MAX_ Einträgen)",
|
|
"infoPostFix": "",
|
|
"thousands": ",",
|
|
"lengthMenu": "Zeige _MENU_ Einträge",
|
|
"loadingRecords": "<i class=\"fas fa-spinner fa-pulse\"></i>",
|
|
"processing": "<i class=\"fas fa-spinner fa-pulse\"></i>",
|
|
"search": "Durchsuchen:",
|
|
"zeroRecords": "Nix gefunden",
|
|
"paginate": {
|
|
"first": "<i class=\"fas fa-angle-double-left\"></i>",
|
|
"last": "<i class=\"fas fa-angle-double-right\"></i>",
|
|
"next": "<i class=\"fas fa-angle-right\"></i>",
|
|
"previous": "<i class=\"fas fa-angle-left\"></i>"
|
|
},
|
|
"aria": {
|
|
"sortAscending": ": activate to sort column ascending",
|
|
"sortDescending": ": activate to sort column descending"
|
|
}
|
|
}
|
|
} );
|
|
} );
|
|
|
|
|
|
/*
|
|
ghost.init({
|
|
clientId: "ghost-frontend",
|
|
clientSecret: "4e0fe17f9abc"
|
|
});
|
|
|
|
function printPosts(data) {
|
|
let $result = $('#posts');
|
|
$.each(data.posts, function (i, post) {
|
|
$result.append(
|
|
'<h3>' + post.title + '</h3>'
|
|
);
|
|
});
|
|
}
|
|
|
|
$()
|
|
.ready(() => {
|
|
$.get(
|
|
ghost.url.api('posts', {limit: 3})
|
|
).done(printPosts);
|
|
});
|
|
*/
|
|
/*
|
|
$()
|
|
.ready(() => {
|
|
$( "#intro-moin" )
|
|
.show()
|
|
.velocity("fadeIn", {
|
|
duration: 1500
|
|
})
|
|
.velocity("fadeOut", {
|
|
delay: 500,
|
|
duration: 1500
|
|
})
|
|
.then(() => {
|
|
$( "#intro-ich-heisse" )
|
|
.show()
|
|
.velocity("fadeIn", {
|
|
duration: 1500
|
|
})
|
|
.velocity("fadeOut", { delay: 500, duration: 1500 })
|
|
.then(() => {
|
|
$( "#intro-clemens-riese" )
|
|
.show()
|
|
.velocity("fadeIn", {
|
|
duration: 1500
|
|
});
|
|
});
|
|
});
|
|
});
|
|
*/
|