Minor cleanups and comments

parent b9f91b36
Pipeline #30941 passed with stage
in 32 seconds
......@@ -18,6 +18,9 @@
<script>
/*
* status display: how did this file get fetched?
*
* yes, this code has to be directly here,
* since we want to know how *this exact file* got fetched
*/
var ipsgStatus = new Array();
ipsgStatus['service-worker'] = null;
......@@ -44,6 +47,9 @@
<p>Interplanetary Shotgun is a censorship-resistant, browser-based content delivery <a href="https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps">Progressive Web App</a>, using <a href="https://gun.eco/">Gun</a>, and <a href="https://github.com/ipfs/js-ipfs">JS-IPFS</a>.</p>
<p id="commit-info">ServiceWorker: <span id="ipsg-commit-service-worker">NO_INFO</span>&nbsp;::&nbsp;index.html: <span id="ipsg-commit-index-html">COMMIT_UNKNOWN</span></p>
<script>
/*
* handling status displays
*/
if (ipsgStatus['service-worker']) {
var ipsg_sw = document.getElementById("ipsg-status-service-worker");
ipsg_sw.innerHTML = "yes";
......
if (navigator.serviceWorker.controller) {
// Service worker already registered.
console.log('Service Worker already registered.');
console.log("+-- commit : COMMIT_UNKNOWN");
console.log("+-- pipeline : PIPELINE_UNKNOWN");
console.log("+-- job : JOB_UNKNOWN");
console.log('(COMMIT_UNKNOWN) Service Worker already registered.');
} else {
/*
* assumption: service-worker.js is in the same directory as ipsg.js
......@@ -18,10 +15,7 @@ if (navigator.serviceWorker.controller) {
scope: './'
}).then(function(reg) {
// Success.
console.log('Service Worker registered.');
console.log("+-- commit : COMMIT_UNKNOWN");
console.log("+-- pipeline : PIPELINE_UNKNOWN");
console.log("+-- job : JOB_UNKNOWN");
console.log('(COMMIT_UNKNOWN) Service Worker registered.');
}).catch(error => {
console.log("Error: ", error);
});
......
......@@ -22,8 +22,7 @@ console.log('(COMMIT_UNKNOWN) IPSGPlugins.length:', self.IPSGPlugins.length)
self.addEventListener('install', event => {
// TODO: Might we want to have a local cache?
// "(COMMIT|PIPELINE|JOB)_UNKNOWN" will be replaced with
// commit ID, pipeline ID, and job ID in the CI/CD pipeline
// "COMMIT_UNKNOWN" will be replaced with commit ID
console.log("0. Installed Inter-Planetary Shotgun (commit: COMMIT_UNKNOWN).");
// TODO: should we do some plugin initialization here?
});
......
Markdown is supported
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