-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathonionring-index.js
More file actions
20 lines (16 loc) · 797 Bytes
/
Copy pathonionring-index.js
File metadata and controls
20 lines (16 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// onionring.js is made up of four files - onionring-widget.js, onionring-index.js (this one!), onionring-variables.js, and onionring.css
// it's licensed under the cooperative non-violent license (CNPL) v4+ (https://thufie.lain.haus/NPL.html)
// it was originally made by joey + mord of allium (蒜) house, last updated 2020-11-24
// === ONIONRING-INDEX ===
//this file builds the list of sites in the ring for displaying on your index page
var tag = document.getElementById('index');
regex = /^https:\/\/|^http:\/\/|\/$/g; //strips the https:// and trailing slash off the urls for aesthetic purposes
list = "";
for (i = 0; i < sites.length; i++) {
list += `<li><a href='${sites[i]}'>${sites[i].replace(regex, "")}</a></li>`;
}
tag.insertAdjacentHTML('afterbegin', `
<ul>
${list}
</ul>
`);