Skip to content

Commit

Permalink
Release new update mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
snaildos committed Mar 29, 2021
1 parent 1c5314a commit ffdd3db
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 2 deletions.
14 changes: 14 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,21 @@
// Needs window render
require('./renderer.js')
</script>
<script>
// update check
(function($){
$(document).ready(function() {

var version = localStorage.getItem('version');

if(version != '1.0.7'){
console.log('Latest update is not ready.')
window.location.href = "update.html";
}

});
})(jQuery);
</script>
<script>
// oobe
(function($){
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SnailFM",
"version": "1.0.6",
"version": "1.0.7",
"description": "SnailFM-Application is a application too view SnailFM.",
"main": "main.js",
"repository": {
Expand Down
71 changes: 71 additions & 0 deletions update.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<html>
<head>
<script>
window.jQuery = window.$ = require('jquery');
</script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<title>Resetting SnailFM... </title>
<style type="text/css">
.bs-example{
margin: 20px;
}
</style>
<style>
body {
background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
background-size: 400% 400%;
animation: gradient 15s ease infinite;
}

@keyframes gradient {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
</style>
</head>
<body>
<script>
console.log("Let's clear localstorage first...")
localStorage.removeItem('cookie-consent', 'true');
console.log("Just wait a bit...")
console.log("Update true. Setting now.")
localStorage.setItem('version', '1.0.7');
// import rest of stuff here
</script>
<div class="bs-example">
<h2>Updating SnailFM libs...</h2>
<div class="progress">
<div class="progress-bar" id="bar">
<span class="sr-only">src</span>
</div>
</div>
<script type="text/javascript">
var i = 0;
var progressBar = $("#bar");
function countNumbers(){
if(i < 100){
i = i + 10;
progressBar.css("width", i + "%");
}
if(i > 90){
window.location.href = "index.html";
}
// Wait for sometime before running this script again
setTimeout("countNumbers()", 1000);
}
countNumbers();
</script>
</div>
</body>
</html>

0 comments on commit ffdd3db

Please sign in to comment.