tag:danbooru.me,2005:/forum_topics/8502Danbooru (etc...) userscripts2020-03-04T13:15:34-05:00tag:danbooru.me,2005:ForumPost/1636872020-03-04T13:15:34-05:002020-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('<option value="copy-id">Copy ID</option>');
$(".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/23799tag:danbooru.me,2005:ForumPost/1629742020-02-08T20:22:12-05:002020-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)=>{
$.post(`/users/${Danbooru.CurrentUser.data('id')}.json`, {
user: {
enable_safe_mode: !Danbooru.CurrentUser.data('enable-safe-mode')
},
_method: "put"
}).then(()=>{
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/23799tag:danbooru.me,2005:ForumPost/1603892019-10-15T18:59:32-04:002019-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 > 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/23799tag:danbooru.me,2005:ForumPost/1603792019-10-15T03:08:17-04:002019-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 > div:nth-child(9) { display: none; } /* hide commentary section */ </pre>tapnek/users/454016tag:danbooru.me,2005:ForumPost/1602072019-10-07T15:36:06-04:002019-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(()=>{
if ($('#upload_file').length === 0) {
clearInterval(timer);
$("#filedropzone").before(`
<div class="input fallback">
<label for="upload_file">File</label>
<input size="50" type="file" name="upload[file]" id="upload_file" />
</div>`);
}
}, 100);
</pre>BrokenEagle98/users/23799tag:danbooru.me,2005:ForumPost/1601292019-10-02T16:16:34-04:002019-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>link[href^="/users/custom_style.css"]').remove();
</pre><h6>Turn on custom CSS</h6><pre>javascript:var temp=window.custom_CSS&&$(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 > link[href^="/users/custom_style.css"]');
$("#page-footer").append(`<span id="custom-css-switch">&nbsp;-&nbsp;<a style="color:red" href="#">Custom CSS Off</a></span>`);
$("#custom-css-switch a").click((event)=>{
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/23799tag:danbooru.me,2005:ForumPost/1587642019-08-05T20:17:09-04:002019-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/23799tag:danbooru.me,2005:ForumPost/1587612019-08-05T19:43:33-04:002019-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/503835tag:danbooru.me,2005:ForumPost/1587552019-08-05T13:52:37-04:002019-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/23799tag:danbooru.me,2005:ForumPost/1587242019-08-04T06:48:19-04:002019-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/503835tag:danbooru.me,2005:ForumPost/1559942019-04-06T13:49:39-04:002019-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/23799tag:danbooru.me,2005:ForumPost/1559932019-04-06T13:22:28-04:002019-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/503835tag:danbooru.me,2005:ForumPost/1559902019-04-06T12:36:07-04:002019-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(()=>{
if ($image[0].naturalWidth !== 0 && $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/23799tag:danbooru.me,2005:ForumPost/1559212019-04-02T21:47:23-04:002019-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/547400tag:danbooru.me,2005:ForumPost/1559192019-04-02T21:23:13-04:002019-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/23799tag:danbooru.me,2005:ForumPost/1559132019-04-02T18:14:50-04:002019-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/547400tag:danbooru.me,2005:ForumPost/1524832018-11-20T19:14:58-05:002018-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)=([^&]+)/);danb_search=(danb_search?danb_search[1].replace(/order%3arandom/i,''):'');window.location="/posts/random?tags="+danb_search;
</pre>BrokenEagle98/users/23799tag:danbooru.me,2005:ForumPost/1521912018-11-10T19:33:05-05:002018-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/23799tag:danbooru.me,2005:ForumPost/1521882018-11-10T19:01:47-05:002018-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/75306tag:danbooru.me,2005:ForumPost/1496582018-08-19T15:58:46-04:002018-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