« first day (323 days earlier)      last day (3487 days later) » 

8:33 AM
@Jean-FrançoisCorbett voted
@ArunPJohny is closed and deleted by the OP
 
@rene I'm starting with a rewrite of the script, something like this seems to work much better: gist.github.com/kappa7194/ba6f562cbb1906932bed
 
@Albireo I'll give it some thought tonight. I also realized the current approach could become messy. Back to the drawing board :)
 
 
1 hour later…
10:07 AM
@rene Gist updated, this should behave better: gist.github.com/kappa7194/ba6f562cbb1906932bed
 
10:35 AM
@Albireo yeah, that looks better but beside resetState you would also need a gobackToState (on the click on the breadcrumb)
 
 
1 hour later…
11:47 AM
@rene yep, it's still a work in progress.
 
 
3 hours later…
2:45 PM
What's missing now: breadcrumb support, mixed mode support (if you click something with the mouse).
I've updated the GitHub repository too.
@rene if you want to submit pull requests please use four spaces to indent code, not tabs, otherwise TamperMonkey's editor (which uses four spaces) gets messed up.
 
@Albireo (disclaimer: I know nothing about userscript) Did the version go from 0.4 to 0.1?
 
Yeah, I completely rewrote the script, the metadata are the default ones (I changed the name and description).
 
no auto-update property?
 
I'll add this evening, I need to understand better what each meta tag does (I think I messed up the previous update URI).
Also I need to host the script somewhere, I can't have the update URI point to the GitHub raw file view. :\
 
So if I can suggest a feature request, add the number on the review themselves. Like "Leave Open (1)", "Close (2)", ...
 
2:59 PM
That's something I would like to add, but I don't know how at the moment. :\
The main problem is the content of the pop-up is loaded through an AJAX call, as is the next question when you cast your vote, so you must edit the DOM "live".
I know how to hook event handlers "live", but not how to inject text (if it's even possible).
 
Ah, ok.
Well this line does what you need to do, assuming the button already exists on the page (no ajax)
$('.review-actions input[value="Leave Open"]').attr('value', "Leave Open (1)");
so you can run that in your console and it should do it
the trick is getting it to run after ajax
 
@gunr2171 That's the problem.
 
Hum, I'll keep working on it as well, see if I can find out anything
got it
$('.review-actions').bind('DOMSubtreeModified', function() {
    $('.review-actions input[value="Leave Open"]').attr('value', "Leave Open (1)");
});
Add that just after $(document).ready(function () {
HOWEVER, this will break the rest of your script, because it's looking for the text without the numbers, so you have to adjust accordingly
 
3:17 PM
@gunr2171 seems interesting. I'm going home now, I'll look at it either when I get there or this evening.
Meanwhile, if anyone finds out some pesky bug you can report it here or open an issue on GitHub‌​.
 
will do
 
 
1 hour later…
4:47 PM
The script on GitHub has been improved with shortcut keys helper on the main actions with the help of @gunr2171.
Now: can we haz shortcut keys helpers on radiobuttons too?
 
Looks good to me.
@Albireo An idea is to insert a <span> before the radio button text for the number
 
@gunr2171 radio buttons seems to be loaded at the same time as the main actions buttons (they're not loaded through AJAX when an action is chosen), so it should be a matter of finding the right CSS selector and slapping it on a mutator.
Correction. Inspection of the AJAX response revealed they're not loaded at all, are static elements of the page: gist.github.com/kappa7194/2cd8cf93144bae32f573
Correction of correction. My brain farted. The pop-up content is loaded throug AJAX when you click "Close".
 
5:04 PM
@Albireo yeah, that's what I'm seeing. Only the filter options are static on the page.
oh, and just so you know, i'm not a fan of the "[x] reason". Square looks, strange...
 
I guess it's personal preference
 
Hooking in the pop-up is giving me troubles. MutationObserver must hook on existing elements and I can't understand which elements exists when the page is loaded. Is there a way to disable AJAX calls?
 
I don't know about disabling ajax, but you could hook onto <div class="post-menu">
which contains the popup
 
Nope, I tried and exploded complaining no such element exists.
Disabling JavaScript completely yields this: i.imgur.com/e3YYrXZ.png
Seems everything inside <div class="review-content"></div> is dynamically added.
 
5:16 PM
hum, you are right
bind to document! nothing can go wrong!
 
@gunr2171 Except then I have to sift through one bajillion change events and pick the correct elements. :S
 
So this would be the "bad" way: (thanks formatting)
var doOnce = true;
$(document).on('DOMSubtreeModified', '.action-list', function() {
    if(doOnce == true){
        doOnce = false;
        $('.action-list label input[type="radio"][value="OffTopic"]').after("<span>(2)</span>");

    }
});
However it only works on the first window load (because of the boolean)
 
Evil will not prevail.
(function () {
    'use strict';

    var observer = new MutationObserver(function (mutations) {
        mutations.forEach(function (mutation) {
            for (var i = 0, j = mutation.addedNodes.length; i < j; i++) {
                var node = mutation.addedNodes[i];
                if (node.tagName === 'DIV' && node.id === 'popup-close-question') {
                    var reason = $(node).find('[name="close-reason"][value="Duplicate"]').next().get(0);
                    reason.innerText = '[1] ' + reason.innerText;
 
Awesome. Yeah, you are clearly better with javascript than I am, so great that you know the better solution
 
5:32 PM
A sane way to avoid code duplication to map reasons to their shortcuts?
 
No, I mean not using the depreciated "DOMSubtreeModified" and using "MutationObserver"
 
E.g.

case keys.Two: // Off Topic
clickCloseReason('OffTopic');
state = states.atOffTopic;
break;

Here `OffTopic` is mapped to `keys.Two`.
I broke the chat's MarkDown parser. :V
 
It needs to be 2 messages
 
Aw.
 
Multiline messages don't get formatted.
Multiline messages _don't_
get __formatted__.
Multiline messages _don't_ get __formatted__.
 
5:39 PM
So, do multiline message get formatted? :P
 
Nope.
 
6:30 PM
@gunr2171 you happy with this? gist.github.com/kappa7194/db53f4c87df11c0525ac
 
Looks fine
ugh, naming a function "foo"?
 
I was running out of ideas. :D
It's still a work in progress though.
 
7:26 PM
@TGMCians around?
 
yup @rene
 
When do you want to review?
 
anytime
i am ready for now as well as later also
 
OK, give me 15 minutes
 
ok sure
 
7:53 PM
@TGMCians I'm ready if you are
@Albireo I'm testing it during this run of CV...
10,685
need review

1,809
reviews today
 
/me runs away.
 
@TGMCians we are syill on
 
yep, keyboard shortcuts are much faster
 
one bug: numpad doesn't work...
 
@rene yep, keyCodes are different.
 
8:00 PM
@rene yup
let's start
i was afk
 
@TGMCians OK
 
@gunr2171 have you ever used greasyfork.org?
 
i am on css3
 
@Albireo never heard of it
i've only ever heard of tampermonkey from the auto-comments for SO
 
> There are no items for you to review, matching the filter "[css3]"
@rene ^
i am on forms
 
8:02 PM
OK
 
passed js audit
 
@Albireo ah, just for me? You shouldn't have!
So if you look at a previous review, the "next" button says "[undefined] next"
 
Uhm.
@gunr2171 update, should be fixed.
 
> Thank you for reviewing 40 close votes today; come back in 3 hours to continue reviewing.
 
8:14 PM
@Albireo, look at this review, see if you see something weird with the off-topic reasons
I'm seeing two #7s
 
Me too. oO"
 
yeah, i turn the script off and it's back to normal. so there's another bug for you
 
@gunr2171 that's because if someone uses "other" and writes a custom message, that comes up as another option.
 
@rene done
 
@TGMCians I'm lost in the queue
 
8:18 PM
I see
 
passed matlab audit
passed c++ audit
and i'm still getting "[undefined] Next" on audit "Congratulations!" page
 
There are no items for you to review, matching the filter "[css3]"
 
Thank you for reviewing 40 close votes today; come back in 3 hours to continue reviewing.
 
> Thank you for reviewing 40 close votes today; come back in 3 hours to continue reviewing.
 
@easwee
 
8:28 PM
@gunr2171 are you using version 1.0.0-rc.4?
 
yes
 
@gunr2171 that's not good.
 
now, it's fixed on showing old reviews though, just that one page
 
@gunr2171 is that page using some strange attributes for the button?
 
no idea, page is gone and i would have to pass/fail another audit to see it again
 
8:31 PM
ok guys thanks
good night
 
@Albireo -1 no freehand red circles
 
@TGMCians good night
@Albireo can't you check if data-other-comment-id has a value?
 
Thank you for reviewing 40 close votes today; come back in 3 hours to continue reviewing.
@rene managed to do a few
 
@rene how? You create a new function to handle the "other" reason, but then what do you do? You can have n "other" reasons, should we skip giving them a shortcut?
> You can have n "other" reasons
 
@Albireo number up?
 
8:37 PM
I mean, at most four.
@rene number (really, keys) are hard-coded, each option gets its key (number).
 
@Albireo Yeah, I see that now in the script... let me check
 
Maybe a function which iterates on "other" reasons found, keeps a counter and increments the base key/number?
We're lucky "other" is number 7, as we can have at most four other votes (since the fifth will close the question) we could go 7/8/9/0.
 
@Albireo Yeah, that would be the solutuion
 
Handling that 0 will require a kludge. :|
 
@Albireo Mod 10?
 
8:47 PM
Indeed, a kludge. :D
@rene is it possible to find through moderator tools another question with an "other" vote?
 
@Albireo no. it is not...
 
:(
 
well, i'm out. time to drive home
 
@gunr2171 Bye.
 

« first day (323 days earlier)      last day (3487 days later) »