« first day (25 days earlier)      last day (4930 days later) » 

10:00 PM
I think I need to wait until the page is loaded and ready, but I don't know how to do that. I thought the delay would take care of that but it doesn't
 
@YiJiang ping ... chrome extension question
 
@drachenster How do I find YiJiang? I'm kind of new to stackoverflow
 
@drachenstern It's past his bedtime. :P
 
try changing your timeout to be this:
setTimeout(submitForm, 5000);
eval is evil!
 
@drachenstern, yo?
 
10:03 PM
@TimStone he'll be able to jump to it later tho ... funny thing about the MultiColliderSuperDropdown that is
@rchern question is can you submit a form on load from a chrome-extension
 
erm
 
and how is the best way to go about that, and since you seem to have a bit of experience with chrome scripts
I decided to summon you from the depths of meta ;)
 
@david, trying now
one sec
 
I don't do chrome extensions.
 
@rchern my theory was that the extension could stuff a <script> into the DOM
 
10:04 PM
I do user scripts
 
@rchern oh see I didn't know that was a diff
 
@Johnson I was kidding :)
 
@Pointy Probably. That's what my userscripts do.
 
@drachenstern But we were having so much fun over there with my faux-egotism, and you took us away from it! ;)
 
@user503513 you don't go find someone on SO
 
10:05 PM
The Github link in the top pinned message over --------> is my repo, check it out
 
@TimStone lol
 
@drachenstern in soviet overflow, someone finds you!.
 
@rchern he's a newb, so I didn't feel tossing him into raw source was necessary ... just was trying to be kind
 
haha
 
@david tired meme is tired? At least everyone gave up on Natalie Portman and grits ;)
 
10:05 PM
@david, haha
 
um. good luck writing an extension without looking at raw source code.
 
But yes, I don't see any reason why the Chrome extension wouldn't be able to write the script tag to the DOM in a similar way to the userscript.
 
memes never die, they just get absorbed into other memes, which is in itself a meme... chaose.
without the final e
 
@rchern lol, ok, not quite what I meant ... touche
ok, back into the ether you guys disappear then I guess :p
@user503513 check the scripts pinned on the top right for the github site, see if that helps
 
@david, still no go on removing the parenthesis.
 
10:08 PM
@user503513 did that help at all? it seemed to work in jsfiddle, whereas your original code didn't
 
Essentially we have everything in a wrapper function that's toString() -ed, and then we set the newly-created script node's .textContent to ( + f + )($) (so we can get the jQuery reference too). The script node is then appended to document.body.
 
@user503513 did you remove the quotes around it too?
 
@david, yes I removed the quotes also
 
so it looks like this? : jsfiddle.net/ctrlfrk/gm2bd
 
@drachenstern $(rchern).fadeTo("ether");
 
10:17 PM
$("#rchern")*
 
I'll grant you the quotes. Limiting me to an id though? Seriously.
 
Tek
Question if anyone uses TinyMCE, I have the following code: Whenever someone clicks on a textarea, tinymce appears and they have to click AGAIN after tinyMCE appears(to type). Is there anyway to change focus to tinymce's box?

$('.textarea').focus(function(){

$('.textarea').tinymce({..etc
 
@david, after I change the code in jsfiddle, how do re run it
@david, never mind
 
hmmmm, okay i think i know what was confusing me, by default jsfiddle wraps it in a onLoad event handler
 
Tek
lol
 
10:24 PM
I was about to say the same thing,
 
you need to chuck the whole shebang into a timeout :p
 
I don't think I have the ability to put it in the onLoad event
Because I can't change the html
 
Yea the timeout thing was something I was trying
 
you can add event handlers programatically
 
10:28 PM
Do you mean find the body tag and add an onLoad event?
 
window.addEventListener("load", function(){
    alert("hi");
    //document.getElementById("ismForm").submit();
});
dunno how cross browser happy that is though...
 
@rchern @NickCraver I figured it was like a global reference ;) ... there aren't many rooms she's not ghosting in :p
 
@Tek @Tek Use $('.textarea').tinymce().focus();
 
anyone use submodal?
 
@david Still doesn't work
window.addEventListener("load", function(){
alert("hi");
document.getElementById("ismForm").submit();
});
 
10:32 PM
bloody ell, have you tried doing alert(document.getElementById("ismForm")); to make sure it's actually getting the reference?
and what browser are you using?
can you check for javascript errors?
 
im doing this in chrome
 
hold ctrl+shift+j to open the window of hax and see if anything is crying foul
 
Does "window" even mean the same thing from the context of a Chrome extension? That's the part that confuses me.
 
@david I've found that the usual answer to that is "no"
 
that depends on the context. the window in background.html for example has nothing to do with the user's current page
but, unlike greasemonkey or firefox, window in chrome does actually refer to the window running the script
 
10:37 PM
@Pointy yeaahh... that could throw a spanner in the works
 
@david, yes it does get the object with I do an alert
@david no I do not see any errors
 
@user503513 if you can alert and get the object id then the rest should be in the same place as the alert and should be easy
 
I am going to have to look at this later
Thanks for you help everyone
I got to get to school!
 
10:53 PM
laters user, sorry we couldn't help
 
Tek
@Na7coldwater That focuses on the textarea, not the tinymce application itself
 
@david what do you mean? he could alert the form id, his code was working fine as far as what he was kvetching about
 
@drachenstern the submit wasn't working though
 
@david and you don't have his code, and he couldn't be arsed to try a simple alert beforehand, and he hasn't vested any interest in our community on SO besides getting 20 points (or whatever) and so what's your point? So he couldn't get click to work. Until I see his code, I make the worst assumptions. It's all I know from having been on the site for a year now
 
eh, he is still at school, no harm in cutting him some slack. And I kinda prefer it this way, giving him suggestions and letting him do it himself
rather than taking his code, fixing it for him, and having him learn nothing
 
11:03 PM
I prefer him to say "hey, here's a link to a question, I've pastebin'd some code that demonstrates the problem, I've found that I can alert the id, but I can't seem to get the onclick to work to submit the form"
 
that would probably lead to a faster fix, and maybe next time he will do that
 
perhaps so... but you see my point? Until the user comes in and does that, I presume they barely know how to load IE
it's not polite, I grant you
 
but i'd be worried that he would start to treat all his problems like that, and never work anything out himself
I agree that assuming people know the bare minimum is the easiest way to avoid disappointment
you can only ever be pleasantly surprised!
 
@Tek Did you wait for TinyMCE to load first for that textarea?
$('...').focus() and $('...').tinymce().focus() are different.
 
Tek
11:23 PM
@Na7coldwater I may be under the wrong impression but does $('...').tinymce().focus() move the cursor inside the tinymce box?
 
I think so. I tried running
`$("#content").tinyMCE().focus();`
on http://tinymce.moxiecode.com/examples/example_23.php and it seemed to work.
Oops, that should be $("#content").tinymce().focus();
 
Tek
@Na7coldwater I have it like this pastebin.com/HwiekRuT It loads the editor fine, but no cursor inside. Should I have to run $("...").tinyMCE().focus(); again?
 
I think so.
 
Tek
all right, let me try that
 
It's probably not ready to do it when you first load it, because it still has to load the editor. I wonder if tinymce has some kind of load event?
 
Tek
11:33 PM
that would be awesome
 
Yes, just found it. Looking at the results of $("#content").tinymce() in the chrome debugger, there seems to be something called .tinymce().onInit. Try calling $("#content").tinymce().onInit.add(function(){$("#content").tinymce().focus()});
Except with $(".textarea") instead of $("#content"), of course.
 
@david not ignoring you, boss was here for an extended period of desktime
 
Tek
@Na7coldwater Still no cigar, I replaced both instances of #content.
 
Tek
Haha, I just did that
I even pasted your code to make sure I didn't have any errors.
But no. :(
the damn editor still loads though
.onInit doesn't seem to do much, I tried alert('hi'); instead of the $().focus
 
11:45 PM
Odd...where's the manual?
 
Okay, here's a JS Bin link:
http://jsbin.com/oparo3/edit
It's running the code at http://tinymce.moxiecode.com/examples/example_23.php, not your code, however.
Clicking the focus button once doesn't work, however, clicking it several times does.
 
Tek
Ah, you see, it works whenever it's done with a link
I want it to work whenever the page loads
The same thing with .show()/.hide();
 
I know, I figured this would simply be easier to test. (At least, for me it is)
 
Tek
plus for some reason I need to click on the link twice for it to work
right, I got that to work as well
just don't get why it doesn't work any other way
 
11:55 PM
$("#content").tinymce().contentDocument.body.focus(); completely bypasses jQuery, and still doesn't work.
 
the $ in that makes me believe it doesn't really bypass jQuery...
 
Tek
@Na7coldwater Did you notice you have to click on the link twice for it to .focus()?
 
Well, by the time it reaches the .contentDocument part.
@Tek Yes
 
Tek
Makes me want to paste the code twice...
lol.
@Na7coldwater Oddly, the show/hide button works on the first click. :/
 
jsbin.com/oparo3/3 binds the focus to the onmouseup event, fixing the double-click problem.
 
Tek
11:59 PM
Well done
 

« first day (25 days earlier)      last day (4930 days later) »