Created
January 15, 2024 21:11
-
-
Save petersohn/b7e3477cbafe12430d40035eac75a992 to your computer and use it in GitHub Desktop.
Userscript for TVTropes quoteblock to forum posts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Quoteblock to forum posts | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-01-15 | |
// @description Add [[quoteblock]]/[[/quoteblock]] widget to forum post editor. | |
// @author You | |
// @match https://tvtropes.org/pmwiki/addpost.php* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=tvtropes.org | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
const element = document.querySelector('#smileyPanel'); | |
if (element === null) { | |
return; | |
} | |
const open = document.createElement('img'); | |
open.src = 'https://static.tvtropes.org/pmwiki/pub/images/openquote.png'; | |
open.alt = '[[quoteblock]]'; | |
open.title = '[[quoteblock]]'; | |
element.appendChild(open); | |
const close = document.createElement('img'); | |
close.src = 'https://static.tvtropes.org/pmwiki/pub/images/closequote.png'; | |
close.alt = '[[/quoteblock]]'; | |
close.title = '[[/quoteblock]]'; | |
element.appendChild(close); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment