Seedmanc / Booru-Augmentation-Project

Enhance your basic booru experience
11 stars 4 forks source link

Can you implement my fork? #1

Open ProximaNova opened 8 years ago

ProximaNova commented 8 years ago

At https://github.com/ProximaNova/Booru-Augmentation-Project

Also for Booru-mass-editor.user.js I've tried around 5 solid methods (from Firefox → edit userscript, not on Github) of submitting the form when enter is pressed in the textarea (like Moebooru does) and none have worked. Do you have any clue?

Seedmanc commented 8 years ago

I'm not quite sure what your script is supposed to do.

It doesn't look like a mass editor to me, since it's being run on single pages of images, once at a time. I have a feeling that my B.A.P already has the functionality of quick editing tags on the post pages.
After reading forum.booru.org I thought you were making stuff that would allow editing images on pages with the thumbnails, 20 at once.

As for the textarea, don't forget that after manipulations with innerHTML the event listeners are destroyed. Therefore, put your submit code after that bunch of replaces, and I'd go with something like

    var textarea = document.getElementById("tags");
    textarea.addEventListener('keydown', function(e) {
        if (e.keyCode == 13) { 
            textarea.up('table').down('input[type="submit"]').click();
        } 
    });

(this assumes prototype.js library is loaded, which I think is included in boorus anyway).

You seem to be making a lot of typos there, programming has zero tolerance for that. Especially in FF where you can't even debug userscripts.

ProximaNova commented 8 years ago

It is meant to improve the &id= interface to quickly tag individual images. And I have noticed that editing goes a lot faster when using it.

ProximaNova commented 8 years ago

Thanks, it only works if it's after the HTML modifications, example:

document.getElementById("tags").addEventListener("keydown", function(e) {
    if (e.keyCode == 13) { 
        document.getElementById("edit_form").style.backgroundColor = "green";
    }
});

fails before but works after. However,

document.getElementById("tags").addEventListener("keydown", function(e) {
    if (e.keyCode == 13) { 
        document.getElementById("edit_form").submit(); //OR document.forms[2].submit();
    }
});

fails for some reason.

ProximaNova commented 8 years ago

It works here though:

<textarea id="tags">a b c</textarea>

<form id="edit_form" action="form_action.asp">
</form>

<script>
document.getElementById("tags").addEventListener("keydown", function(e) {
    if (e.keyCode == 13) { 
        document.getElementById("edit_form").submit(); //OR document.forms[0].submit();
    }
});
</script>
Seedmanc commented 8 years ago

I dunno why the form is not being submitted, just click the submit button programmatically as I shown.

As for onload, I dunno, if you're adding event listeners before innerHTML changes they will get rekt, and if after maybe it's too late. Actually, I wouldn't be using the onload event at all, afaik it happens after all images have finished loading and there's really no need to wait for that unless you need image size or something. I usually put my stuff onDOMContentLoaded, or you can just add @run-at body to the header. Or like this document.addEventListener('DOMContentLoaded', onDOMContentLoaded, false); function onDOMContentLoaded() {do stuff;}

ProximaNova commented 8 years ago

It now works, I simulated a mouse click on the button and fixed the repetition problem; editing 20 at once is now very possible! Also as far as I've read I can't get an image's file size with JavaScript.

You should add the tag history script I wrote. It practically does everything needed except display the tag(s) subtracted. I don't know why the methods I used to display them failed; it is strange. Also it is in this regard (among others such as displaying the number of tags at the &id= pages) better than Gelbooru, for my script for the tag history display shows the proper color for subtraction, addition, and no change in tag quantity:

-quantity: http://gelbooru.com/index.php?page=history&type=tag_history&id=3106916 (should be red) +quantity: http://gelbooru.com/index.php?page=history&type=tag_history&id=3106736 (should be green) no change of quantity: http://gelbooru.com/index.php?page=history&type=tag_history&id=3098750 (should be white or grey)

(The ability to hide and display columns like Danbooru software does should be actualized along with colored tags having the right color when hovered over.)

Also implement: alias list improvement (needs tag coloring though).

The post list script doesn't do anything; I wonder why, for it seems correct. Possible future of it: tag coloring, tag wiki (Google) links, links go to section #image (at <img id="image"...> at &id= pages), image border if child or parent post which requires the &id= pages to be read (see: https://github.com/ProximaNova/Booru-mass-editor/issues/11), etc.

ProximaNova commented 8 years ago

I've been running your script along with mine which sort of works but could work better. It would be a great improvement if they both worked at once.

For &id= pages your script does:

My script does a bunch of other stuff at &id= but when running along with your's your's becomes visible yet inoperable, and mine has some feature that still work, others that sort of work, and others that do not work.

Seedmanc commented 8 years ago

On your first post:

I implemented the tag history script, works good enough for me.

Dunno what you mean by column hiding, probably something redundant.

Colors are the domain of your script, I don't plan on introducing them, at least the way you do. Perhaps I'll go with assigning categories to tags like I did in my tumblr addon.

Added alias script as well.

I don't understand what the post script is supposed to do and where, be verbose. Google links are already implemented on the list page. There's no place for them on the post page, the ajax editor is more important.

On your second, good job on auditing compatibility.

What do you mean by queue? I don't understand.
"My tags" can be changed in user settings. If I wanted to manually type in mytags on the post page I might as well type in the post tags themselves instead, no improvement here.

I fixed the dropdown in FF. FF is insane once again.

Added link to Anonymous in statistics area.

I'll think about improving compatibility, but it might be difficult because our script change same elements in different ways.