With the change to the new shortened artist URLs, the following can be used to bring back the full length URLs. Use the Bookmarklet if it's only needed occasionally, or the Userscript if it's to be used all the time. (ref forum #136217)
The following will make maintaining bookmarks on Danbooru easier, as it removes the trailing search parameters thereby leaving a clean URL to bookmark. Use the Bookmarklet if it's only needed occasionally, or the Userscript if it's to be used all the time. (ref forum #136183)
The following will make maintaining bookmarks on Danbooru easier, as it removes the trailing search parameters thereby leaving a clean URL to bookmark. Use the Bookmarklet if it's only needed occasionally, or the Userscript if it's to be used all the time. (ref forum #136183)
Awesome, thank you so much. I successfully implemented the Danbooru Post URLs user script in Greasemonkey and it's working just fine - being on all the time works for me, since I make heavy use of "bookmark all tabs"
Chinatsu and nonamethanks asked me to make a script for approvers that would automatically upvote approvals and downvote bad quality and breaks rules disapproval reasons. I'm sharing it here in case anyone else finds it useful.
Userscript
// ==UserScript==
// @name Moderator Voting
// @version 1.1
// @match *://*.donmai.us/moderator/post/queue*
// @match *://*.donmai.us/posts/*
// @exclude /^https?://\w+\.donmai\.us/.*\.(xml|json|atom)(\?|$)/
// @grant none
// @run-at document-idle
// @description Automatically votes on approvals and certain disapprovals
// ==/UserScript==
var $modqueue = $(".mod-queue-preview");
$.each($modqueue, (i,entry)=> {
var postid = $(entry).data('id');
$('.approve-link',entry).click((e)=>{Danbooru.Post.vote('up',postid)});
$('[href*=breaks_rules],[href*=poor_quality]',entry).click((e)=>{Danbooru.Post.vote('down',postid)});
});
var $modpage = $(".quick-mod");
$.each($modpage, (i,entry)=> {
var postid = Danbooru.meta('post-id');
$('#quick-mod-approve',entry).click((e)=>{Danbooru.Post.vote('up',postid)});
$('[href*=breaks_rules],[href*=poor_quality]',entry).click((e)=>{Danbooru.Post.vote('down',postid)});
});
I made a little script to hide the Curated pool navigation, and hide the entire pool navigation box if Curated is the only pool. Tested with both Chrome/Tampermonkey and Firefox/Violentmonkey.
EDIT: The previous version would hide the pools section if Curated was the only Collection type pool, but didn't check for Series pools or favgroups. This is now fixed.
// ==UserScript==
// @name Danbooru - hide Curated pool, hide pool section if only pool is Curated (JS only)
// @match *://*.donmai.us/posts/*
// @grant none
// @run-at document-idle
// @description Hide Curated pool navigation, hide pool section (box) if Curated is the only pool
// ==/UserScript==
(function(){
'use strict';
if (document.getElementById('nav-link-for-pool-12514')) {
var curatedPool = document.getElementById('nav-link-for-pool-12514');
curatedPool.style.display = 'none';
var favgroupNavExists = document.getElementById("favgroup-nav");
if ( (document.querySelectorAll('#pool-nav .pool-category-collection').length == 1) && (document.querySelectorAll('#pool-nav .pool-category-series').length == 0) && (!favgroupNavExists) ) {
var navLinks = document.getElementById('nav-links');
navLinks.style.display = 'none';
}
}
})();
Below is an alternate version that pairs with CSS that goes in Settings -> Advanced -> Custom CSS Style. This has the advantage of instantly hiding the Curated pool navigation, which is particularly nice when the post is in at least one other pool (Curated doesn't show up and then get hidden); if Curated is the only pool, a blank pool navigation box will show up briefly before being hidden.
CSS:
/* Hide Curated pool */
#nav-link-for-pool-12514{ display:none; }
Script:
// ==UserScript==
// @name Danbooru - hide pool section if only pool is Curated (pair with CSS)
// @match *://*.donmai.us/posts/*
// @grant none
// @run-at document-idle
// @description Hide Pool section (box) if Curated is the only pool
// ==/UserScript==
(function(){
'use strict';
var favgroupNavExists = document.getElementById("favgroup-nav");
if ((document.getElementById('nav-link-for-pool-12514')) && (document.querySelectorAll('#pool-nav .pool-category-collection').length == 1) && (document.querySelectorAll('#pool-nav .pool-category-series').length == 0) && (!favgroupNavExists) ) {
var navLinks = document.getElementById('nav-links');
navLinks.style.display = 'none';
}
})();
I've found a bug when I use both Note Assist and BBB. In add notes mode, clicking anywhere on the image, or in the note edit window, duplicates the note I created last. This doesn't happen when only one of those scripts is enabled.
Developed the following in response to the ongoing issues from topic #9127.
The following rewrites all image URLs to use the source domain you're on instead of danbooru.donmai.us, which should work for those having issues getting that domain to work.
// ==UserScript==
// @name RewriteDomainImages
// @version 1.4
// @description Corrects images to point to own domain
// @match *://*.donmai.us/*
// @exclude /^https?://\w+\.donmai\.us/.*\.(xml|json|atom)(\?|$)/
// @grant none
// @run-at document-end
// ==/UserScript==
const site_origin = new URL(window.location).origin;
$.each($("img"),(i,entry)=>{
var pathurl = new URL(entry.src);
if (pathurl.origin === 'https://danbooru.donmai.us') {
entry.src = site_origin + pathurl.pathname;
}
});
$.each($("#image-resize-link,#post-options [download]"),(i,entry)=>{
var pathurl = new URL(entry.href);
if (pathurl.origin === 'https://danbooru.donmai.us') {
entry.href = site_origin + pathurl.pathname;
}
});
Edit:
(2018-04-06)
Fixed issue when image URL was from Raikou1 or Raikou2
Developed the following in response to the ongoing issues from topic #9127.
You have my thanks BrokenEagle98!
This script partially fix the problem for me, so I still hope that issue #3603 will be fixed soon. I can see posts now, but if I click "view original" button, it will gone. Same with download button. If the image originally fits the window it will display properly. Also no thumbnails in mod queue.
This script partially fix the problem for me, so I still hope that issue #3603 will be fixed soon. I can see posts now, but if I click "view original" button, it will gone. Same with download button. If the image originally fits the window it will display properly. Also no thumbnails in mod queue.
@OniTea I believe I fixed those issues in Version 1.2 I just posted above (forum #144867). The size link still doesn't work, but that one becomes difficult to address without relying on element positions, which I typically don't like to do since it's fragile. If you still need it, you can replace the portion between the quotation marks...
Thank you for the fix. The only minor problem, preview images in Comments section still were not loading for me, but adding #c-comments img seems to solve this.
Thank you for the fix. The only minor problem, preview images in Comments section still were not loading for me, but adding #c-comments img seems to solve this.
A great point out. Though after I read that, I had an epiphany, in that all <img> links on Danbooru could be given the same treatment. That doesn't work so well on the second section though and <a> links, but oh well... :sigh:
I like the new fancy tooltips, but not all the time. With the default delay, they pop up way too quickly for my tastes; with a longer delay, I have to wait if I want to see them. This GreaseMonkey script makes the fancy tooltips pop up when right-clicking a thumbnail.
A simple right click loads the fancy tooltip. Shift + right click opens the usual context menu instead (tested in Firefox).
Disable post tooltips must be set to Yes in your account settings or they will pop up all over the place.
The browser’s standard tooltip will be disabled as well. (Remove line 24 if you want it.)
If you use TamperMonkey, you probably have to remove every unsafeWindow. from the script.
// ==UserScript==
// @name On-Demand Tooltips
// @description Show fancy tooltips when right-clicking a thumbnail.
// @match *://*.donmai.us/*
// @grant none
// @run-at document-idle
// ==/UserScript==
function showQtip(event) {
event.preventDefault();
var t = event.currentTarget;
unsafeWindow.$(t).qtip("enable");
unsafeWindow.$(t).qtip(unsafeWindow.Danbooru.PostTooltip.QTIP_OPTIONS, event);
}
if (unsafeWindow.Danbooru && unsafeWindow.Danbooru.PostTooltip) {
unsafeWindow.Danbooru.PostTooltip.QTIP_OPTIONS.show.event = "contextmenu";
unsafeWindow.Danbooru.PostTooltip.QTIP_OPTIONS.show.delay = 0;
var thumbs = document.querySelectorAll(unsafeWindow.Danbooru.PostTooltip.POST_SELECTOR);
for (i=0, l=thumbs.length; i<l; i++) {
var thumb = thumbs[i];
thumb.addEventListener('contextmenu', function (ev) {showQtip(ev);}, false);
thumb.removeAttribute("title"); // Remove standard tooltip
}
}
I like the new fancy tooltips, but not all the time. With the default delay, they pop up way too quickly for my tastes; with a longer delay, I have to wait if I want to see them. This GreaseMonkey script makes the fancy tooltips pop up when right-clicking a thumbnail.
A simple right click loads the fancy tooltip. Shift + right click opens the usual context menu instead (tested in Firefox).
Disable post tooltips must be set to Yes in your account settings or they will pop up all over the place.
The browser’s standard tooltip will be disabled as well. (Remove line 24 if you want it.)
If you use TamperMonkey, you probably have to remove every unsafeWindow. from the script.
// ==UserScript==
// @name On-Demand Tooltips
// @description Show fancy tooltips when right-clicking a thumbnail.
// @match *://*.donmai.us/*
// @grant none
// @run-at document-idle
// ==/UserScript==
function showQtip(event) {
event.preventDefault();
var t = event.currentTarget;
unsafeWindow.$(t).qtip("enable");
unsafeWindow.$(t).qtip(unsafeWindow.Danbooru.PostTooltip.QTIP_OPTIONS, event);
}
if (unsafeWindow.Danbooru && unsafeWindow.Danbooru.PostTooltip) {
unsafeWindow.Danbooru.PostTooltip.QTIP_OPTIONS.show.event = "contextmenu";
unsafeWindow.Danbooru.PostTooltip.QTIP_OPTIONS.show.delay = 0;
var thumbs = document.querySelectorAll(unsafeWindow.Danbooru.PostTooltip.POST_SELECTOR);
for (i=0, l=thumbs.length; i<l; i++) {
var thumb = thumbs[i];
thumb.addEventListener('contextmenu', function (ev) {showQtip(ev);}, false);
thumb.removeAttribute("title"); // Remove standard tooltip
}
}
This has stopped working for me the past week or so, it just defaults to popping up the standard tooltip. The bit of custom script from another thread to just increase the tooltip's popup time has also stopped working. I don't know if it's all just on my end of things or if it's because of some recent site changes..
This has stopped working for me the past week or so, it just defaults to popping up the standard tooltip. The bit of custom script from another thread to just increase the tooltip's popup time has also stopped working. I don't know if it's all just on my end of things or if it's because of some recent site changes..
It's because of issue #3795. Many user scripts that rely on Danbooru's Javascript were broken because of that. It hasn't been requested yet, but I'll leave a comment to have the PostToolTip module exported as well.
Any word on the status of issue#3795? Last update seems to have been about 5 days ago and Javascript for BetterBetterBooru is definitely still not working for me.
Any word on the status of issue#3795? Last update seems to have been about 5 days ago and Javascript for BetterBetterBooru is definitely still not working for me.
Do you have an example of where it does not work/what's broken of it? The script is working fine for me.
Do you have an example of where it does not work/what's broken of it? The script is working fine for me.
The tab for it hadn't been displaying on danbooru for a week where it would normally appear and endless pages and all of the features I normally use like the collapsible side bar just aren't working at all. Strangely this time I reinstalled the exact same version again and this time it worked. I guess everything has to be fine on both the sites code and the scripts code when you add it to tampermonkey in order for it to work properly. Thanks for the heads up that it should be working in any case.