Danbooru

Read the rules before proceeding!

Topic: DanbooruUp, tag completion for Firefox, Chrome, Opera

Posted under General

Log

This isn't really a high priority feature but any chance of custom tagtype support? 3db has photoset/model, moe.imouto has some too I'm sure but I didn't see any easy way to add them.

  • ID: 44549
  • Permalink
  • Bapabooiee

    Little late here, but I think I found a way to work-around Chrome's 5MB database quota issue, so that you don't have to manually download & run a separate script to increase that limit.

    If you package DanbooruUp from a user script, and into a Chrome extension, you can add a field called 'unlimited_storage' to the 'permissions' section in its Manifest file. It'll do exactly what it says on the tin, and anyone who wants to install the extension will be able to skip the step of having to increase the quota manually.

  • ID: 45452
  • Permalink
  • zatchii

    Aye, that is possible, but it would require a new completion back end, which is a fair bit of work for something that will be obsolete soon when they hopefully implement proper quota management.

    Specifically, the popup code needs to run in the page's untrusted context, while the database access must be done from the plugin's trusted context to get the unlimited storage.

  • ID: 45549
  • Permalink
  • Mr GT

    How does one manually increase the quota limit on Chrome anyway? Never used DanbooruUp before so I don't know how it would work when it comes to uploading from URL.

  • ID: 46739
  • Permalink
  • Bapabooiee

    And if you don't want to use the sqlite3 CLI tool (or just aren't experienced with the command-line), you can also use the GUI tool Sqlitebrowser.

    But ideally, most people would just want to use the script(s) zatchii's bundled-up to increase the database Quota for Chrome. There's a link to the Zip file in the OP, under the Chrome section.

  • ID: 47191
  • Permalink
  • jjj14

    I'm having weird issues with the tag autocomplete. It kept bringing up typo tags that are not used on any posts like "brown_hairnipples" and stuff, so I updated the tags and it was still doing that, so I did "clear tags" and then "update now" and it acted up. Like it was updating tags for the longest time and it brought up an error that was something like "script is running in endless loop" (I didn't read it really carefully) and my browser crashed. So I restarted Firefox and went to update the tags again and when I clicked "Update Now" it gave me this:

    DanbooruUp Exception:
    [Exception... "'[object Object]' when calling method: [danbooruITagHistoryService::updateTagListFromURI]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "JS frame :: file:///C:/Documents%20and%20Settings/user/Application%20Data/Mozilla/Firefox/Profiles/o1pn38px.default/extensions/%7B7209145A-6A2A-42C1-99EB-4DE7293990E1%7D/components/danbooruUpHelper.js :: anonymous :: line 206" data: no]

    So I clicked "OK" on that box and it goes to the updating tags thing and stays there forever. Meanwhile I'm trying to use the autocomplete and now it won't bring up tags that I know exist. Like I'll type "yasak" to try to get "yasaka_kanako" and it does this and typing "monoc" to try to get "monochrome" gets me this. ("Monochorome" and "Monochromes" but not "Monochrome"?)

    I'm going to try uninstalling and reinstalling the extension and see if that fixes it.

    Edit: All right, uninstalling/reinstalling seems to have worked.

    Updated by jjj14

  • ID: 52107
  • Permalink
  • HNTI

    I don't know why, but I have feeling that it might be related to new manga mode feature and plug-in wasn't able to prevent me from uploading exactly the same pic :

    post #641672
    post #801743

    Their resolutions are the same, except their file sizes. I don't know on what base plug-in decide if the same pic is in the databae or not.

  • ID: 52263
  • Permalink
  • zatchii

    HNTI said:
    ...

    The plug-in just checks Danbooru for a file with the same MD5, so it won't detect a duplicate unless it's the exact same file. Here the artist uploaded a slightly different file, so the duplicate detection fails.

    jjj14 said:
    ...

    Thanks for your report. Clearing and updating is the only way to remove dead tags, yes.
    I'm not sure what could have gone wrong with the updating, but the error message you got is a fixable bug, at least.

    I've started work on Firefox 4 compatibility, and will probably find time to release a new version some time during Christmas. The new version will also support custom tag types and uploading via URL.

  • ID: 52273
  • Permalink
  • HNTI

    Is there any chance to implement some kind of comparing pictures system like we had in the menu to uploading pics ? And it would write us communicate if the pic uploaded and in the database would be, let's say more than 90 %, similar. maybe there's some "API" to that searching comparing pics engine, isn't it ?

  • ID: 52276
  • Permalink
  • rantuyetmai

    Don't know if it's feasible, but I wish there's a space to enter parent post ID in DanbooruUp.

  • ID: 52902
  • Permalink
  • petopeto

    There's an incompatibility over at moe: editing posts with the tag autocomplete submits when enter is pressed.

    It looks like this is from site_injection/attacher.js: it tries to intercept the form submission by monkey patching the form's submit method. That's not working anymore, since we're now firing submission by generating a real submit event, in order to make sure various other event listeners are run.

    I threw together a quick patch to show a better way to do this using event capture, which is designed for this sort of broad overriding of elements. Key notes:

    - Set addEventListener's useCapture parameter to true.
    - The listener must be on a parent of the target element, not the element itself. Otherwise, you'll get the event during the AT_TARGET phase instead of the capturing phase, which is too late for cancellation to prevent other listeners at that phase from receiving the event.
    - Check event.originalTarget to see if the event is going to what you actually want to take over events for. (In general, this should also check if it's any of its child nodes, but it's a TEXTAREA which can't have children.)
    - The event must be cancelled during onkeydown, to prevent both keydown and keypress; if you only cancel during keypress the keydown event has already been sent. (I'm not sure why the logic is split between keydown and keypress.)

    This code is only tested lightly (as I don't use it myself) and isn't tested here on Danbooru, since the failure mode was submitting unwanted changes (which I don't want to happen here), but it should be a start. inhibitForm and probably AutoCompleter#onEnter can be removed.

    http://pastebin.com/rGEVFiDA

  • ID: 52909
  • Permalink
  • zatchii

    petopeto said:
    ...

    D'oh, never thought about capturing on the parent element. My event-flow-fu is weak!
    Thank you, I'll see what I can do.

  • ID: 52913
  • Permalink
  • petopeto

    Someone noted that this change breaks the completion where it's used during uploading (I only tested the page injection version). FYI.

  • ID: 52924
  • Permalink
  • fireattack

    I think I should mention that petopeto's change will make you can't move input cursor down (it will show the tag-select-menu).

  • ID: 52928
  • Permalink
  • Log

    Oh right bug report I've been meaning to point out for a while now: the autocomplete in the alias/implication form (not the thread creation one) adds a space at the end which breaks the alias if you're not watching out for it.

  • ID: 52973
  • Permalink
  • fireattack

    Log said:
    Oh right bug report I've been meaning to point out for a while now: the autocomplete in the alias/implication form (not the thread creation one) adds a space at the end which breaks the alias if you're not watching out for it.

    I knew this bug, but it seems have been fixed before..do you use the newest version?

  • ID: 52981
  • Permalink
  • Log

    Apparently I was not, patching without a version number change how shameful.

  • ID: 52983
  • Permalink
  • zatchii

    rantuyetmai said:
    Don't know if it's feasible, but I wish there's a space to enter parent post ID in DanbooruUp.

    You can tag an image parent:123 when uploading.

  • ID: 53761
  • Permalink
  • zatchii

    New version 0.3.8 released. Tell your friends! :p

    Adds:

    • Firefox 4 compatibility
    • Option to download image from source instead of uploading from local copy.
    • Extra tag types for other boorus.
    • Packaged as extensions for Chrome and Opera to ease installation and circumvent the quota issue.
    • "Upload to Danbooru" context menu option in Chrome.
    • Some minor bugfixes

    I had to disable threading in Firefox 4, so the GUI might be a tiny bit more sluggish.

    The site autocompletion doesn't get along with *.imouto.org built-in autocompleter, so you'll probably want to disable the site injection if you're using it there.

  • ID: 53762
  • Permalink