-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 25659c1
Showing
110 changed files
with
31,873 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 1eaa30db62267bbb8c4811a487035716 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"/home/runner/work/nbsite/nbsite/site/doc/playground/pyodide/holoviz.md": {"css": [], "js": ["https://cdn.holoviz.org/panel/1.5.1/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js", "https://cdn.holoviz.org/panel/1.5.1/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js", "https://cdn.holoviz.org/panel/1.5.1/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js"], "js_exports": {}, "js_modules": {}}, "/home/runner/work/nbsite/nbsite/site/doc/playground/pyodide/index.md": {"css": [], "js": ["https://cdn.holoviz.org/panel/1.5.1/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js", "https://cdn.holoviz.org/panel/1.5.1/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js", "https://cdn.holoviz.org/panel/1.5.1/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js"], "js_exports": {}, "js_modules": {}}} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"e73b48e8e00d36304ea7204a0683c814": [null, null, "hello\n", "", ["https://cdn.holoviz.org/panel/1.5.1/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js", "https://cdn.holoviz.org/panel/1.5.1/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js", "https://cdn.holoviz.org/panel/1.5.1/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js"], {}, {}, [], []]} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
const appName = 'nbsite' | ||
const appCacheName = 'nbsite-0.8.6rc9'; | ||
|
||
const preCacheFiles = []; | ||
|
||
const cachePatterns = ['https://cdn.holoviz.org/panel/1.5.1/dist/', 'https://cdn.bokeh.org/bokeh/', 'https://cdn.jsdelivr.net/pyodide/', 'https://files.pythonhosted.org/packages/', 'https://pypi.org/pypi/']; | ||
|
||
self.addEventListener('install', (e) => { | ||
console.log('[Service Worker] Install'); | ||
self.skipWaiting(); | ||
e.waitUntil((async () => { | ||
const cacheNames = await caches.keys(); | ||
for (const cacheName of cacheNames) { | ||
if (cacheName.startsWith(appName) && cacheName !== appCacheName) { | ||
console.log(`[Service Worker] Delete old cache ${cacheName}`); | ||
caches.delete(cacheName); | ||
} | ||
} | ||
const cache = await caches.open(appCacheName); | ||
if (preCacheFiles.length) { | ||
console.log('[Service Worker] Precaching '); | ||
} | ||
preCacheFiles.forEach(async (cacheFile) => { | ||
const request = new Request(cacheFile); | ||
const response = await fetch(request); | ||
if (response.ok || response.type == 'opaque') { | ||
cache.put(request, response); | ||
} | ||
}) | ||
})()); | ||
}); | ||
|
||
self.addEventListener('activate', (event) => { | ||
console.log('[Service Worker] Activating'); | ||
return self.clients.claim(); | ||
}); | ||
|
||
self.addEventListener('fetch', (e) => { | ||
if (e.request.method !== 'GET') { | ||
return | ||
} | ||
e.respondWith((async () => { | ||
const cache = await caches.open(appCacheName); | ||
let response = await cache.match(e.request); | ||
console.log(`[Service Worker] Fetching resource: ${e.request.url}`); | ||
if (response) { | ||
return response; | ||
} | ||
response = await fetch(e.request); | ||
if (!response.ok && !(response.type == 'opaque')) { | ||
throw Error(`[Service Worker] Fetching resource ${e.request.url} failed with response: ${response.status}`); | ||
} | ||
console.log(`[Service Worker] Caching new resource: ${e.request.url}`); | ||
if (e.request.mode !== 'no-cors') { | ||
cache.put(e.request, response.clone()); | ||
} | ||
return response; | ||
})()); | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
// @ts-check | ||
|
||
// Extra JS capability for selected tabs to be synced | ||
// The selection is stored in local storage so that it persists across page loads. | ||
|
||
/** | ||
* @type {Record<string, HTMLElement[]>} | ||
*/ | ||
let sd_id_to_elements = {}; | ||
const storageKeyPrefix = "sphinx-design-tab-id-"; | ||
|
||
/** | ||
* Create a key for a tab element. | ||
* @param {HTMLElement} el - The tab element. | ||
* @returns {[string, string, string] | null} - The key. | ||
* | ||
*/ | ||
function create_key(el) { | ||
let syncId = el.getAttribute("data-sync-id"); | ||
let syncGroup = el.getAttribute("data-sync-group"); | ||
if (!syncId || !syncGroup) return null; | ||
return [syncGroup, syncId, syncGroup + "--" + syncId]; | ||
} | ||
|
||
/** | ||
* Initialize the tab selection. | ||
* | ||
*/ | ||
function ready() { | ||
// Find all tabs with sync data | ||
|
||
/** @type {string[]} */ | ||
let groups = []; | ||
|
||
document.querySelectorAll(".sd-tab-label").forEach((label) => { | ||
if (label instanceof HTMLElement) { | ||
let data = create_key(label); | ||
if (data) { | ||
let [group, id, key] = data; | ||
|
||
// add click event listener | ||
// @ts-ignore | ||
label.onclick = onSDLabelClick; | ||
|
||
// store map of key to elements | ||
if (!sd_id_to_elements[key]) { | ||
sd_id_to_elements[key] = []; | ||
} | ||
sd_id_to_elements[key].push(label); | ||
|
||
if (groups.indexOf(group) === -1) { | ||
groups.push(group); | ||
// Check if a specific tab has been selected via URL parameter | ||
const tabParam = new URLSearchParams(window.location.search).get( | ||
group | ||
); | ||
if (tabParam) { | ||
console.log( | ||
"sphinx-design: Selecting tab id for group '" + | ||
group + | ||
"' from URL parameter: " + | ||
tabParam | ||
); | ||
window.sessionStorage.setItem(storageKeyPrefix + group, tabParam); | ||
} | ||
} | ||
|
||
// Check is a specific tab has been selected previously | ||
let previousId = window.sessionStorage.getItem( | ||
storageKeyPrefix + group | ||
); | ||
if (previousId === id) { | ||
// console.log( | ||
// "sphinx-design: Selecting tab from session storage: " + id | ||
// ); | ||
// @ts-ignore | ||
label.previousElementSibling.checked = true; | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Activate other tabs with the same sync id. | ||
* | ||
* @this {HTMLElement} - The element that was clicked. | ||
*/ | ||
function onSDLabelClick() { | ||
let data = create_key(this); | ||
if (!data) return; | ||
let [group, id, key] = data; | ||
for (const label of sd_id_to_elements[key]) { | ||
if (label === this) continue; | ||
// @ts-ignore | ||
label.previousElementSibling.checked = true; | ||
} | ||
window.sessionStorage.setItem(storageKeyPrefix + group, id); | ||
} | ||
|
||
document.addEventListener("DOMContentLoaded", ready, false); |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.