-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·14 lines (14 loc) · 2.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<!DOCTYPE html>
<html>
<title>Tutturizer</title>
<body>
<h1>Tutturizer</h1>
<h2>Overview</h2>
<p>Tutturizer is a bookmarklet for Mastodon interfaces which makes all toots tutturoos and people happy.</p>
<h2>How to use</h2>
<p>Bookmark the link below and use it on your Mastodon interface.</p>
<p><a href="javascript:(function()%7Bvar%20FindUnhappyPeople%3Blet%20script%20%3D%20document.createElement(%22script%22)%3Bscript.type%20%3D%20%22text%2Fjavascript%22%3Bscript.src%20%3D%20%22https%3A%2F%2Fcdnjs.cloudflare.com%2Fajax%2Flibs%2Fxregexp%2F3.2.0%2Fxregexp-all.min.js%22%3Bfunction%20tutturize()%20%7Bfunction%20tutturize_text(text)%20%7Breturn%20XRegExp.replace(text%2C%20FindUnhappyPeople%2C%20%22%241%E3%83%88%E3%82%A5%E3%83%83%E3%83%88%E3%82%A5%E3%83%AB%E3%83%BC%244%22)%3B%7Dfunction%20tutturize_element(element)%20%7Bif%20(element.getAttribute(%22data-tutturized%22))%20%7Breturn%20false%3B%7Dfor%20(let%20child%20%3D%20element.firstChild%3B%20child%3B%20child%20%3D%20child.nextSibling)%20%7Bswitch%20(child.nodeType)%20%7Bcase%201%3Atutturize_element(child)%3Bbreak%3Bcase%203%3Achild.nodeValue%20%3D%20tutturize_text(child.nodeValue)%3Bbreak%3B%7D%7Dreturn%20true%3B%7Dfunction%20mark_as_tutturized(element)%20%7Belement.setAttribute(%22data-tutturized%22%2C%20%22true%22)%3B%7Dlet%20btn%20%3D%20document.getElementsByClassName(%22compose-form__publish-button-wrapper%22)%5B0%5D.getElementsByTagName(%22button%22)%5B0%5D%3Btutturize_element(btn)%3Blet%20elements%20%3D%20document.querySelectorAll(%22.status__content%2C%20.notification__message%22)%3Bfor%20(let%20index%20%3D%200%3B%20index%20%3C%20elements.length%3B%20%2B%2Bindex)%20%7Blet%20element%20%3D%20elements%5Bindex%5D%3Bif%20(tutturize_element(element))%20%7Bmark_as_tutturized(element)%3B%7D%7D%7Dscript.addEventListener(%22load%22%2C%20function%20()%20%7BFindUnhappyPeople%20%3D%20new%20XRegExp(%22%5E((.*)(%5B%5E%5C%5Cp%7BKatakana%7D%5D%2B))%3F%E3%83%88%E3%82%A5%E3%83%BC%E3%83%88((%5B%5E%5C%5Cp%7BKatakana%7D%5D%2B)(.*))%3F%24%22)%3Btutturize()%3Bwindow.setInterval(tutturize%2C%201000)%3B%7D%2C%20false)%3Bdocument.head.appendChild(script)%7D)()">Tutturoo!</a></p>
<p>The code can be obtained from the next link: <a href="tutturizer.js">tutturizer.js</a></p>
<p>This bookmarklet won't work with instances which put Content-Security-Policy response header.</p>
</body>
</html>