Skip to content

Commit

Permalink
use remote Manifests.json instead of local file
Browse files Browse the repository at this point in the history
  • Loading branch information
couleurm committed Mar 29, 2024
1 parent 82c65e5 commit caa802f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 109 deletions.
29 changes: 23 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@
<!--
notable global variables:
- tlui holds the template to build container
- conf holds the user defined parameters, synced with localStorage
conf holds the user defined parameters, loaded from localStorage at page load
writeParameter and getParameter always update conf and localStorage in tandem
-->
<script src="init.js"></script>
<script src="storageManager.js"></script>
<script src="main.js"></script>
</head>
<body>
<div class="nav">
Expand Down Expand Up @@ -84,9 +83,27 @@ <h2>Parameters</h2>
>reset conf
</button>
</span>
<script src="main.js"></script>
<script>
loadList(tlui)
</script>
let tlui = {};

const fetch_error = "Failed fetching the latest version of the TweakList manifest\n\nPlease open the console report this:\n\nhttps://github.com/couleur-tweak-tips/TweakList"

fetch('https://raw.githubusercontent.com/couleur-tweak-tips/TweakList/master/Manifests.json')
.catch(error => {
alert(fetch_error)
console.log(fetch_error)
})
.then(response => {
if (!response.ok) {
throw new Error(fetch_error);
}
return response.json();
})
.then(data => {
tlui = data
loadList(tlui);
})
</script>
</body>
</html>
103 changes: 0 additions & 103 deletions init.js

This file was deleted.

0 comments on commit caa802f

Please sign in to comment.