tag:danbooru.me,2005:/forum_topics/14474 [Userscript] ValidateTagInput 2019-12-26T17:22:51-05:00 tag:danbooru.me,2005:ForumPost/161895 2019-12-26T17:21:59-05:00 2019-12-26T17:21:59-05:00 @BrokenEagle98: Pushed Version 28 which primarily includes an... <p>Pushed <strong>Version 28</strong> which primarily includes an update to the library code plus a few additions and fixes:</p><ul> <li><strong>Additions</strong></li> <ul> <li>Add new menu library elements/functions for cache editor</li> <ul> <li>The raw program data can be extracted using the cache editor, which facilitates transferring program data to another browser/domain</li> <li>Controls which are not applicable are hidden, for example <strong>Local storage</strong> must be selected before the raw data option becomes visible</li> </ul> </ul> <li><strong>Changes</strong></li> <ul><li>Settings menu now adapts to the color changes of the chosen theme (light/dark)</li></ul> <li><strong>Fixes</strong></li> <ul> <li>Fix issue on Firefox where the tags aren't reset on a page refresh</li> <li>Fix auto-implications not being accounted for with the quick edit function on the post index</li> </ul> <li><strong>Other</strong></li> <ul><li>Multiple internal code changes and refactors</li></ul> </ul> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/154716 2019-02-13T21:14:46-05:00 2019-05-29T21:30:24-04:00 @BrokenEagle98: Pushed Version 27 which primarily integrates... <p>Pushed <strong>Version 27</strong> which primarily integrates the new library code that was finalized today. This is coming out as a major version since a large majority of the code was changed while updating to the new library version and standardizing all of the affected userscripts.</p><p>Additionally, all of the menus were standardized, and fully working cache editors were incorporated. Also, a new control was added under cache settings which shows the size of all the userscript data amongst all of the various data storage.</p><p>Besides the above, the Artist validator was fixed so that the "Create new artist entry" link on existing artist tags would incorporate the tag name into the new artist entry.</p><h6>Minor versions</h6><ul> <li>(2019-01-30)</li> <ul> <li><strong>27.1</strong></li> <ul> <li>Account for auto-implications in tag removal validation</li> <li>This includes the *_school_uniform and *_(cosplay) tags</li> </ul> </ul> <li>(2019-05-11)</li> <ul> <li><strong>27.2</strong></li> <ul> <li>Make use of "only" parameter</li> <li>Increase implication limit to 200</li> <ul> <li>Since current max is 90</li> <li>Not including <a class="dtext-link dtext-wiki-link tag-type-1" href="/artists/show_or_new?name=banned_artist">banned artist</a> </li> </ul> </ul> </ul> <li>(2019-05-19)</li> <ul><li> <strong>27.3</strong> - Fix network function not working without ID</li></ul> <li>(2019-05-29)</li> <ul><li> <strong>27.4</strong> - Only check nonexistant tags for aliases</li></ul> </ul> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/154321 2019-01-31T02:13:40-05:00 2019-01-31T02:13:40-05:00 @BrokenEagle98: > worldendDominator said: > > Turns out it was... <blockquote> <p>worldendDominator said:</p> <p>Turns out it was some weird interaction with Better Better Booru. I guess I'll just disable those warning for now.</p> </blockquote><p>Ah okay, thanks for the information. I'll try to debug the script with Better Better Booru in the next week or so to see if I can replicate and get around those issues.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/154319 2019-01-31T02:03:12-05:00 2019-01-31T02:03:12-05:00 @worldendDominator: Turns out it was some weird interaction with... <p>Turns out it was some weird interaction with Better Better Booru. I guess I'll just disable those warning for now.</p> worldendDominator /users/406536 tag:danbooru.me,2005:ForumPost/154317 2019-01-31T00:02:09-05:00 2019-01-31T00:02:09-05:00 @BrokenEagle98: > worldendDominator said: > > (Moving from my... <blockquote> <p>worldendDominator said:</p> <p>(Moving from my report in site issues thread)</p> <p>I opened a few random posts from my userpage, and they all got warnings.</p> <p><a class="dtext-link dtext-id-link dtext-post-id-link" href="/posts/3400296">post #3400296</a> - all 3 (gentags, copyright, artist)<br><a class="dtext-link dtext-id-link dtext-post-id-link" href="/posts/3400263">post #3400263</a> - copyright and artist<br><a class="dtext-link dtext-id-link dtext-post-id-link" href="/posts/3398804">post #3398804</a> - artist<br><a class="dtext-link dtext-id-link dtext-post-id-link" href="/posts/3231136">post #3231136</a> - copyright and artist<br><a class="dtext-link dtext-id-link dtext-post-id-link" href="/posts/3398653">post #3398653</a> - all 3<br><a class="dtext-link dtext-id-link dtext-post-id-link" href="/posts/3369437">post #3369437</a> - copyright and tags</p> <p>Gentags warning seems to work correctly, but other 2 are broken.</p> </blockquote><p>The only warnings I got were on <a class="dtext-link dtext-id-link dtext-post-id-link" href="/posts/3400296">post #3400296</a>, <a class="dtext-link dtext-id-link dtext-post-id-link" href="/posts/3398653">post #3398653</a>, <a class="dtext-link dtext-id-link dtext-post-id-link" href="/posts/3369437">post #3369437</a>, and only the general tags warning since they all have less than 30 general tags.</p><p>I tested it out on both Chrome and Firefox, and got the same with both browsers. I did find an issue which caused the Artist validator to fail on Firefox that I fixed in <strong>Version 26.2</strong>, but that wouldn't cause the notice to be fired like you're showing.</p><p>Which browser are you using? Also, what other user scripts are you running? There may be a conflict.</p><p>One thing you can do is turn on debug statements and see what shows up in the development console (F12). This can be done by altering one of the first lines in the script to change the value from <code>false</code> to <code>true</code>.</p><pre>JSPLib.debug.debug_console = true; </pre><p>I just thought of this, but another issue could be that certain elements aren't available for whatever reason when the script is run.</p><p>For the copyright validator, you can run the following in the development console on the post page and see what it says.</p><pre>$(".copyright-tag-list .category-3 .wiki-link").length </pre><p>For the artist validator, you can do the same with the following.</p><pre>$(".artist-tag-list .category-1 .wiki-link").map((i,entry)=&gt;{return decodeURI(entry.search.split("=")[1]);}).toArray(); </pre><p>Also, when you're getting the artist validation warnings, which ones are you actually getting. Same for the copyright warnings.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/154316 2019-01-30T23:08:23-05:00 2019-01-30T23:08:23-05:00 @worldendDominator: (Moving from my report in site issues thread) ... <p>(Moving from my report in site issues thread)</p><p>I opened a few random posts from my userpage, and they all got warnings.</p><p><a class="dtext-link dtext-id-link dtext-post-id-link" href="/posts/3400296">post #3400296</a> - all 3 (gentags, copyright, artist)<br><a class="dtext-link dtext-id-link dtext-post-id-link" href="/posts/3400263">post #3400263</a> - copyright and artist<br><a class="dtext-link dtext-id-link dtext-post-id-link" href="/posts/3398804">post #3398804</a> - artist<br><a class="dtext-link dtext-id-link dtext-post-id-link" href="/posts/3231136">post #3231136</a> - copyright and artist<br><a class="dtext-link dtext-id-link dtext-post-id-link" href="/posts/3398653">post #3398653</a> - all 3<br><a class="dtext-link dtext-id-link dtext-post-id-link" href="/posts/3369437">post #3369437</a> - copyright and tags</p><p>Gentags warning seems to work correctly, but other 2 are broken.</p> worldendDominator /users/406536 tag:danbooru.me,2005:ForumPost/154285 2019-01-29T15:54:41-05:00 2019-02-01T12:07:58-05:00 @BrokenEagle98: Pushed Version 26 which adds a bunch of new... <p>Pushed <strong>Version 26</strong> which adds a bunch of new validations on post loads, many of which are already used by Danbooru after creating a new post. Warning messages are setup to occur at most once per post per tab session, although this can be changed in user settings.</p><p>Besides that, the cache editor added can now edit program data. This makes it possible to transfer settings around.</p><h5>New validators</h5><ul> <li><strong>Artist validator</strong></li> <ul> <li>Posts without an artist tag</li> <ul> <li>Posts with <a class="dtext-link dtext-wiki-link tag-type-5" href="/wiki_pages/official_art">official art</a> are ignored</li> <li>Posts from a first-party source (Pixiv, Twitter) get a warning</li> <li>Posts without <a class="dtext-link dtext-wiki-link tag-type-5" href="/wiki_pages/artist_request">artist request</a> get an additional add-on warning</li> <li>Posts with an available artist tag to add get a warning</li> </ul> <li>Posts with an artist tag</li> <ul><li>Artists that have no artist entry get a warning</li></ul> </ul> <li><strong>Copyright validator</strong></li> <ul><li>Posts without any copyright tag or the <a class="dtext-link dtext-wiki-link tag-type-5" href="/wiki_pages/copyright_request">copyright request</a> tag get a warning</li></ul> <li><strong>General validator</strong></li> <ul> <li>Posts without a certain level of general tags get a warning</li> <li>There are 3 levels with different warning messages</li> <li>The thresholds for those levels can be configured in user settings</li> </ul> </ul><h5>Other new items</h5><ul> <li>Added the cache editor being prototyping (<a class="dtext-link dtext-id-link dtext-forum-post-id-link" href="/forum_posts/154196">forum #154196</a>, <a class="dtext-link dtext-id-link dtext-forum-post-id-link" href="/forum_posts/154240">forum #154240</a>)</li> <ul> <li>It can now edit Program Data the same as Cache Data</li> <li>User settings can now be copied from one browser/machine to another</li> <li>Changes to user settings are immediately reflected on the settings page</li> </ul> </ul><h6>Minor versions</h6><ul> <li>(2019-01-30)</li> <ul> <li> <strong>26.1</strong> - Fixed issue with program data validator</li> <li> <strong>26.2</strong> - Fixed issue with unavailable flat function in Firefox</li> </ul> <li>(2019-01-31)</li> <ul><li> <strong>26.3</strong> - Added caching to artist data</li></ul> <li>(2019-02-01)</li> <ul><li> <strong>26.4</strong> - Fixed issue with artist name parser</li></ul> </ul> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/150094 2018-09-04T21:26:39-04:00 2019-01-03T18:07:05-05:00 @BrokenEagle98: Pushed Version 25 which adds a settings menu... <p>Pushed <strong>Version 25</strong> which adds a settings menu available on the same page as the Danbooru settings (<strong>My Account</strong> &gt;&gt; <strong>Settings</strong>) under <strong>Userscript Menus</strong>. The specific settings for this script are under the tab <em>ValidateTaginput</em>. The settings "should" instantly reflect in all other open tags with the latest version of the script running.</p><h6>Minor versions</h6><ul> <li>(2018-09-09)</li> <ul> <li> <strong>25.1</strong> - Updated to use newest library (Version 5)</li> <ul> <li>Added the rating validation back in as optional (including source validation)</li> <li>Several code fixes/refactors</li> </ul> <li> <strong>25.2</strong> - Fixed factory reset broadcast</li> <li> <strong>25.3</strong> - Fixed not removing typetags from consideration</li> </ul> <li>(2018-12-31)</li> <ul><li> <strong>25.4</strong> - Fixed incorrect pruning parameter.</li></ul> <li>(2019-01-03)</li> <ul> <li> <strong>25.5</strong> </li> <ul> <li>Updated library version</li> <ul><li>~30% reduction in code size</li></ul> <li>Refactored code to standard</li> </ul> </ul> </ul> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/147558 2018-06-04T16:35:11-04:00 2018-08-04T10:23:56-04:00 @BrokenEagle98: Pushed Version 24 which had a major code... <p>Pushed <strong>Version 24</strong> which had a major code refactor, but function-wise it also adds a <strong>Check</strong> button that will check the tags but not submit them. The reason I added this is because I have encountered at least several times where I was batch uploading images as quickly as possible to try to maintain continuity, and the validation check would sometimes halt the uploading process. Besides that use case, one might also want to check the tags as they're going along instead of at the very end.</p><p>As a side note, the clear cache option has been removed for now (user settings), as I want to have a solution which can accommodate all of my scripts.</p><ul> <li>Minor versions</li> <ul> <li>(2018-07-23)</li> <ul> <li><strong>24.1</strong></li> <ul><li>Updated to use newest library (Version 4)</li></ul> </ul> <li>(2018-08-02)</li> <ul> <li><strong>24.2</strong></li> <ul> <li>Add more variable specifications</li> <ul><li>Mostly disabled script due to <a rel="external nofollow noreferrer" class="dtext-link dtext-id-link dtext-github-id-link" href="https://github.com/r888888888/danbooru/issues/3795">issue #3795</a> </li></ul> <li>Turn off debug messages by default</li> </ul> </ul> <li>(2018-08-03)</li> <ul> <li><strong>24.3</strong></li> <ul><li>Converted script to use available functions instead</li></ul> </ul> </ul> </ul> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/141966 2018-01-14T01:23:58-05:00 2018-01-14T01:23:58-05:00 @BrokenEagle98: Pushed Version 23 which adds in a full... <p>Pushed <strong>Version 23</strong> which adds in a full client-side data validation.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/139601 2017-11-21T22:27:38-05:00 2017-11-21T22:27:38-05:00 @BrokenEagle98: Pushed Version 22 which removes the rating... <p>Pushed <strong>Version 22</strong> which removes the rating existence validator. This was done in response to <a rel="external nofollow noreferrer" class="dtext-link dtext-id-link dtext-github-id-link" href="https://github.com/r888888888/danbooru/issues/3362">issue #3362</a> being merged and deployed. So the check still exists, but now it's being done by Danbooru. Additionally, that check also does the file/source existence validations as well.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/139516 2017-11-19T18:59:02-05:00 2017-11-21T22:28:11-05:00 @BrokenEagle98: Pushed Version 21 fixing a bug pointed out by... <p>Pushed <strong>Version 21</strong> fixing a bug pointed out by evazion on Discord, which affected the post index page for Member-level users and those not logged in as Anonymous.</p><h5>Edit:</h5><p>Pushed a minor update to this version.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/139447 2017-11-18T14:09:29-05:00 2017-11-18T14:56:34-05:00 @BrokenEagle98: Pushed Version 20 primarily since it fixes a... <p>Pushed <strong>Version 20</strong> primarily since it fixes a bug in the data model check. The rating existence validator has also been modified to check for the rating in the tag box.</p><h5>Edit:</h5><p>Pushed a minor update to this version.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/139119 2017-11-13T19:37:31-05:00 2017-11-13T19:37:31-05:00 @BrokenEagle98: Pushed Version 19 to account for the new Meta... <p>Pushed <strong>Version 19</strong> to account for the new <strong>Meta</strong> tag category.</p><p>As an update, <a rel="external nofollow noreferrer" class="dtext-link dtext-id-link dtext-github-id-link" href="https://github.com/r888888888/danbooru/issues/3352">issue #3352</a> was submitted to make these validations baseline, and two fixes have already been submitted (<a rel="external nofollow noreferrer" class="dtext-link dtext-id-link dtext-github-id-link" href="https://github.com/r888888888/danbooru/issues/3357">issue #3357</a>, <a rel="external nofollow noreferrer" class="dtext-link dtext-id-link dtext-github-id-link" href="https://github.com/r888888888/danbooru/issues/3362">issue #3362</a>). These two add in the Tag Add validator and the Rating Exists validator, although with the former it set to notify the user after the post save for now. If needed, it may be moved to before the post save as it is with the ValidateTagInput user script.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/138031 2017-10-22T14:17:40-04:00 2017-10-22T14:17:40-04:00 @BrokenEagle98: Pushed a minor update with Version 18, mostly... <p>Pushed a minor update with <strong>Version 18</strong>, mostly due to a minor bug found that prevented the local storage pruner from working on data stored with Versions 16 and prior. Besides the above, the debug statements and code are now conditionally run. The performance increase for this would be minor, however it also reduces the clutter in the debug console for when the script is not being tested.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/137917 2017-10-21T14:59:38-04:00 2017-10-21T14:59:38-04:00 @BrokenEagle98: Pushed Version 17 which includes a migration to... <p>Pushed <strong>Version 17</strong> which includes a migration to using IndexedDB when possible for storing data.</p><p>This change is related to <a rel="external nofollow noreferrer" class="dtext-link dtext-id-link dtext-github-id-link" href="https://github.com/r888888888/danbooru/issues/3335">issue #3335</a>, when it became apparent that there was a contention for LocalStorage space between Danbooru's autocomplete and the tag validator. Danbooru currently uses a maximum cap of 2.5M characters tailored to the lowest capable browsers out there. After this limit is reached, it prunes all of the values and starts from scratch. As the tag validator's storage needs grow over time as well, this would likely cause more and more pruning actions from Danbooru.</p><p>To deal with this, the tag validator's storage is being migrated to IndexedDB where possible, and when not possible it limits the tag validators data to no more than 1M characters, doing a pruning action similar to Danbooru when it reaches that size. When using IndexedDB, it makes use of the mostly unused SessionStorage, which is pretty much LocalStorage but limited to a single tab.</p><p>For those interested in the performance tradeoffs between IndexedDB and LocalStorage, the following are an example of numbers seen when looking at the performance metrics on one of my slower systems. Also, although it says SessionStorage, the numbers seen for LocalStorage were pretty much equivalent.</p><table class="striped"> <thead><tr> <th>Name</th> <th>Number of Requests</th> <th>Average Time (ms)</th> <th>Outliers Removed</th> </tr></thead> <tr> <td>SessionStorage</td> <td>36</td> <td>0.38</td> <td>2</td> </tr> <tr> <td>IndexedDB</td> <td>28</td> <td>58</td> <td>10</td> </tr> <tr> <td>Network</td> <td>22</td> <td>432.37</td> <td>6</td> </tr> <tbody></tbody> </table> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/137680 2017-10-16T22:21:12-04:00 2017-10-16T22:30:11-04:00 @BrokenEagle98: Pushed Version 16 which adds a Reset cached... <p>Pushed <strong>Version 16</strong> which adds a <em>Reset cached data</em> link to user settings (under <strong>Basic Settings</strong>). This will delete all of the data being stored by the tag validator as well as autocomplete. </p><p>The reason to do this for either is if there are new approved aliases or implications that aren't being accounted for in either the autocomplete or the tag validator.</p><p>Another reason for autocomplete is after the populating of a new tag. Autocomplete will store the first value it gets, which for a new tag will most likely be a count of 1. This will make it unlikely that the tag will show up in autocomplete until those values expire (1 week).</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/137548 2017-10-13T20:47:19-04:00 2017-10-13T20:47:19-04:00 @BrokenEagle98: Pushed Version 15 which adds the tag validation... <p>Pushed <strong>Version 15</strong> which adds the tag validation to the quick edit mode, which is a mode accessible to Gold+ users from the post index page.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/137448 2017-10-10T21:30:50-04:00 2017-10-10T21:30:50-04:00 @BrokenEagle98: Pushed Version 14 which has no new external... <p>Pushed <strong>Version 14</strong> which has no new external features, but which changed how data was stored and also added a validator for that stored data, which will keep bad stored data from causing script errors, as well as facilitating changes to the data model in the future.</p> BrokenEagle98 /users/23799 tag:danbooru.me,2005:ForumPost/137234 2017-10-09T00:40:12-04:00 2017-10-09T00:40:12-04:00 @BrokenEagle98: Pushed Version 13 which adds a check rating... <p>Pushed <strong>Version 13</strong> which adds a check rating validator.</p><p>It basically does the same thing that Danbooru does when you don't enter a rating after submitting an upload, but in contrast it doesn't reload the page and thus remove the image preview from view.</p><p>This came about from the multitude of times that I accidentally submitted an image and then had to deal with not having the image preview anymore. There are ways to deal with that, the primary being to just submit the image with the tags as is and then finish tagging the post upon upload completion. With the update though, the script will stop you from reaching that state unless you check the <strong>Skip validation</strong> while keeping the rating empty.</p> BrokenEagle98 /users/23799