diff options
Diffstat (limited to 'webring/linuxring/script/onionring-index.js')
| -rw-r--r-- | webring/linuxring/script/onionring-index.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/webring/linuxring/script/onionring-index.js b/webring/linuxring/script/onionring-index.js new file mode 100644 index 0000000..0365b69 --- /dev/null +++ b/webring/linuxring/script/onionring-index.js @@ -0,0 +1,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:\/\/|\/$/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> +`); |
