···11+// ==UserScript==
22+// @name Hello, Dolly!
33+// @description Displays lyrics from the song "Hello Dolly" by Jerry Herman
44+// @author HotSocket
55+// @downloadURL https://tangled.org/did:plc:jlplwn5pi4dqrls7i6dx2me7/hello-dolly/raw/main/hello.user.js
66+// @match *://tangled.org/*
77+// @match *://tangled.sh/*
88+// @version 1.0
99+// ==/UserScript==
1010+1111+function hello_dolly_get_lyric() {
1212+ /** These are the lyrics to Hello Dolly */
1313+ const lyrics = `Hello, Dolly
1414+Well, hello, Dolly
1515+It's so nice to have you back where you belong
1616+You're lookin' swell, Dolly
1717+I can tell, Dolly
1818+You're still glowin', you're still crowin'
1919+You're still goin' strong
2020+I feel the room swayin'
2121+While the band's playin'
2222+One of our old favorite songs from way back when
2323+So, take her wrap, fellas
2424+Dolly, never go away again
2525+Hello, Dolly
2626+Well, hello, Dolly
2727+It's so nice to have you back where you belong
2828+You're lookin' swell, Dolly
2929+I can tell, Dolly
3030+You're still glowin', you're still crowin'
3131+You're still goin' strong
3232+I feel the room swayin'
3333+While the band's playin'
3434+One of our old favorite songs from way back when
3535+So, golly, gee, fellas
3636+Have a little faith in me, fellas
3737+Dolly, never go away
3838+Promise, you'll never go away
3939+Dolly'll never go away again`;
4040+4141+ // Here we split it into lines.
4242+ const lines = lyrics.split("\n");
4343+4444+ console.log(lines);
4545+ // And then randomly choose a line.
4646+ return lines[Math.max(0, Math.round((Math.random()*lines.length) - 1))];
4747+}
4848+4949+// This just creates the element for the chosen line, we'll position it later.
5050+function hello_dolly() {
5151+ const chosen = hello_dolly_get_lyric();
5252+5353+ const el = document.createElement("span");
5454+ el.classList.add("text-gray-700", "dark:text-gray-400");
5555+ el.textContent = chosen;
5656+ el.ariaLabel = `Quote from Hello Dolly song, by Jerry Herman: ${chosen}`;
5757+5858+ return el;
5959+}
6060+6161+const leftItems = document.getElementById("left-items");
6262+leftItems.style.display = "flex";
6363+leftItems.style.alignItems = "center";
6464+leftItems.style.gap = "1em";
6565+6666+leftItems.appendChild(hello_dolly());
+19
readme.md
···11+# Hello, Dolly!
22+33+_Based on the [WordPress plugin](http://wordpress.org/plugins/hello-dolly/) by
44+[Matt Mullenweg](http://ma.tt/)_
55+66+This is a userscript that puts lines from "Hello, Dolly!" in the top bar of
77+[Tangled](https://tangled.org/).
88+99+To use it, get a [UserScript manager](https://violentmonkey.github.io/get-it/),
1010+then click
1111+[here](https://tangled.org/did:plc:jlplwn5pi4dqrls7i6dx2me7/hello-dolly/raw/main/hello.user.js)
1212+to install it.
1313+1414+Original plugin description:
1515+1616+> This is not just a plugin, it symbolizes the hope and enthusiasm of an entire
1717+> generation summed up in two words sung most famously by Louis Armstrong:
1818+> Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello,
1919+> Dolly</cite> in the upper right of your admin screen on every page.