« first day (2 days earlier)      last day (4939 days later) » 

1:47 AM
any ideas why $("#message-10505 .action-link").click() wouldn't work? the click handler is added with .live and works if you manually click on it, but not when trying to trigger via code. (message-10505 is Avinash saying have a good day)
 
@rchern Because .live actually attaches the event handler at the body and watches it from there? But .click should still work
 
did what you just say make sense? i heard rchern: no, but yes
(;
 
@NickCraver @AndyE Help Needed!
@rchern @TimStone Hehe... calling for help with this is really very simple
 
@YiJiang, i manage to annoy the heck outta people without any help...no need to yell at them to annoy them off the bat. (:
q:
 
@rchern This smiley has been identified and will be added to the Smiley Reversal Taskforce's blacklist
 
1:56 AM
...
 
@rchern Anyway, persistent highlighting is done now
 
pastebin the addhl block?
 
@rchern Might be better if I just upload the whole thing, since there are two other blocks of code that enables this scattered elsewhere in the code
 
):
the code is so clean now though!
 
1:59 AM
@YiJiang Your disorganisation displeases her!
 
What did you guys do to it while I was away?
@TimStone Hey, you haven't seen my desk, alright
 
Heheh, my room is in shambles right now, don't worry. :P
 
are you sure dropbox updated?
your version seems to be a few behind mine
 
Anyway, jQuery updated itself to 1.4.3 during the weekend. The performance improvements are pretty impressive
@rchern If not just reload it, but I'm pretty sure that would be it
Also, I wasn't here while you guys worked with the code, remember
 
those were 2 separate thoughts.
 
2:02 AM
@rchern Oh, right
 
i don't see your localstorage code, and there are other modifications i've done that you don't have
was hoping to get to a relatively stable point prior to github heh
 
@rchern Do you see the three storeSelector, readSelector and removeSelector functions?
 
...and we've now pushed my request for someone else to look at the click problem off the screen so nobody else will see it
 
@rchern I'll star it
@rchern Eh... so?
 
@YiJiang, 4th time's a charm. did you post the link before dropbox was updated?
 
2:07 AM
@rchern Dropbox told me it was uploaded almost immediately after I copied it over.
Not sure why it would take that long for that change to propagate itself
 
shrugs
 
They use AWS right? Who knows with S3, heh.
 
so...bout that js ):
 
@rchern How bad is it (heart thumping)
 
I don't understand how actually directly invoking the handler manages not to work.
Although maybe those two problems are interrelated, heh.
 
2:10 AM
what 2 problems?
 
@TimStone Maybe the event handler demands a <del>Sacrifice</del> specific set of argument
 
@rchern I directly called the handler and nothing happened.
So maybe it is being called, just...not doing anything internally.
 
alright let me go back to the code
 
Also, why is there a hidden copy of jplayer in the chat HTML?
 
@YiJiang To play the notification sound?
 
2:13 AM
@TimStone Ah, right. Of course
 
2:38 AM
moves over here
calling .click() on an event should have it come from the message and have the event and position, shouldn't it? ):
 
@rchern Yes, but without those properties set. The specific functions just delegate to jQuery.event.trigger() in a generic sort of way.
 
jQuert, don't think i have that library (;
 
@rchern Heresy!
 
@rchern jQwerty is all the rage these days.
 
so we need to figure out how to fool this thing
 
2:42 AM
First rule of jQuery: Thou shall have every single library that starts with the letter j
 
There are a few ways.
 
what are you guys trying to do at this point?
 
@TimStone Can we pass it a modified event object? One where we have the mouse coordinated defined
 
Oh, you know what.
Silly me.
This is better all around anyway, I think.
One second.
 
@Mark Creating /edit
@rchern So how are you going to roll my persistent /highlight into the code?
 
2:44 AM
what do you mean?
 
interesting
and so you guys are mouse clicking your way to do this eh?
 
@rchern Well, I've given you the persistent highlighting code, now I'm curious what you're doing with it
@Mark No other way to interface with the chat system, unless they send us an obfuscated version of the source code ;)
 
meh
 
@YiJiang The handler isn't directly visible from the outside, so you have to do some digging, heh.
 
@YiJiang, hehe i've been working on the edit but i'll get it in there
 
2:47 AM
Actually, might that be too much to ask for? :D
@balpha Can we haz ur chat source code plzzzz!
 
$("<span/>").addClass("edit").text("edit").click(g).click(r.close).attr("title","click to edit").appendTo(r);
i'm pretty sure that's one of the relevant pieces of the code
since the modal dialog just gives you a span with class edit
 
@YiJiang hahaha why didn't we think of that? (;
 
yeah, so you just need to know what r is there
I believe
it'd probably help if i actually formatted the source
 
anyone have some experience on JSlint vs Google's closure linter ?
 
(test)
 
2:54 AM
var x = $(document).data('events').click,
    y = null,
    z = null,
    w = null,
    l = $('#chat .mine:last .message:last .action-link');

l.click(function(e) { w = e; }).click();

for (var i = 0; i < x.length; ++i) {
    y = x[i];

    if (y.selector == '.action-link') {
        z = y.origHandler;
    }
}

if (w) console.log(w);
if (w && z) jQuery.proxy(z, l[0])(w);

$('.edit', l.closest('.message')).click();
It can be greatly simplified if we don't have to go get the handler ourselves.
(which we probably don't, I just didn't test that)
 
okies so let's see here
 
so uh
i think i figured editing out
if you guys want some help
without mouse click events...
I think you guys already know how to find someone's last message
you need the span, so i'll leave that bit up to you
$('#message-10738').addClass('editing');
$('#input').addClass('editing');
argh, not sure why it's not code formatting now
ANYWAY, it's just class based
 
@Mark Four spaces, or just press the fixed font button
 
so you need to append the text to the input field, but that's easy enough
but in principle you can just add 'editing' as the class
and you're good to go
 
@Mark Eh... wouldn't that just add the appearance of editing, and not actually evoke the editing command?
 
3:01 AM
nope!
 
Or is that how the chat works
 
that's actually how chat works
editing using my script...
 
!
hehe
hrm
takes it back
 
SWEET!
i rule.
 
There's no take backs!
 
3:02 AM
so now the question is how are you selecting which thing to edit?
 
@Mark /edit [msg_id] Simples!
 
oh
 
Anyway, Mark is correct, though if you don't involve the event handler the buttons don't get added.
 
that's SUPER easy
uh, well you can fix that
easily enough
 
I saw jQuery.proxy() in above example, what is it? Can't understand from manual what is it good for
 
3:03 AM
@TimStone, ^^^ i edited 10766 but it didn't put the text into the input, so instead of adding the ! it replaced it
 
@TimStone So basically, no way to cancel the edit?
 
@YiJiang Well, it's trivial to do that ourselves, but we would have to do it ourselves.
 
hm? i saw the cancel editing button
 
@rchern One second on that one.
 
@serg I believe it's for dealing with scope
 
3:05 AM
hmm
 
@serg It sets the context for calling the function, so that this points to a particular source.
 
i'm not getting the input val filled in at all now
 
In this particular case, this is used inside of a function we don't have access to, so making sure that the context was what the function expected it to be when it was written was important. :)
 
well anyway, you guys can do your crazy mouse click thing if that's really what you want
but it doesn't have to be that hard
 
3:06 AM
@rchern It won't appear automatically when using Mark's method.
 
@TimStone but I can add those buttons
 
@TimStone, i copied your code
 
@Mark No, you're right. I should have looked at the code that actually did the editing a bit more, but I got held up in the event handling code.
 
$.browser.msie?$("#cancel-editing-button").show():$("#cancel-editing-button").fadeIn();
 
we just want to make sure that we don't get too dependent on the underlying code if things were to change.
 
3:07 AM
@Mark Oh, of course. I just don't want to replicate too many things manually due to their ability to change. ;)
 
@rchern because mouse positioning isn't sensitive to change...
 
In this case it's probably a non-issue.
 
@Mark, i meant just wanting to be able to call .click()
 
@rchern that's fair, unfortunately they're using class-based rules for editing
 
@Mark What's that for? I mean, why fade for others and show for IE?
 
3:08 AM
@YiJiang To show the buttons
 
@YiJiang if you run that in concert with my other two lines it'll show the button
well, it'll show it no matter what
but if you run it with the other two, it will mimick editing
less pulling in the original text
which i'll leave as an exercise
i'd run the function that sets up editing but it's buried in a namespace in obfuscated code
 
...lol. that's the point (;
 
so that's less likely to remain stable than just running the code
though i'd argue they're unlikely to change the fundamental way the stuff works
so what i'm proposing will likely be relatively stable
 
calling .click() should always work
since that's the normal usage is to click it
 
k
 
3:12 AM
can you paste your code i've gone blind apparently
 
$('#message-10738').addClass('editing');
$('#input').addClass('editing');
$.browser.msie?$("#cancel-editing-button").show():$("#cancel-editing-button").fadeIn();
that should do everything the event does
but i'm not sure
of course
it's at least close, if there's stuff missing i'm sure i can find it
 
Hmmm... the edit code works, but we'd have to move the buttons around just to make sure we don't mess anything up
 
move the buttons around? and which code?
 
i should confess, i'm not actually running your extension
just figured it couldn't be that hard to mimick editing
and you guys seem to have been at it for a while
=)
 
@rchern With @Mark's. The upload button still appears if we use that, which could cause some very weird things to happen if we're not careful
Whew... at least the system is intelligent enough to recognize when you try to edit someone else's message
 
3:16 AM
i see the upload button with @TimStone's code also
 
I'm personally cool with @Mark's method. You can one-line the clicking simulation though.
 
@Mark, well we haven't been going with mimicking. we've been going with calling into the chat code. at least so far.
 
$('#chat .mine:last .message:last .action-link').click().closest('.message').find('.edit').click();
 
the obvious goal is to go with what's best
 
that seems appropriate @TimStone
i'm not proud of my solution, just thought i'd lend a hand
i got scared when i saw mimicking mouse positions
;)
 
3:17 AM
Oh, it wasn't that, it was just that the popup wouldn't display without those positions.
 
@TimStone isn't that first part what we were trying that didn't work? i mean, that's basically what i wnated but it seems that doesn't work?
 
The popup didn't need to display, but it seemed like nothing was happening.
 
i'll tell you what would be awesome to add, is if you could detect a rate limit and automatically append the new text to the last text as an edit...
 
@rchern @NickCraver just floated into the room, does anyone here want to ask him anything? ;)
 
@rchern It did work, you just..didn't know it. ;)
@rchern It doesn't actually show the popup, but the popup is created, so you can work with it regardless.
 
3:18 AM
I saw inbox flags on SO, what's up? :)
 
#1 rule of rchern: if it doesnt' work the way I want it to work, then it doesn't work.
 
Heheh. :P
 
q:
hmm, so would the simplest thing be to just move it into position then?
wait
we don't care
 
@NickCraver Well, it's this GM script we're working with. We need to get the editing of chat messages working.
 
we don't want to see it anyway!
 
3:20 AM
@NickCraver We were pulling our hair out over something we thought wasn't working due to jQuery event handling, but it turns out that we just weren't getting easy to notice side-effects. Essentially, it was our mistake and we're (relatively) good now, heh. :)
 
But I think we've worked that one out. Erm.. is our solution satisfactory @rchern?
@TimStone Well, it's always going to be our mistake. Who else's can it be? ;)
 
hmm
 
@YiJiang Fair point ;) I suppose I meant rather that we thought we were misunderstanding how it was supposed to work, but it turns out that it was doing what we expected and we weren't paying appropriate attention, or something.
 
LOLOLOLOL
after all this
$('#message-10867 .action-link').click().closest('.message').find('.edit').click(); works just fine (test edit)
we were breaking it by trying to do it in pieces
or at least, i was ):
 
This is what we get for doing things piecewise! ;)
 
@NickCraver Though on that note we do appreciate your stopping by to respond to our calls for help, heh.
 
blames her professors for beating it in that you should test as you go (edit)
 
@rchern On our open source project I just stopped doing that. It was annoying to do the functional testing, so I started just assuming I did it correctly and passing it off to the people who had to test it either way. It worked...most of the time, heh.
 
hrm
you can't edit the same message again though.
 
@TimStone I pretty much assume, at this point, if my code compiles that it functions correctly
 
3:26 AM
$('#message-10882 .action-link').click().end().find('.edit').click();
 
@Mark :D
@rchern What happens?
Well, I guess nothing happens..
 
would be a bit more efficient instead of traversing back with a selector base to the .message
 
But hm.
 
Hmmm... let's see. Does this work? Yes it does! Nice!
 
the first time i tried editing again it didn't do anything, then i refreshed and that second time it just didn't fill in the value
 
3:28 AM
There's a time-limit on editing messages as well, sure you didn't violate that? the .edit won't be generated after the time limit
 
@rchern There seems to be a slight timing issue if you do it too quickly, I did notice that, but that may not have been your problem.
 
@NickCraver there's a dialog if you violate that...even through scripting
 
@TimStone It happens if you do it quickly, yes.
jQuery(span.edit✉)
>>> $('#message-10888 .action-link').click().end().find('.edit').click();
jQuery(span.edit✉)
>>> $('#message-10888 .action-link').click().end().find('.edit').click();
jQuery(span.edit✉)
>>> $('#message-10888 .action-link').click().end().find('.edit').click();
jQuery(span.edit✉)
>>> $('#message-10888 .action-link').click().end().find('.edit').click();
jQuery()
>>> $('#message-10888 .action-link').click().end().find('.edit').click();
jQuery(span.edit✉)
Notice that single jQuery( ) there
 
so we need to add in error handling
 
@Mark - that was my point :) it's blocked so would have no net effect since the selector would find nothing to click
 
3:29 AM
in a non-dependent, maybe they make it 5 minutes, kind of way
 
But you'd have to do it very fast. Far faster than you can type /edit
 
@NickCraver oh! so in "my" method of doing this I can generate a top-bar error dialog because I don't rely on the modal dialog to get generated, but good point.
 
0
Q: Recommendations for an experienced programmer new to JavaScript?

R..I come from a C/Unix background, with a lot of experience in shell scripting, and some on Perl, elisp, etc. too. But now I'm getting into some work where I'll need to be developing interactive web-based interfaces, and I need to learn JavaScript. My problem is that all the resources I've found on...

Close/Dupe/Answer?
 
got that the 1st time i tried to use /edit
 
@rchern Yeah, unfortunately the time check is hardcoded into the event handler.
if (users[e].is_moderator || K && secondsSince(o.info("time")) < 120) {
 
3:32 AM
@TimStone, assuming we get the input value always filled in, we can just check to see if anything is there? or check for .editing
 
@rchern We can actually just check the size of the jQuery set, since the edit link won't be available beyond that time frame. I think Nick mentioned that already.
 
d'oh
getting late, brain is shutting down
still though, i wonder what's up with $("#input").val() not getting set
 
Yeah, I'm not sure on that one.
 
/cash
//bc
hmmm
 
I mean, it originally gets $("#input").val("...please wait...");, then apparently polls the server for the message text.
 
3:38 AM
it pools the server for the message text? despite already having it?
looks
 
@rchern yep...well, it polls
 
why? |:
 
Unless data('source') is set
 
@Mark picky picky! (;
 
i'm only a little pedantic!
 
3:40 AM
Yeah, yeah, fixed.
@rchern Possibly because you aren't the only one who can edit your message, so it's important to ensure that you have the latest? Not that you can't still run into issues, but...We can always pester balpha for the answer, heh.
 
mm
 
hmmm lots of debug tests left in here
debugMessage = function(a) { console.log(a); }
then //cash, //test, etc in chat
 
@NickCraver I'm not sure how happy the team will be seeing that we're pulling their code apart then doing code reviews on them ;)
 
heh
 
chrome.google.com/extensions/detail/… makes it pretty easy to get a deminfied view :)
 
3:44 AM
@NickCraver Hah, interesting. :)
 
@NickCraver life saver!
 
hmm, ya know, i installed that, and i'm not seeing pretty js
 
it takes a minute
 
if you're using adblock there's a glitch in it's whitelist regex initiator
need to remove the ?v=..... from the end
 
3:47 AM
still no. looking for options i need to set?
options page doesn't load, cool
 
check the console for errors, maybe another extension that I don't have screwing with it? I haven't have any issues with it besides adblock, and the issue is with all files of that format and adblock
 
Resource interpreted as document but transferred with MIME type application/x-javascript.
 
that one should be ok
 
options page doesn't load so i think it might have not fully installed. disabled/reenabled and all good now
things like to randomly break for me. heh
 
chrome 6 or 7?
 
3:50 AM
8!
 
7 has some wacky behavior for me, had to roll back to stable to get some work done (and possibly a few SO questions)
 
go dev or go home! (;
 
7 = beta, 8 = dev now?
holy hell do a dot release google
 
i know stable is in v6, and dev is v8, so sure
 
hah, rare to see a -7 question with a bounty:
-7
Q: Javascript replace document.write(ln) with jquery hotfix

Christian SciberrasA seriously flawed and retarded piece of software which goes by the name of "Joomla" is giving me its usual load of headaches. Sample code I have the following code: .... <div id="abc"><!----></div> <script type="text/javascript"> jQuery.get(url,function(data){ ...

time to take the puppy out and a nap, g'nite gents and ladies
 
3:55 AM
G'night
 
adios
 
4:10 AM
@YiJiang, what are you trying?
 
@rchern Stupid mistake, I was editing a copy of the userscript that isn't being used by GM
That was why the changes I was making wasn't being reflected here
 
ah
what's the change?
 
@rchern Well, just adding in /edit
@rchern I think it's the way that you're clearing #input after each command that's causing the text that's being edited to be cleared
 
oh, hahahaha
 
@rchern Anyway to get around that, other than to store the that's being edited somewhere before copying it in?
 
4:17 AM
on it
 
4:37 AM
@rchern Here's what I have so far
edit: function(id){
	var message;
	if(id && !isNaN(parseInt(id))) {
		var message = $('#message-'+ id);
	} else if(!id){
		var message = $('.user-container.mine:last .message:last');
	} else {
		throw new Error("Input Parameters not recognised.");
	}
	var content = (message.data('source') ? message.data('source') : message.find('content').text()),
		link = message.find('.action-link').click().end().find('.edit');
	if(link.length){
		link.click();
		setTimeout(function(){
			input.val(content);
		}, 20);
Takes care of the input problem with a hack, by restoring the content to input on a 20 milisecond timeout
 
hmm, are you not using the validation i added?
21 mins ago, by rchern
on it
i did it differently >_>
 
@rchern Using /edit without any parameters will get you the last message
Though you can already use up for that
Not really sure if it'll be worth it, given the extra weight it adds
@rchern Well what didya do? ;)
 
4:51 AM
i used the return value
ha! oops. it auto-submitted the edit rofl
okies, there we go!
 
@rchern Hmm...? You modified the keydown event's CommandState.Success to put the return value into input on success?
 
nah
what's the purpose of userSelector and singleSelector?
 
@rchern Because you're using a "template" for the selectors
I thought it'll be neater to keep it in a function
 
d'oh missed the comment
hmm, mind if i edit it a bit?
 
@rchern Sure thing
Also, kind of annoying that you're using ctrl + space for repeating commands
The IME for most OS is set to open on that command
 
4:57 AM
/blame @balpha (;
 
An input method is an operating system component or program that allows users to enter characters and symbols not found on their input devices. For instance, on the computer, this allows the user of 'Western' keyboards to input Chinese, Japanese, Korean and Indic characters. On many hand-held devices, such as mobile phones, it enables using the numeric keypad to enter Latin alphabet characters. Terms Most operating systems use the term input method. It is commonly called input method editor (IME) in the Microsoft Windows operating systems. Some sources state that front end processor ...
 
 
4 hours later…
8:55 AM
Hrm, chat?
Why not IRC?
 

The Great IRC Debate

2 hours ago, 41 minutes total – 198 messages, 11 users, 3 stars

Bookmarked 1 hour ago by Yi Jiang

And what did we learn? Jeff hates IRC. ;)
A little more seriously, there's a question on MSO talking about this question in a lot more saner terms
 
ok whatever
 

« first day (2 days earlier)      last day (4939 days later) »