This commit is contained in:
electrofelix
2022-08-12 17:32:21 +00:00
parent 06dcee0ba8
commit 1cdd603358
12 changed files with 26 additions and 18 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
{"files":{"js/version_switcher-75b1894ffb3a0fdf14bc5ec4ae1af9375b7bbd69783d85f779335e487674663e.js":{"logical_path":"js/version_switcher.js","mtime":"2022-08-10T09:17:44+00:00","size":3133,"digest":"75b1894ffb3a0fdf14bc5ec4ae1af9375b7bbd69783d85f779335e487674663e","integrity":"sha256-dbGJT/s6D98UvF7Erhr5N1t7vWl4PYX3eTNeSHZ0Zj4="}},"assets":{"js/version_switcher.js":"js/version_switcher-75b1894ffb3a0fdf14bc5ec4ae1af9375b7bbd69783d85f779335e487674663e.js"}}

View File

@@ -0,0 +1 @@
{"files":{"js/site_constants-e1ac483f8cbbb2d44940348129b4f096317606c1e27aa57fe14734259e395fe6.js":{"logical_path":"js/site_constants.js","mtime":"2022-08-12T17:31:16+00:00","size":98,"digest":"e1ac483f8cbbb2d44940348129b4f096317606c1e27aa57fe14734259e395fe6","integrity":"sha256-4axIP4y7stRJQDSBKbTwljF2BsHieqV/4Uc0JZ45X+Y="},"js/plugin_versions_menu-cae3311f47621d57528eb59b9f26241a66b7a62a1eec2d56a371369973ead034.js":{"logical_path":"js/plugin_versions_menu.js","mtime":"2022-08-12T17:31:16+00:00","size":3416,"digest":"cae3311f47621d57528eb59b9f26241a66b7a62a1eec2d56a371369973ead034","integrity":"sha256-yuMxH0diHVdSjrWbnyYkGma3pioe7C1Wo3E2mXPq0DQ="}},"assets":{"js/site_constants.js":"js/site_constants-e1ac483f8cbbb2d44940348129b4f096317606c1e27aa57fe14734259e395fe6.js","js/plugin_versions_menu.js":"js/plugin_versions_menu-cae3311f47621d57528eb59b9f26241a66b7a62a1eec2d56a371369973ead034.js"}}

View File

@@ -1,13 +1,9 @@
const basePath = '/vagrant-libvirt';
const repository_nwo = 'vagrant-libvirt/vagrant-libvirt';
const { buildWebStorage, setupCache } = window.AxiosCacheInterceptor;
const storage = buildWebStorage(sessionStorage, 'axios-cache:');
const axiosCached = setupCache(axios.create(), { storage });
changeVersion = function handleVersionedDocs(repository_nwo, basePath) {
async function loadOptions(select) {
async function loadOptions(selectElement) {
const defaultBranchPromise = axiosCached.get(
`https://api.github.com/repos/${repository_nwo}`,
).then(res => {
@@ -53,7 +49,7 @@ changeVersion = function handleVersionedDocs(repository_nwo, basePath) {
opt.value = item.value;
opt.innerHTML = item.text;
select.appendChild(opt);
selectElement.appendChild(opt);
});
const path = window.location.pathname.toLowerCase();
@@ -61,9 +57,9 @@ changeVersion = function handleVersionedDocs(repository_nwo, basePath) {
if (path.startsWith(versionPath)) {
const start = versionPath.length;
const end = path.indexOf('/', start);
select.value = path.substring(start, end);
selectElement.value = path.substring(start, end);
} else {
select.value = 'latest';
selectElement.value = 'latest';
}
};
@@ -81,7 +77,14 @@ changeVersion = function handleVersionedDocs(repository_nwo, basePath) {
window.location.pathname = targetPath;
};
loadOptions(document.getElementById("plugin-version"));
var pluginVersionMenuElement = document.getElementById("plugin-version-menu")
pluginVersionMenuElement.innerHTML = "Plugin Version: "
var selectElement = document.createElement('select');
selectElement.id = "plugin-version"
selectElement.addEventListener('change', function() {changeVersion(this); });
pluginVersionMenuElement.appendChild(selectElement);
loadOptions(selectElement);
return changeVersion;
}(repository_nwo, basePath);

View File

@@ -0,0 +1,5 @@
const basePath = '/vagrant-libvirt';
const repository_nwo = 'vagrant-libvirt/vagrant-libvirt';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.2">Jekyll</generator><link href="https://vagrant-libvirt.github.io/vagrant-libvirt/feed.xml" rel="self" type="application/atom+xml" /><link href="https://vagrant-libvirt.github.io/vagrant-libvirt/" rel="alternate" type="text/html" /><updated>2022-08-10T09:18:38+00:00</updated><id>https://vagrant-libvirt.github.io/vagrant-libvirt/feed.xml</id><title type="html">Vagrant Libvirt Documentation</title><subtitle>Create and manage Vagrant machines using Libvirt/QEMU</subtitle></feed>
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.2">Jekyll</generator><link href="https://vagrant-libvirt.github.io/vagrant-libvirt/feed.xml" rel="self" type="application/atom+xml" /><link href="https://vagrant-libvirt.github.io/vagrant-libvirt/" rel="alternate" type="text/html" /><updated>2022-08-12T17:32:15+00:00</updated><id>https://vagrant-libvirt.github.io/vagrant-libvirt/feed.xml</id><title type="html">Vagrant Libvirt Documentation</title><subtitle>Create and manage Vagrant machines using Libvirt/QEMU</subtitle></feed>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long