ProximaNova / Booru-mass-editor

Quickly edit images at websites running Gelbooru Beta 0.1.11 (such as http://booru.org)
7 stars 2 forks source link

Danbooru support #19

Open ProximaNova opened 8 years ago

ProximaNova commented 8 years ago

Wiki page on tag script: https://danbooru.donmai.us/wiki_pages/5646

Tag script mode is not available for the average user so I made a dirty fix for mass tagging (I'll integrate this later):

if (window.location.href.match(/posts\/\d+/g) && window.location.href.match(/danbooru\.donmai\.us/g)) {
    // Somehow fails: document.getElementById("edit").style.display = "block";

    var MyTags = document.cookie.replace(/.*favorite_tags=/g, "").replace(/;.*/g, "");

    var check = new RegExp(MyTags, 'g');

    if (!(document.getElementById("post_tag_string").value.match(check))) {
        document.getElementById("post_tag_string").value = document.getElementById("post_tag_string").value + MyTags + " ";
    }

    document.getElementsByTagName("input")[46].setAttribute("id", "SubmitButton");
    document.getElementById("SubmitButton").style.width = "403px";
    document.getElementById("SubmitButton").style.height = "100px";
    document.getElementById("SubmitButton").style.fontSize = "20pt";

    function htmlDecode(input){
        var e = document.createElement('span');
        e.innerHTML = input;
        return e.childNodes[0].nodeValue;
    }

    function simulateClickSubmit(element)
    {
        var oEvent = document.createEvent('MouseEvents');
        oEvent.initMouseEvent("click", true, true, document.defaultView,
        0, 0, 0, 0, 0, false, false, false, false, 0, element);
        element.dispatchEvent(oEvent);
    }

    if (htmlDecode(document.getElementById("post_tag_string").innerHTML) !== document.getElementById("post_tag_string").value) {
        simulateClickSubmit(document.getElementById("SubmitButton"));
    }

    window.addEventListener("load", function() {
        window.close();
    });
}

Go to My Account ---> Settings ---> Advanced settings ---> Frequent tags: single tag to add; custom CSS: #edit { display: block; }

I added the above code.

email at xbooru:

I updated it by adding the code I used to edit this booru and others; it now works here.
<ol><li>Add it to Greasemonkey
</li><li>Add to Options &#8594; My Tags:
<ul><li>to replace (search: almost_nake* if almost_naked was aliased to almost_nude):
<ul><li>re:almost_naked_>_almost_nude;re;
<ul><li>multiple (separate with "|"): re:asshole_>_anus|blowjob_>_fellatio|balls_>_testicles;re;
</li></ul></li></ul></li></ul><ul><li>to add (search: tagme -simple_background -animated):
<ul><li>re:big_butt_>_big_ass;re; add:simple_background;add;
<ul><li>multiple: add:animated|animated_gif;add;
</li></ul></li></ul></li></ul><ul><li>to implicate (search: translation_request_>_text):
<ul><li>re:cum_on_butt_>_cum_on_ass;re; add:most_body;add; im:translation_request_>_text;im;
<ul><li>multiple: im:fellatio_>_oral|dickgirl_>_intersex|cuntboy_>_intersex;im;
</li></ul></li></ul></li></ul><ul><li>to load tab, submit, then close as fast as possible:
<ul><li>re:hand_on_butt_>_hand_on_ass;re; op:onload;op;
</li></ul></li></ul><ul><li>to remove the tagme tag if the tag count is 10 or more:
<ul><li>im:greyscale_>_monochrome;im; tagmeif:lt10;endif;
</li></ul></li></ul><ul><li>might not work, removes tags:
<ul><li>im:white_background_>_simple_background;im; rm:invalid_tag;rm;
</li></ul></li></ul><ul><li>sort of works, changes rating (search: penis rating:safe):
<ul><li>im:multiple_penises_>_penis;im; r:e;r;</li></ul></li></ul></ol>
(I always add at least 1 tag when mass editing.)

In addition, I use (for Firefox): https://addons.mozilla.org/en-US/firefox/addon/image-block/ + https://addons.mozilla.or...addon/load-tab-on-select/ + https://www.apachefriends.org/download.html (XAMPP for PHP for GetIDs.php) + https://addons.mozilla.or...efox/addon/snaplinksplus/

Also I sort of wish I was not entirely banned from http://rule34.xxx -- I wish I was only banned from uploading. However, I sort of like that I am banned because I now don't have to really worry about the tags and images there.

I am going to remove the tags "sexy" and "beautiful" from this booru because those tags are implicit to all images here.