Commit 8bfde357 authored by Michał "rysiek" Woźniak's avatar Michał "rysiek" Woźniak
Browse files

Split SamizdatPlugin.push() into .stash() (for locally stashing content) and...

Split SamizdatPlugin.push() into .stash() (for locally stashing content) and .publish() (for publishing content by a site admin)

ref: #16
parent 9143d196
Pipeline #1951 passed with stage
in 9 minutes and 9 seconds
......@@ -194,7 +194,7 @@
.forEach((el)=>{
resources.push(el.parentElement.querySelector('.fetched-resource-url').innerText)
})
return SamizdatPlugins[1].push(resources)
return SamizdatPlugins[1].stash(resources)
})
}
......@@ -226,7 +226,7 @@
.forEach((el)=>{
resources.push(el.parentElement.querySelector('.fetched-resource-url').innerText)
})
return SamizdatPlugins[1].push(resources, user, pass)
return SamizdatPlugins[1].publish(resources, user, pass)
}
......
......@@ -59,5 +59,5 @@ self.SamizdatPlugins.push({
description: 'Locally cached responses, using the Cache API.',
version: 'COMMIT_UNKNOWN',
fetch: getContentFromCache,
push: cacheContent
stash: cacheContent
})
......@@ -36,5 +36,4 @@ self.SamizdatPlugins.push({
description: 'Just a regular HTTP(S) fetch()',
version: 'COMMIT_UNKNOWN',
fetch: fetchContent,
push: null
})
......@@ -421,5 +421,5 @@ self.SamizdatPlugins.push({
description: 'Decentralized resource fetching using Gun for address resolution and IPFS for content delivery.',
version: 'COMMIT_UNKNOWN',
fetch: getContentFromGunAndIPFS,
push: publishContent
publish: publishContent
})
......@@ -223,7 +223,7 @@ self.addEventListener('fetch', event => {
// TODO: this assumes the cache plugin is the first one!
// TODO: we should not be caching a response fetched from cache!
console.log("(COMMIT_UNKNOWN) Caching successful fetch: ", cleanURL);
return SamizdatPlugins[1].push(response.clone(), cleanURL).then((res)=>{
return SamizdatPlugins[1].stash(response.clone(), cleanURL).then((res)=>{
return response
})
})*/
......
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