Removed jQuery Dependency

This commit is contained in:
Tionis Nagir 2020-05-13 16:24:14 +02:00
parent 08facbc15f
commit 3c63e2d00e
2 changed files with 24 additions and 19 deletions

View file

@ -1,35 +1,41 @@
var data_links = "links.json";
$(document).ready(function(){
$.getJSON(data_links,
document.addEventListener("DOMContentLoaded", function () {
fetch(data_links)
.then( response => response.json())
.then(
function (data) {
var mysource = $('#links-template').html();
var mysource = document.getElementById("links-template").innerHTML;
var mytemplate = Handlebars.compile(mysource);
var myresult = mytemplate(data)
$('#links').html(myresult);
});
document.getElementById("links").innerHTML = myresult;
});
});
var data_apps = "apps.json";
$(document).ready(function(){
$.getJSON(data_apps,
document.addEventListener("DOMContentLoaded", function () {
fetch(data_apps)
.then( response => response.json())
.then(
function (data) {
var mysource = $('#apps-template').html();
var mysource = document.getElementById("apps-template").innerHTML;
var mytemplate = Handlebars.compile(mysource);
var myresult = mytemplate(data)
$('#apps').html(myresult);
});
document.getElementById("apps").innerHTML = myresult;
});
});
var data_providers = "providers.json";
$(document).ready(function(){
$.getJSON(data_providers,
document.addEventListener("DOMContentLoaded", function () {
fetch(data_providers)
.then( response => response.json())
.then(
function (data) {
var mysource = $('#providers-template').html();
var mysource = document.getElementById("providers-template").innerHTML;
var mytemplate = Handlebars.compile(mysource);
var myresult = mytemplate(data)
$('#providers').html(myresult);
});
document.getElementById("providers").innerHTML = myresult;
});
});

View file

@ -7,7 +7,6 @@
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
<link type="text/css" rel="stylesheet" href="/assets/css/styles.css" media="screen,projection"/>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700,900" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.1.1/handlebars.min.js"></script>
<script src="https://code.iconify.design/1/1.0.0-rc7/iconify.min.js"></script>
</head>