tag:danbooru.me,2005:/forum_topics/8502 Danbooru (etc...) userscripts 2020-03-04T13:15:34-05:00 tag:danbooru.me,2005:ForumPost/163687 2020-03-04T13:15:34-05:00 2020-03-04T13:15:34-05:00 @BrokenEagle98: The following userscript adds an extra option... <p>The following userscript adds an extra option to the <strong>Mode</strong> menu on the post index that makes it easier to get a posts ID. This can be useful for assigning parent or child IDs for instance.</p><h4>Userscript</h4><pre>// ==UserScript== // @name Copy Post ID // @version 1.0 // @description Copy a post's ID when clicking the post preview // @match *://*.donmai.us/ // @include /^https?://\w+\.donmai\.us/posts(\?|$)/ // @exclude /^https?://\w+\.donmai\.us/.*\.(xml|json|atom)(\?|$)/ // @grant none // ==/UserScript== function PostModeMenu(event) { let s = $("#mode-box select").val(); if (s === "copy-id") { let post_id = $(event.target).closest("article").data("id"); window.prompt("Copy to clipboard: Ctrl+C, Enter", post_id); event.preventDefault(); } } $("#mode-box select option[value=tag-script]").after('&lt;option value="copy-id"&gt;Copy ID&lt;/option&gt;'); $(".post-preview a").on('click.cpi', PostModeMenu); </pre><h4>Usage</h4><p>Clicking a post preview while this mode is active will pull up a prompt with the post ID already selected, which can be copied using Ctrl+C or the mouse's right-click function. After that, the prompt can be closed by clicking any of the buttons.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/162974 2020-02-08T20:22:12-05:00 2020-02-08T20:27:57-05:00 @BrokenEagle98: The following script can be used to easily... <p>The following script can be used to easily switch back and forth between safe mode and regular mode (kudos to <a href="/users?name=fossilnix">@fossilnix</a> for the idea).</p><h4>Bookmarklet</h4><pre>javascript:$.post(`/users/${Danbooru.CurrentUser.data('id')}.json`,{user:{enable_safe_mode:!Danbooru.CurrentUser.data('enable-safe-mode')},_method:"put"}); </pre><p class="tn"><strong>Note:</strong> Unfortunately, DText doesn't allow one to create a link out of the above, so the bookmarklets will have to be set manually.</p><h4>Userscript</h4><pre>// ==UserScript== // @name Safe mode toggle // @version 1.0 // @description Add a hotkey to toggle safe mode on and off. // @match *://*.donmai.us/* // @exclude /^https?://\w+\.donmai\.us/.*\.(xml|json|atom)(\?|$)/ // @grant none // ==/UserScript== Danbooru.Utility.keydown("[", "safe_mode", (event)=&gt;{ $.post(`/users/${Danbooru.CurrentUser.data('id')}.json`, { user: { enable_safe_mode: !Danbooru.CurrentUser.data('enable-safe-mode') }, _method: "put" }).then(()=&gt;{ window.location.reload(); }); }); </pre><h4>Usage</h4><p>To change the hotkey, change the character in the string "[". Modifiers such as Ctrl, Shift, and/or Alt are allowed, e.g. "ctrl+[".</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/160389 2019-10-15T18:59:32-04:00 2019-10-15T18:59:32-04:00 @BrokenEagle98: > tapnek said: > > Using this userscript... <blockquote> <p>tapnek said:</p> <p>Using this userscript overrides the CSS I use to hide the Commentary part of the upload page, which I don't want shown when I upload. This is the CSS code I'm using for that.</p> <pre>#c-uploads #a-new #form &gt; div:nth-child(9) { display: none; } /* hide commentary section */ </pre> </blockquote><p>I created <a rel="external nofollow noreferrer" class="dtext-link dtext-id-link dtext-github-id-link" href="https://github.com/r888888888/danbooru/issues/4194">issue #4194</a> to add CSS IDs to the page so that positional selectors like the above don't have to be used.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/160379 2019-10-15T03:08:17-04:00 2019-10-15T03:08:17-04:00 @tapnek: Using this userscript overrides the CSS I use... <p>Using this userscript overrides the CSS I use to hide the Commentary part of the upload page, which I don't want shown when I upload. This is the CSS code I'm using for that.</p><pre>#c-uploads #a-new #form &gt; div:nth-child(9) { display: none; } /* hide commentary section */ </pre> tapnek /users/454016 tag:danbooru.me,2005:ForumPost/160207 2019-10-07T15:36:06-04:00 2019-10-07T15:36:29-04:00 @BrokenEagle98: Since the old file input method is currently... <p>Since the old file input method is currently broken, I created the following script which should bring it back.</p><pre>// ==UserScript== // @name Upload File Input // @version 1.0 // @description Add the file input back to the uploads page. // @match *://*.donmai.us/uploads/new* // @exclude /^https?://\w+\.donmai\.us/.*\.(xml|json|atom)(\?|$)/ // @grant none // @run-at document-end // ==/UserScript== const timer = setInterval(()=&gt;{ if ($('#upload_file').length === 0) { clearInterval(timer); $("#filedropzone").before(` &lt;div class="input fallback"&gt; &lt;label for="upload_file"&gt;File&lt;/label&gt; &lt;input size="50" type="file" name="upload[file]" id="upload_file" /&gt; &lt;/div&gt;`); } }, 100); </pre> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/160129 2019-10-02T16:16:34-04:00 2019-10-31T13:55:40-04:00 @BrokenEagle98: Due to the recent issues with layout changes... <p>Due to the recent issues with layout changes conflicting with custom CSS, I've created the following bookmarklets/userscript to help a user diagnose whether an issue is being caused by the site itself or by their custom CSS.</p><h4>Bookmarklets</h4><h6>Turn off custom CSS</h6><pre>javascript:var temp=window.custom_CSS=$('head&gt;link[href^="/users/custom_style.css"]').remove(); </pre><h6>Turn on custom CSS</h6><pre>javascript:var temp=window.custom_CSS&amp;&amp;$(document.head).append(window.custom_CSS); </pre><p class="tn"><strong>Note:</strong> Unfortunately, DText doesn't allow one to create a link out of the above, so the bookmarklets will have to be set manually.</p><h4>Userscript</h4><pre>// ==UserScript== // @name Custom CSS Switch // @version 1.3 // @description Add a link to turn on/off custom CSS // @match *://*.donmai.us/* // @exclude /^https?://\w+\.donmai\.us/.*\.(xml|json|atom)(\?|$)/ // @run-at document-end // ==/UserScript== var switch_on = true; var $custom_css = $('head &gt; link[href^="/users/custom_style.css"]'); $("#page-footer").append(`&lt;span id="custom-css-switch"&gt;&amp;nbsp;-&amp;nbsp;&lt;a style="color:red" href="#"&gt;Custom CSS Off&lt;/a&gt;&lt;/span&gt;`); $("#custom-css-switch a").click((event)=&gt;{ if (switch_on) { $(event.target).css('color','green').text('Custom CSS Enable'); $custom_css.remove(); switch_on = false; } else { $(event.target).css('color','red').text('Custom CSS Disable'); $(document.head).append($custom_css); switch_on = true; } event.preventDefault(); }); </pre><p>The above userscript adds a link down in the footer where the custom CSS can be toggled on or off.</p><h5>Edit:</h5><ul> <li>(2019-10-04)</li> <ul><li>Added exclude line for XML/JSON</li></ul> <li>(2019-10-17)</li> <ul><li>Fixed issue with bookmarklets on Firefox</li></ul> <li>(2019-10-31)</li> <ul><li>Adjusted language of links</li></ul> </ul> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/158764 2019-08-05T20:17:09-04:00 2019-08-05T20:17:09-04:00 @BrokenEagle98: > inkuJerr said: > > Although when selecting a... <blockquote> <p>inkuJerr said:</p> <p>Although when selecting a tag from the autocomplete, the dropdown menu would becomes "stuck" and won't disappear until I start typing again; this does not seem to occur in previous versions of the <strong><em>IndexedAutocomplete</em></strong>.</p> </blockquote><p>Fixed in <strong>Version 24.1</strong>.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/158761 2019-08-05T19:43:33-04:00 2019-08-05T19:43:33-04:00 @inkuJerr: > BrokenEagle98 said: > > I added this... <blockquote> <p>BrokenEagle98 said:</p> <p>I added this capability to <strong><em>IndexedAutocomplete</em></strong> in <a class="dtext-link dtext-id-link dtext-forum-topic-id-link" href="/forum_topics/14701">topic #14701</a>.</p> </blockquote><p>It works very well and will be very efficient in tagging work. Thanks very much.</p><p>Although when selecting a tag from the autocomplete, the dropdown menu would becomes "stuck" and won't disappear until I start typing again; this does not seem to occur in previous versions of the <strong><em>IndexedAutocomplete</em></strong>.</p> inkuJerr /users/503835 tag:danbooru.me,2005:ForumPost/158755 2019-08-05T13:52:37-04:00 2019-08-05T13:52:37-04:00 @BrokenEagle98: > inkuJerr said: > > Is there a userscript (or... <blockquote> <p>inkuJerr said:</p> <p>Is there a userscript (or CSS) that can "keep track" of the tags that are added to posts?. In other words, whenever I enter tags in the box, the autocomplete menu would show an indication that the tag is already entered in the field, which would be helpful to prevent repeating tags.</p> <p>Example: If I try to add the tag <a class="dtext-link dtext-wiki-link tag-type-0" href="/wiki_pages/smile">smile</a> when it is already in the tagging box, the <a class="dtext-link dtext-wiki-link tag-type-0" href="/wiki_pages/smile">smile</a> tag in the autocomplete menu would be highlighted to inform me that the tag is already present.</p> <p>Something like this would be very beneficial when tagging posts that require a large amount of tags, where it is easy to accidentally repeat tags that have already been entered.</p> </blockquote><p>I added this capability to <strong><em>IndexedAutocomplete</em></strong> in <a class="dtext-link dtext-id-link dtext-forum-topic-id-link" href="/forum_topics/14701">topic #14701</a>.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/158724 2019-08-04T06:48:19-04:00 2019-08-04T06:48:19-04:00 @inkuJerr: Is there a userscript (or CSS) that can "keep... <p>Is there a userscript (or CSS) that can "keep track" of the tags that are added to posts?. In other words, whenever I enter tags in the box, the autocomplete menu would show an indication that the tag is already entered in the field, which would be helpful to prevent repeating tags.</p><p>Example: If I try to add the tag <a class="dtext-link dtext-wiki-link tag-type-0" href="/wiki_pages/smile">smile</a> when it is already in the tagging box, the <a class="dtext-link dtext-wiki-link tag-type-0" href="/wiki_pages/smile">smile</a> tag in the autocomplete menu would be highlighted to inform me that the tag is already present.</p><p>Something like this would be very beneficial when tagging posts that require a large amount of tags, where it is easy to accidentally repeat tags that have already been entered.</p> inkuJerr /users/503835 tag:danbooru.me,2005:ForumPost/155994 2019-04-06T13:49:39-04:00 2019-04-06T13:49:39-04:00 @BrokenEagle98: > inkuJerr said: > > Although the script fixed... <blockquote> <p>inkuJerr said:</p> <p>Although the script fixed the proper size shown for Twitter uploads, I can't really say the same for uploads from Pixiv and Seiga, in which the dimensions are shown to be <strong>0x0</strong> unless I refresh the page. As said before, this does not happen with Twitter.</p> <p><a rel="external nofollow noreferrer" class="dtext-link dtext-external-link" href="https://files.catbox.moe/zes2ev.png">https://files.catbox.moe/zes2ev.png</a></p> </blockquote><p>Fixed it with <strong>Version 1.1</strong>.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/155993 2019-04-06T13:22:28-04:00 2019-04-06T13:22:28-04:00 @inkuJerr: > BrokenEagle98 said: > > In response to forum... <blockquote> <p>BrokenEagle98 said:</p> <p>In response to <a class="dtext-link dtext-id-link dtext-forum-post-id-link" href="/forum_posts/155986">forum #155986</a>. Additionally, it also fixes the situation where the width is limited by the window/screen size, which causes the incorrect image sizes to be shown.</p> </blockquote><p>Although the script fixed the proper size shown for Twitter uploads, I can't really say the same for uploads from Pixiv and Seiga, in which the dimensions are shown to be <strong>0x0</strong> unless I refresh the page. As said before, this does not happen with Twitter.</p><p><a rel="external nofollow noreferrer" class="dtext-link dtext-external-link" href="https://files.catbox.moe/zes2ev.png">https://files.catbox.moe/zes2ev.png</a></p> inkuJerr /users/503835 tag:danbooru.me,2005:ForumPost/155990 2019-04-06T12:36:07-04:00 2019-10-04T19:08:34-04:00 @BrokenEagle98: In response to forum #155986. Additionally, it... <p>In response to <a class="dtext-link dtext-id-link dtext-forum-post-id-link" href="/forum_posts/155986">forum #155986</a>. Additionally, it also fixes the situation where the width is limited by the window/screen size, which causes the incorrect image sizes to be shown.</p><pre>// ==UserScript== // @name Original Scale // @version 1.2 // @description Shows the actual image dimensions. // @match *://*.donmai.us/uploads/new* // @exclude /^https?://\w+\.donmai\.us/.*\.(xml|json|atom)(\?|$)/ // @grant none // @run-at document-idle // ==/UserScript== const $image = $("#image"); if ($image.length) { let timer = setInterval(()=&gt;{ if ($image[0].naturalWidth !== 0 &amp;&amp; $image[0].naturalHeight !== 0) { clearInterval(timer); $("#scale").html(`Original: ${$image[0].naturalWidth}x${$image[0].naturalHeight}`); $("#scale").attr('id','scale-fix'); } },100); } </pre><h5>Edit:</h5><ul> <li>(2019-04-06)</li> <ul><li>Fixed issue with proxy images</li></ul> <li>(2019-10-04)</li> <ul> <li>Added exclude line for XML/JSON</li> <li>Added version number</li> </ul> </ul> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/155921 2019-04-02T21:47:23-04:00 2019-04-02T21:47:23-04:00 @DreamFromTheLayer: > BrokenEagle98 said: > > It still works for... <blockquote> <p>BrokenEagle98 said:</p> <p>It still works for me on the Pixiv post page. Until/unless it changes for myself, I can't really submit a fix.</p> </blockquote><p>Yeah, it's one of those ones that don't change for everyone at the same time, I looked it up. Anyway, it seems related to the new multi-post page, you'll know it when it happens (in the next month or so?).</p> DreamFromTheLayer /users/547400 tag:danbooru.me,2005:ForumPost/155919 2019-04-02T21:23:13-04:00 2019-04-02T21:23:13-04:00 @BrokenEagle98: > DreamFromTheLayer said: > > Just when TISAS... <blockquote> <p>DreamFromTheLayer said:</p> <p>Just when TISAS (<a class="dtext-link dtext-id-link dtext-forum-post-id-link" href="/forum_posts/15976">forum #15976</a>) comes along, PISAS seems to break.</p> <p>Am I alone in thinking PISAS doesn't work with the new Pixiv update or is it just me?</p> <p>edit: when I say it doesn't work I mean on the actual illustration page itself, sorry. It works for searches and the listing page on the profiles and such.</p> </blockquote><p>It still works for me on the Pixiv post page. Until/unless it changes for myself, I can't really submit a fix.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/155913 2019-04-02T18:14:50-04:00 2019-04-10T21:18:16-04:00 @DreamFromTheLayer: Just when TISAS (topic #15976) comes along,... <p>Just when TISAS (<a class="dtext-link dtext-id-link dtext-forum-topic-id-link" href="/forum_topics/15976">topic #15976</a>) comes along, PISAS seems to break.</p><p>Am I alone in thinking PISAS doesn't work with the new Pixiv update or is it just me?</p><p>edit: when I say it doesn't work I mean on the actual illustration page itself, sorry. It works for searches and the listing page on the profiles and such.</p> DreamFromTheLayer /users/547400 tag:danbooru.me,2005:ForumPost/152483 2018-11-20T19:14:58-05:00 2018-11-20T19:14:58-05:00 @BrokenEagle98: Based on a recent question (topic #15758), I... <p>Based on a recent question (<a class="dtext-link dtext-id-link dtext-forum-topic-id-link" href="/forum_topics/15758">topic #15758</a>), I created the following Javascript to navigate to a random page based upon the current tag search query.</p><h4>Bookmarklet</h4><pre>javascript:var danb_search=location.search.match(/(?:tags|q)=([^&amp;]+)/);danb_search=(danb_search?danb_search[1].replace(/order%3arandom/i,''):'');window.location="/posts/random?tags="+danb_search; </pre> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/152191 2018-11-10T19:33:05-05:00 2018-11-10T19:33:05-05:00 @BrokenEagle98: This thread doesn't have a lot of exposure as... <p>This thread doesn't have a lot of exposure as it's only mentioned in a few places, but it contains a lot of useful information.</p><p>Therefore, requesting that this thread be made sticky.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/152188 2018-11-10T19:01:47-05:00 2018-11-10T19:01:47-05:00 @DeusExCalamus: Here's a greasemonkey/tampermonkey script to... <p>Here's a greasemonkey/tampermonkey script to fix the pool link...</p><pre>// ==UserScript== // @name FixPoolMenuLink // @version 1.0 // @description Replace Pools link in top nav with original link. // @match *://*.donmai.us/* // @grant none // ==/UserScript== (function() { 'use strict'; $("menu.main li#nav-pools a").attr('href','/pools') })(); </pre> DeusExCalamus /users/75306 tag:danbooru.me,2005:ForumPost/149658 2018-08-19T15:58:46-04:00 2018-08-19T15:58:46-04:00 @user_543108: Is there any way to make the post tooltips only... <p>Is there any way to make the post tooltips only show when shift is pressed (kinda like in yande.re) ?</p> user_543108 /users/543108