Commit 3eded414 authored by o@immerda.ch's avatar o@immerda.ch
Browse files

support for adding to onion site

parent de01beca
var ipickJsIsIncluded = false;
(function(document, logo) {
// Prevent ipick being loaded twice
if (ipickJsIsIncluded)
return;
ipickJsIsIncluded = true;
var style = `
#ipick-button {
position: absolute;
......@@ -116,18 +122,40 @@
// create menu
var menu = document.createElement("div");
menu.className = "ipick-menu";
menu.innerHTML = `
<ul>
<li><a href="https://webmail.immerda.ch">Mail</a></li>
<li><a href="https://wolkig.ch">Cloud</a></li>
<li><a href="https://dl.immerda.ch">Fileshare</a></li>
<li><a href="https://schichtplan.immerda.ch">Schichtplan</a></li>
<li><a href="https://code.immerda.ch">Code</a></li>
<li><a href="https://users.immerda.ch">Einstellungen</a></li>
<li><a href="https://docs.immerda.ch">Hilfe</a></li>
<li><a href="https://www.immerda.ch/contribute/account.html">Spenden</a></li>
</ul>
`;
var notOnion = location.host.indexOf('ysp4gfuhnmj6b4mb.onion') === -1;
var idomain = notOnion ? "immerda.ch" : "ysp4gfuhnmj6b4mb.onion";
var menuEntries = [
["webmail." + idomain,
"Mail"],
["wolkig.ch",
"Cloud"],
["dl.immerda.ch",
"Fileshare"],
["schichtplan.immerda.ch",
"Schichtplan"],
["code.immerda.ch",
"Code"],
["users." + idomain,
"Einstellungen"],
["docs.immerda.ch",
"Hilfe"],
["www." + idomain + "/donate.html",
"Spenden"],
];
var menuList = document.createElement("ul");
menuEntries.forEach(function(e) {
var li = document.createElement("li");
var a = document.createElement("a");
a.href = "https://" + e[0];
a.innerHTML = e[1];
li.appendChild(a);
menuList.appendChild(li);
});
var nav = document.createElement("nav");
nav.appendChild(menuList);
menu.appendChild(nav);
// create menu toggler
var image = document.createElement("img");
......
Supports Markdown
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