tag:danbooru.me,2005:/forum_topics/9373 Note Assist, automatic note generation & resize. 2015-07-09T18:25:04-04:00 tag:danbooru.me,2005:ForumPost/104825 2015-05-15T15:49:31-04:00 2015-07-09T18:25:45-04:00 @itsonlyaname: Update! Changelog: New feature: Ctrl-click* a... <p>Update!</p><p>Changelog:</p><p>New feature: Ctrl-click* a existing note to resize it (per type-kun's idea)</p><p>- Most of the logic &amp; code re-written so people can actually read what is happening.<br>- Accuracy in detecting text remains about the same, I've pretty much hit a dead end trying to improve it.<br>- speed increase on everything!<br>- memory usage remains the same<br>- moved script objects to it's own namespace, improves cross-browser support &amp; maintainability.<br>- much less likely to break when danbooru updates</p><p>*Can be bound to shift- or ctrl-shift-click</p><p>And since it's on git now, anyone is free to create issues / pull requests :)</p><p>Edit;<br>2015-07-10 - v1.1: <br>- New button: "save all non-ghost notes" to make it easier to reposition a lot of notes. <br>- Notes resized by the script now are properly marked as "unsaved"</p> itsonlyaname /users/366769 tag:danbooru.me,2005:ForumPost/104141 2015-04-07T15:17:40-04:00 2015-04-11T10:13:44-04:00 @itsonlyaname: I'm still here :p Moved to git. So, it's been... <p>I'm still here :p</p><p>Moved to git.<br>So, it's been about 2 years since the code has been touched. Perhaps it's time for some code cleanup, if i changed it a bit so it doesn't use so much hard-coding anymore, it could be quite useful for any text-detection application.<br>It's vacation right now, so i might be able to work on it for a bit :)<br>Edit, there's a lot more code than i remember (2000 lines), working on it slowly but surely.</p> itsonlyaname /users/366769 tag:danbooru.me,2005:ForumPost/104140 2015-04-07T14:50:47-04:00 2015-04-07T14:50:47-04:00 @Type-kun: This script shouldn't die. With some polishing,... <p>This script shouldn't die. With some polishing, it should get incredibly useful for both translation and note gardening. I've made a little (ugly) tweak to bind ctrl+click on any existing note to resize it on the text inside - and this is STILL awesome in how much it simplifies working with notes. Itsonlyaname, are you still here? Maybe move the script to github so anyone could contribute/send pull requests? Also github probably won't go down like userscripts did.</p> Type-kun /users/337059 tag:danbooru.me,2005:ForumPost/91560 2013-09-08T03:48:58-04:00 2013-09-08T03:49:09-04:00 @itsonlyaname: Updated. Thanks for the detailed reports :) <p>Updated.</p><p>Thanks for the detailed reports :)</p> itsonlyaname /users/366769 tag:danbooru.me,2005:ForumPost/91559 2013-09-08T02:06:19-04:00 2013-09-08T02:06:19-04:00 @Toks: Needs to be updated again with the change from... <p>Needs to be updated again with the change from <a rel="external nofollow noreferrer" class="dtext-link dtext-id-link dtext-github-id-link" href="https://github.com/r888888888/danbooru/issues/1948">issue #1948</a>.</p> Toks /users/356497 tag:danbooru.me,2005:ForumPost/91056 2013-08-21T08:39:18-04:00 2013-08-21T08:39:18-04:00 @itsonlyaname: Fixed. As one might have guessed, i no longer... <p>Fixed.</p><p>As one might have guessed, i no longer have the time or motivation to add new features to the script, but i'll try to keep it working.</p> itsonlyaname /users/366769 tag:danbooru.me,2005:ForumPost/91048 2013-08-20T22:16:22-04:00 2013-08-20T22:36:40-04:00 @Toks: I seem to have broken this when I fixed issue... <p>I seem to have broken this when I fixed <a rel="external nofollow noreferrer" class="dtext-link dtext-id-link dtext-github-id-link" href="https://github.com/r888888888/danbooru/issues/1675">issue #1675</a>. Notes jump around instead of being created where I drag.</p><p>It looks like it can be fixed by replacing lines 1312 to 1336 of the userscript (the override of the old Danbooru.Note.TranslationMode.create_note function) with this:</p><pre>Danbooru.Note.TranslationMode.create_note = function(e,x,y,w,h) { var offset = $("#image").offset(); if (w &gt; 9 || h &gt; 9) { /* minimum note size: 10px */ if (w &lt;= 9) { w = 10; } else if (h &lt;= 9) { h = 10; } Danbooru.Note.create(x - offset.left, y - offset.top, w, h, e); // custom code - added event to parameters } $("#note-container").css('visibility', 'visible'); e.stopPropagation(); e.preventDefault(); // Hack to ignore clicks for some milliseconds // The mouseup event is executed before the click event, so it's hard to do this properly Danbooru.Note.ignore_click_until = (new Date).getTime() + 200; } </pre><p>That just updates the overridden function with the changes I made.</p> Toks /users/356497 tag:danbooru.me,2005:ForumPost/88979 2013-05-30T13:03:36-04:00 2013-05-30T13:03:36-04:00 @itsonlyaname: Fixed, forgot to rename some stuff <p>Fixed, forgot to rename some stuff</p> itsonlyaname /users/366769 tag:danbooru.me,2005:ForumPost/88977 2013-05-30T12:08:03-04:00 2013-05-30T12:08:03-04:00 @Type-kun: "Create all" stopped working in opera, outputs... <p>"Create all" stopped working in opera, outputs errors to the console.</p> Type-kun /users/337059 tag:danbooru.me,2005:ForumPost/88975 2013-05-30T11:19:56-04:00 2013-05-30T11:19:56-04:00 @itsonlyaname: v0.10 - Updated for danbooru v2.14.0 <p>v0.10<br>- Updated for danbooru v2.14.0</p> itsonlyaname /users/366769 tag:danbooru.me,2005:ForumPost/88973 2013-05-30T10:13:11-04:00 2013-05-30T10:13:28-04:00 @Toks: This doesn't seem to work very well with 2.14's... <p>This doesn't seem to work very well with 2.14's translation mode.</p> Toks /users/356497 tag:danbooru.me,2005:ForumPost/88917 2013-05-28T15:02:28-04:00 2013-05-28T15:02:28-04:00 @itsonlyaname: v0.9 - Added settings menu No setting for the... <p>v0.9<br>- Added settings menu</p><p>No setting for the red/green buttons atm, they will be moved inside the note edit box as per Type-kun's suggestion (Which looks great btw :D)</p> itsonlyaname /users/366769 tag:danbooru.me,2005:ForumPost/88791 2013-05-25T17:59:07-04:00 2013-05-25T17:59:07-04:00 @Type-kun: Edit box after some tampering:... <p>Edit box after some tampering: <a rel="external nofollow noreferrer" class="dtext-link dtext-external-link" href="http://puu.sh/315Lg.png">http://puu.sh/315Lg.png</a></p><p>The hook looks simple enough: <br><code> if (Danbooru.meta("current-user-name") !== "Anonymous") { $(".note-body").unbind('click'); $(".note-body").click(function(e) { var $note_body_inner = $(e.currentTarget); Danbooru.Note.Edit.show($note_body_inner); $(".note-edit-dialog .ui-dialog-content").before("&lt;div id='customcontrols' style='text-align:center'&gt;&lt;/div&gt;"); $("#customcontrols").append('We can have nice things'); e.stopPropagation(); }) } </code><br>. The buttons doesn't work yet though, I presume they should be rendered in the separate document fragment, bound to events and then attached.</p> Type-kun /users/337059 tag:danbooru.me,2005:ForumPost/88724 2013-05-22T07:57:59-04:00 2013-05-22T07:57:59-04:00 @itsonlyaname: > Toks said: > > I'm probably overlooking... <blockquote> <p>Toks said:</p> <p>I'm probably overlooking something, but I don't see why it would be bad in those cases. It just needs to go inside the innermost tag.</p> </blockquote><p>Ah, now i see what you mean. The current detection is a simple "if text is selected -&gt; apply to that text // otherwise -&gt; apply to whole note".<br>Changing it to something like "any selected texted? if not -&gt; find if the cursor is inside any tags? if not -&gt; apply to whole note." would work fine i guess.</p><p>Oh, so that red button actually does resize it to fit. I thought the buttons just resized it by a fixed amount (which wouldn't be particularly useful). In that case, they would be reasonable once they're more usable.</p><blockquote> <p>Toks said:</p> <p>Oh, so that red button actually does resize it to fit.</p> </blockquote><p>Yep, red resizes, green expands by 5px all sides. Those buttons are what i used to test the code before mixing it with click &amp; drag.</p> itsonlyaname /users/366769 tag:danbooru.me,2005:ForumPost/88712 2013-05-21T21:32:01-04:00 2013-05-21T21:32:01-04:00 @Toks: > itsonlyaname said: > > That is possible, but... <blockquote> <p>itsonlyaname said:</p> <p>That is possible, but i feel that might not be desired in some cases. Like, when trying to use both "bold" &amp; "italic", or "bold" then "color".</p> </blockquote><p>I'm probably overlooking something, but I don't see why it would be bad in those cases. It just needs to go inside the innermost tag.</p><blockquote> <p>itsonlyaname said:</p> <p>Would this still be needed if the resize buttons changed to be much cleaner and smaller? (so they won't get in the way even if the setting is always active)</p> </blockquote><p>Oh, so that red button actually does resize it to fit. I thought the buttons just resized it by a fixed amount (which wouldn't be particularly useful). In that case, they would be reasonable once they're more usable.</p> Toks /users/356497 tag:danbooru.me,2005:ForumPost/88710 2013-05-21T20:34:23-04:00 2013-05-21T20:41:45-04:00 @itsonlyaname: v0.8 - Moved eyedropper preview to below the... <p>v0.8<br>- Moved eyedropper preview to below the buttons<br>- Added preview text to the eyedropper function<br>- Fixed rare bug where note could be 1-2px out of the image<br>- Added 'x' button to close the Note Assist window<br>- Changed "instantNote" setting to default "true"</p><p>Haven't had much time to sit down &amp; code lately...<br>No slider to adjust colors (yet?).</p><p>.</p><blockquote> <p>Type-kun said:</p> <p>Suggestions:<br>1) Can you move text coloring controls inside the actual note edit box? I think they belong there.</p> </blockquote><p>That should be possible, but the layout could be tricky. The eyedropper preview is way to large to add to the note edit box so we'd end up splitting the button and the preview.</p><blockquote> <p>Type-kun said:</p> <p>2) SO misses the control to resize an already-existing note to fit the text. Maybe also inside the edit box.</p> </blockquote><p>Try the "noteAssist_noteButtons" setting, the buttons look kinda horrible though.</p><blockquote> <p>Type-kun said:</p> <p>UPD:<br>Oh, and also 3). Could you make an option to override note creation behavior? Instead of "N + click or drag to create" -&gt; "drag to create notes, click toggle notes, disregard small(accidental) drags as clicks, no keyboard involved". Maybe this should actually be in the main code, though.</p> </blockquote><p><a rel="external nofollow noreferrer" class="dtext-link dtext-id-link dtext-github-id-link" href="https://github.com/r888888888/danbooru/issues/1496">issue #1496</a> :)</p><blockquote> <p>Type-kun said:</p> <p>4) I see no way to close note assist window except refreshing the page</p> </blockquote><p>*Added a button*</p><p>.</p><blockquote> <p>Toks said:</p> <p>After pressing one of the buttons (eg. Italic), could the cursor be positioned inside of the html tags, instead of having the entire content selected? That would be more convenient so I could start typing instantly, instead of manually repositioning the cursor constantly.</p> </blockquote><p>That is possible, but i feel that might not be desired in some cases. Like, when trying to use both "bold" &amp; "italic", or "bold" then "color".</p><blockquote> <p>Toks said:</p> <p>What I'd like to see is a button you can click to instantly resize all existing notes. By "resize", I mean what it does automatically when you drag to create a new note.</p> </blockquote><p>Would this still be needed if the resize buttons changed to be much cleaner and smaller? (so they won't get in the way even if the setting is always active)<br> <br> <br> <br>I'm starting to think the script is pretty much ready/stable. Of course there will always be maintenance/bugfixes/feature requests, but the core part seems to work pretty well now.<br>This heavily depends on feedback though, since i very rarely actually use my script :p</p><p>I don't really have any more idea's to further improve the text-detection code (tons of performance improvements left, but it's not so fun to re-write code for the 10th time)</p> itsonlyaname /users/366769 tag:danbooru.me,2005:ForumPost/88565 2013-05-16T13:05:42-04:00 2013-05-16T13:07:05-04:00 @Toks: After pressing one of the buttons (eg. Italic),... <p>After pressing one of the buttons (eg. Italic), could the cursor be positioned inside of the html tags, instead of having the entire content selected? That would be more convenient so I could start typing instantly, instead of manually repositioning the cursor constantly.</p><blockquote> <p>itsonlyaname said:</p> <p>Yea, they aren't fully implemented since I'm not sure what to do with them.<br>Maybe I'll replace with smaller buttons, attached to the left side, half overlapping the note box. (+ some other quick buttons - all buttons accessible with shift-click only)</p> </blockquote><p>What I'd like to see is a button you can click to instantly resize all existing notes. By "resize", I mean what it does automatically when you drag to create a new note.</p><blockquote> <p>itsonlyaname said:</p> <p>Not a clue, looks like it was just a normal note in the middle of an image.</p> </blockquote><p>Turns out that's actually a bug with the site, not your script. <a rel="external nofollow noreferrer" class="dtext-link dtext-id-link dtext-github-id-link" href="https://github.com/r888888888/danbooru/issues/1623">issue #1623</a></p> Toks /users/356497 tag:danbooru.me,2005:ForumPost/88457 2013-05-13T13:22:43-04:00 2013-05-13T13:43:50-04:00 @Type-kun: Finally got to actually test it. It's even... <p>Finally got to actually test it. It's even better in action than it is in theory :3</p><p>Suggestions:<br>1) Can you move text coloring controls inside the actual note edit box? I think they belong there.</p><p>2) SO misses the control to resize an already-existing note to fit the text. Maybe also inside the edit box.</p><p>UPD:<br>Oh, and also 3). Could you make an option to override note creation behavior? Instead of "N + click or drag to create" -&gt; "drag to create notes, click toggle notes, disregard small(accidental) drags as clicks, no keyboard involved". Maybe this should actually be in the main code, though.</p><p>4) I see no way to close note assist window except refreshing the page</p> Type-kun /users/337059 tag:danbooru.me,2005:ForumPost/88452 2013-05-13T10:29:01-04:00 2013-05-13T10:29:01-04:00 @itsonlyaname: > Type-kun said: > > Take a look at... <blockquote> <p>Type-kun said:</p> <p>Take a look at <a rel="external nofollow noreferrer" class="dtext-link dtext-external-link" href="http://jqueryui.com/slider/#colorpicker">http://jqueryui.com/slider/#colorpicker</a> - this way is simple enough. It's RGB though, moving it to HSV would require some math.</p> </blockquote><p>That looks simple enough, I'll move the colorpicker/preview to a new box.<br>Larger preview, a slider to adjust brightness and some sample text that instantly gets colored.<br>At least, if a brightness slider is enough - HSV is kind of a pain to calculate (i can always import someone else's code though).</p> itsonlyaname /users/366769 tag:danbooru.me,2005:ForumPost/88438 2013-05-13T01:49:11-04:00 2013-05-13T01:49:11-04:00 @Type-kun: > itsonlyaname said: > > Properly tweaking HSV... <blockquote> <p>itsonlyaname said:</p> <p>Properly tweaking HSV would probably require a full editor though, something like <a rel="external nofollow noreferrer" class="dtext-link dtext-external-link dtext-named-external-link" href="http://s3.amazonaws.com/solideights/images/hsv_map.png">(image)</a>, which feels like it'd take a lot of space / time to code.<br>How about simply making the color gotten from the eyedropper about... 10~20%? darker?</p> </blockquote><p>Take a look at <a rel="external nofollow noreferrer" class="dtext-link dtext-external-link" href="http://jqueryui.com/slider/#colorpicker">http://jqueryui.com/slider/#colorpicker</a> - this way is simple enough. It's RGB though, moving it to HSV would require some math.</p> Type-kun /users/337059