kopia lustrzana https://gitlab.com/rysiekpl/libresilient
libresilient.js linted (left only no-unused-vars errors)
rodzic
f8aa190558
commit
a41779c89a
|
@ -250,7 +250,7 @@ libresilient.updateFetchedResources = () => {
|
|||
Object.keys(libresilient.info).forEach((url)=>{
|
||||
|
||||
// simplify
|
||||
si = libresilient.info[url]
|
||||
var si = libresilient.info[url]
|
||||
|
||||
// if there are no status display elements for this URL...
|
||||
if (typeof libresilient.resourceDisplays[url] === 'undefined') {
|
||||
|
@ -391,7 +391,7 @@ libresilient.toggleResourceCheckboxes = () => {
|
|||
*/
|
||||
libresilient.stashOrUnstashResources = (stash=true) => {
|
||||
// what are we doing?
|
||||
operation = {
|
||||
var operation = {
|
||||
clientId: libresilient.clientId
|
||||
}
|
||||
// get the resources
|
||||
|
@ -451,15 +451,15 @@ libresilient.displayMessage = (msg) => {
|
|||
messageBox.innerHTML = `<div class="libresilient-message">${msg}</div>`
|
||||
// attach it to all libresilient-message-containers out there
|
||||
for (let smc of document.getElementsByClassName('libresilient-message-container')) {
|
||||
var msg = messageBox.content.firstChild.cloneNode(true)
|
||||
msg.onclick = (e) => {
|
||||
var msg_clone = messageBox.content.firstChild.cloneNode(true)
|
||||
msg_clone.onclick = (e) => {
|
||||
e.target.style.opacity=0
|
||||
setTimeout(()=>{e.target.remove()}, 1000)
|
||||
}
|
||||
smc.insertAdjacentElement('beforeend', msg)
|
||||
smc.insertAdjacentElement('beforeend', msg_clone)
|
||||
setTimeout(()=>{
|
||||
msg.style.opacity=0
|
||||
setTimeout(()=>{msg.remove()}, 1000)
|
||||
msg_clone.style.opacity=0
|
||||
setTimeout(()=>{msg_clone.remove()}, 1000)
|
||||
}, 5000)
|
||||
}
|
||||
self.log('browser-side', ' +-- message shown!')
|
||||
|
@ -484,7 +484,9 @@ window.addEventListener('load', function() {
|
|||
libresilient_sw.className += " active";
|
||||
try {
|
||||
libresilient_sw.querySelector('.status').innerHTML = "yes";
|
||||
} catch(e) {}
|
||||
} catch(e) {
|
||||
// nothing to do here, move along
|
||||
}
|
||||
}
|
||||
}
|
||||
// was any content unavailable so far?
|
||||
|
@ -611,7 +613,7 @@ if ('serviceWorker' in navigator) {
|
|||
}
|
||||
if (event.data.serviceWorker) {
|
||||
self.log('browser-side', '+-- got the serviceWorker version:', event.data.serviceWorker)
|
||||
libresilient_sws = document.getElementsByClassName("libresilient-commit-service-worker");
|
||||
var libresilient_sws = document.getElementsByClassName("libresilient-commit-service-worker");
|
||||
for (let element of libresilient_sws) {
|
||||
element.innerHTML = event.data.serviceWorker;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue