Userscript that puts lines from "Hello, Dolly!" in the top bar of Tangled.

ship it!

+85
+66
hello.user.js
··· 1 + // ==UserScript== 2 + // @name Hello, Dolly! 3 + // @description Displays lyrics from the song "Hello Dolly" by Jerry Herman 4 + // @author HotSocket 5 + // @downloadURL https://tangled.org/did:plc:jlplwn5pi4dqrls7i6dx2me7/hello-dolly/raw/main/hello.user.js 6 + // @match *://tangled.org/* 7 + // @match *://tangled.sh/* 8 + // @version 1.0 9 + // ==/UserScript== 10 + 11 + function hello_dolly_get_lyric() { 12 + /** These are the lyrics to Hello Dolly */ 13 + const lyrics = `Hello, Dolly 14 + Well, hello, Dolly 15 + It's so nice to have you back where you belong 16 + You're lookin' swell, Dolly 17 + I can tell, Dolly 18 + You're still glowin', you're still crowin' 19 + You're still goin' strong 20 + I feel the room swayin' 21 + While the band's playin' 22 + One of our old favorite songs from way back when 23 + So, take her wrap, fellas 24 + Dolly, never go away again 25 + Hello, Dolly 26 + Well, hello, Dolly 27 + It's so nice to have you back where you belong 28 + You're lookin' swell, Dolly 29 + I can tell, Dolly 30 + You're still glowin', you're still crowin' 31 + You're still goin' strong 32 + I feel the room swayin' 33 + While the band's playin' 34 + One of our old favorite songs from way back when 35 + So, golly, gee, fellas 36 + Have a little faith in me, fellas 37 + Dolly, never go away 38 + Promise, you'll never go away 39 + Dolly'll never go away again`; 40 + 41 + // Here we split it into lines. 42 + const lines = lyrics.split("\n"); 43 + 44 + console.log(lines); 45 + // And then randomly choose a line. 46 + return lines[Math.max(0, Math.round((Math.random()*lines.length) - 1))]; 47 + } 48 + 49 + // This just creates the element for the chosen line, we'll position it later. 50 + function hello_dolly() { 51 + const chosen = hello_dolly_get_lyric(); 52 + 53 + const el = document.createElement("span"); 54 + el.classList.add("text-gray-700", "dark:text-gray-400"); 55 + el.textContent = chosen; 56 + el.ariaLabel = `Quote from Hello Dolly song, by Jerry Herman: ${chosen}`; 57 + 58 + return el; 59 + } 60 + 61 + const leftItems = document.getElementById("left-items"); 62 + leftItems.style.display = "flex"; 63 + leftItems.style.alignItems = "center"; 64 + leftItems.style.gap = "1em"; 65 + 66 + leftItems.appendChild(hello_dolly());
+19
readme.md
··· 1 + # Hello, Dolly! 2 + 3 + _Based on the [WordPress plugin](http://wordpress.org/plugins/hello-dolly/) by 4 + [Matt Mullenweg](http://ma.tt/)_ 5 + 6 + This is a userscript that puts lines from "Hello, Dolly!" in the top bar of 7 + [Tangled](https://tangled.org/). 8 + 9 + To use it, get a [UserScript manager](https://violentmonkey.github.io/get-it/), 10 + then click 11 + [here](https://tangled.org/did:plc:jlplwn5pi4dqrls7i6dx2me7/hello-dolly/raw/main/hello.user.js) 12 + to install it. 13 + 14 + Original plugin description: 15 + 16 + > This is not just a plugin, it symbolizes the hope and enthusiasm of an entire 17 + > generation summed up in two words sung most famously by Louis Armstrong: 18 + > Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, 19 + > Dolly</cite> in the upper right of your admin screen on every page.