kuroneko99's Blog

Jan 30, 2024 4:53 PM
This is a script to make the complete quote for a post. The quote generated by the script includes everything; text, image, video, and so on. Select any part of the text of a post with a mouse, call the bookmarklet, and the quote is stored in the clipboard. It's for "classic view mode" only. (sorry, I don't use the new mode.)
the codes
This compact codes provide complete compatibility with MAL's BBCode.
javascript:s=document.getSelection();s=s.anchorNode;do{s=s.parentElement;}while(s.getAttribute("class")!="message-wrapper");m=s.getElementsByClassName("body clearfix")[0].getAttribute("id").replace("message","");u=s.getElementsByClassName("ga-click")[0].getAttribute("href").replace("/profile/","");q="[quote="+u+" message="+m+"]";s.getElementsByClassName("js-message-inspect")[0].click();setTimeout(f, 2000);setTimeout(g, 3000);function f(){b=document.getElementsByClassName("showtext")[0].value;document.dispatchEvent(new KeyboardEvent("keydown",{keyCode:27}));navigator.clipboard.writeText(q+b+"[/quote]");}function g(){alert("Quote text has been stored in the clipboard.n"+q+" ...");}void(0);

If you find the confirmation alert annoying, use the following script.
javascript:s=document.getSelection();s=s.anchorNode;do{s=s.parentElement;}while(s.getAttribute("class")!="message-wrapper");m=s.getElementsByClassName("body clearfix")[0].getAttribute("id").replace("message","");u=s.getElementsByClassName("ga-click")[0].getAttribute("href").replace("/profile/","");q="[quote="+u+" message="+m+"]";s.getElementsByClassName("js-message-inspect")[0].click();setTimeout(f, 2000);function f(){b=document.getElementsByClassName("showtext")[0].value;document.dispatchEvent(new KeyboardEvent("keydown",{keyCode:27}));navigator.clipboard.writeText(q+b+"[/quote]");}void(0);


To make a bookmarklet:
  • Make a URL shortcut (to any web site) on your desktop.
  • Edit the property of the URL shortcut; Namely, paste the bookmarklet script to the URL text box.
  • Display browser's favorites bar (by pressing Ctrl+Shift+B).
  • Drop the URL shortcut (bookmarklet) to your browser's favorites bar.

To use the bookmarklet:
  • Select any part of the text of a post with a mouse, call the bookmarklet in your browser's favorites bar, and the quote is stored in the clipboard.

Notes:
  • No browser extensions or external programs required.
  • If MAL changes the description of the HTML, the bookmarklet becomes obsolete/useless.
  • Probably, this post would be read by only script enthusiasts. and some of you find the script is not technical but reasonable.
Posted by kuroneko99 | Jan 30, 2024 4:53 PM | Add a comment
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login