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

2:00 PM
lol @ withAllButTakeYourTime
 
But I'm not sure where that comes in
 
IE was choking on removing so many elements as well, so you see that 100 elements per loop there
hahaha:
1
Q: jquery selector not working in IE

user357034I have the following code on the page and it works in FF but not IE. I do not have any access to change this line of html code (like adding an id to better target). Could it be that it doesn't work cause there is no DOC type declared? <td align="LEFT" width="12%" bgcolor="#EEEEEE"><b&...

 
.... a lower-case 12 ?
 
@NickCraver Erm... I feel rather stupid, but what is a lower case 12?
 
i was kidding, the issue was the upper-case LEFT with IE, didn't think the OP would get it but he did :)
 
2:04 PM
lol I got it :-)
 
ah.. still that's an odd way to select an element
 
The most tedious thing about this script is creating all the icons, not the script...
There's about 60 icons I need to create
 
@YiJiang: I'm having a similar problem with one of my projects.
 
@AndyE At least for this one most of them should be repetitions, so it should be better....
 
@Fosco - Agreed, I added an alternative in my answer, not sure if it's an option
 
2:06 PM
I think you've already guessed what I'm doing
 
taking over the world?
 
@NickCraver $.takeOver(Earth)
 
Earth is undefined
though +1 for jQuery in your attempt...or was that prototype?
 
@Nick: you need to update to World Domination Plugin v2.0, it declares the global constant Earth.
Does anyone even use PrototypeJS these days? hides
 
I'm not sure what's going on there, I thought they released 1.7...beta, rc? something? and said the final will be out "very soon"...and that was months ago iirc
 
2:11 PM
$.deploy('deathRay').kill('thePresident').takeOver('Earth').laugh('evil')
Chaining makes things so much easier
 
oh i stand corrected, they posted an RC3 like a week ago: prototypejs.org/2010/10/12/prototype-1-7-rc3-support-for-ie9
 
@NickCraver: yeah, I was just kidding. I even recommended my Safer Object.keys implementation on one of the mailing lists.
I actually like prototype. The element extensions and all that. It's just a shame that <=IE 7 don't allow you to extend elements directly.
 
I don't understand it really, and this may be (and probably is) from a point of mostly ignorance...but given Prototype 2.0 will use Sizzle as a selector engine, seems like you wouldn't want to be on Prototype at the moment, lots of breaking changes coming since 2.0 (supposedly) won't extend the DOM
a few of the core team members thing extending the DOM was the biggest mistake prototype made, plan to change it with 2.0
 
Rewrites required then.
The way they extended the DOM is a little confusing. It extends in supported browsers, but with unsupported browsers you still have to wrap the element. Kind of annoying, and pointless to even extend the DOM objects in the first place.
 
True, and the collisions later as standards evolve, here's a really good article from someone on the prototype js core team: perfectionkills.com/whats-wrong-with-extending-the-dom
 
2:18 PM
Grrr... I need a lesson on pixel art
 
Oh something you guys/girls may find interesting: addyosmani.com/blog/the-top-10-javascript-talks-from-2010
 
Looks like my post didn't get authed onto the core mailing list. Wonder if that's got anything to do with the fact that nobody posts on there.
 
kangax is great, seems a shame he's stuck on Prototype
 
@TimDown: Yeah, I've been landing on his blog a lot lately, there's a lot of stuff there that always seems to be quite relevant to what I'm searching for.
 
allo
 
2:28 PM
@rchern Hey, ya here
Small modification to the userscript
var rooms = $("my-rooms a:first:contains(" + match + ")");
should be a better selector for switching rooms
Grr... I'm stalking off to the Chat feedback to complain about this
 
which one is that on? switch and leave?
 
@rchern Switch
 
shouldn't it be both?
 
my-rooms is an element now? ;)
 
@NickCraver Oops..
 
2:32 PM
hmm, apparently i read typos in js just as well as in english.
 
@rchern /leave uses something different
 
@YiJiang, worth adding Selectors.getRoom i'm thinking
hrm, it does? should it?
 
@rchern Eh... what does the Selectors object does again?
If you're saying, the ajax request to obtain the list of rooms
Then it'll be too much overhead for this
 
Stduies show that if the frist and lsat letters of words are corrcet then you'll read at abuot the same speed, so esay to miss the little thngis
 
@NickCraver Not that one again ><
 
2:34 PM
@NickCraver, what is this? 2001? q:
@YiJiang, ajax request? huh?
 
@rchern I erm.. haven't seen the Selectors object... ?
 
Are you trying to trigger the leave button link?
 
@NickCraver $('#my-rooms > li > a:first-child:contains("' + argument + '")').siblings('.quickleave').click(); fun ;)
 
@YiJiang, the Selectors object is where I put the selector template idea you came up with
 
be careful with contains, it's a substring match
 
2:36 PM
@rchern Okay, that's nice
 
var Selectors = {
        getMessage: function getMessage(id) {
            validateArgs(1, ["number"]);
            return "#message-" + id;
        },
        getSignature: function getSignature(match) {
            validateArgs(1, ["string"]);
            return "#.signature:contains('" + match + "') ~ .messages";
        },
    };
 
@NickCraver A feature here, not a bug
 
e.g. you'd leave "JavaScript" and "JavaScript sucks"
ah k
 
Too lazy to type the full name of the room
 
in that case...
 
2:37 PM
well, with /switch i check for a length of 1
 
Although the case sensitivity makes it slightly inconsistent
 
you probably want a case-insensitive match
jQuery.expr[':'].Contains = function (a, i, m) { return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase()) >= 0; };
 
@NickCraver It's getting quite weird, because half the commands takes case sensitive commands, and the other insensitive
 
then just :Contains() instead
 
Hehehe, @YiJiang and i did write different selectors
switch: `var rooms = $("#my-rooms a.quickswitch[href*=" + match + "]");`
leave: `$('#my-rooms > li > a:first-child:contains("' + match + '")').siblings('.quickleave')`
 
2:38 PM
hmmm, I'd definitely revisit that, consistent interface above all else
 
@NickCraver, this has kind of exploded from a little script with 1 thing to a whole command line setup haha
 
@NickCraver Yeah, it's not confusing only if you wrote the code and knew where which is used ;P
 
I went back and re-factored the growing switch statement into a sort of command pattern at least
 
@nick: Is there a pre-made jQuery function that does the equivalent of an INNER JOIN (returns the intersection of two jQuery objects)?
 
i can write js, but trying to do OO design makes me seriously struggle. which is what we're getting into here really
 
2:41 PM
@Tom - not directly, what's the source, 2 ID arrays?
 
@rchern Eh... the sooner you release this on github the sooner you can blame the community for this mess
 
@NickCraver pretty much. The two jQuery objects that have been constructed from them. I can roll my own easily, just wanted to know if I was missing something.
 
true, but neither do i want to put crap out on github
 
@rchern It's not crap, the quality isn't too bad
 
are you rolling your eyes right now? (;
 
2:44 PM
@rchern That was sincere! I swear!
I just bookmarked that little conversation there for posterity

/switch and /match commands

16 mins ago, 11 minutes total – 45 messages, 3 users, 0 stars

Bookmarked 46 secs ago by Yi Jiang

Mainly for @NickCraver's case insensitive contains though ;)
 
i need to research this custom expression thingadongdong @NickCraver mentioned and then determine the best thing to use for the Selectors object
 
@YiJiang, @rchern - Just as a tip, the `~` siblings selector is useful here:
$('#my-rooms > li > a:first-child:contains("' + argument + '") ~ .quickleave')
damn you minimarkdown
 
@NickCraver Four space code blocks are also oneboxes
 
mm yeah, i used ~ in Selectors for getSignature
 
So they also have to be on their own line I think
 
2:46 PM
@YiJiang - doesn't seem to be working here, did earlier
 
@NickCraver Damn you Mini-Me :-}/
 
you can do inline wrapped in `
 
@NickCraver Separate messages, I think
 
@NickCraver on its own line isn't enough, it needs to be the only line in the message also
 
it worked earlier with a multi-line, with text at the top, i give up
 
2:49 PM
function (a, i, m) a is the source element...
 
@Tom - sorry I completely forgot about your question, use .filter()
 
@Nick np ;-) I'm about to. Thanks! :-)
 
jQueryObject.filter(anotherjQueryObject) will return the intersection
added in 1.4 iirc
 
10
A: Is there a case insensitive jQuery :contains selector?

Alexander ProkofyevIf someone (like me) is interested what do a and m[3] mean in Contains definition. KEY/LEGEND: Params made available by jQuery for use in the selector definitions: r = jQuery array of elements being scrutinised. (eg: r.length = Number of elements) i = index of element currently under scrut...

 
@rchern - jQuery.expr[':'].Contains = function (a, i, m) { return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase()) >= 0; };
 
2:51 PM
yeah, i was just curious what the variables represented
i don't just want to copy code i want to understand it!
is silly like that
 
ah, a is the element, i is the index, m is the match
 
@NickCraver It's odd, I can't seem to find documentation for jQuery.expr
 
so m[3] is the text between the () in the :Contains()
 
(:
now to think about where in the script that line should go
 
@YiJiang = jQuery.expr = Sizzle.selectors;
it's just a shortcut, you're adding it to Sizzle...so it's not part of the jQuery docs
 
2:53 PM
@NickCraver Thanks, I'll look for that
 
@YiJiang, ideally, no selector would ever be hard coded in the commands, they'd all go through the Selectors object
 
@rchern - at the top ;)
 
q:
 
@rchern Yeah, but 90% of the time, the selectors are only used onces, so the extra code might not be worth it
Although collecting them in one place might make the code tidier
 
you caching the selectors or the results of the select?
 
2:55 PM
@YiJiang yeah i'm not sure performance is all that critical here.
@NickCraver forgive my ignorance, caching selectors?
 
@rchern var $this = $(this), and stuff like that
 
e.g. you caching "something", or $("somthing') ?
 
if i use the same selector (or part of a selector) multiple times in a code block then yes i store that in avar...if that's what you're going for
 
@rchern No, because the elements are not changed
Actually, they are changed
Well, some of them anyway
 
not sure i'm following
 
2:58 PM
For those that are not changed, we can just store a single $leave = $('#leave')
Because we're still calling $() in the leave code, even when the leave button is never changed
If it's never changed, a new jQuery object doesn't need to be created every time you call that
But of course the performance gain is tiny for these instances
Only if we're doing something on hundreds of elements...
 
gah, that would take my semi-tidy code and toss it out the window >_<
 
@rchern Semi-tidy? ;)
This is one of the few times I wish I'd learned how to do batch commands with Photoshop
 
well i like to think it is but i'm realistic?
 
@rchern Ask @NickCraver here for a code review ;)
 
disclaimer: I have no clue what I'm doing at least 98% of the time, it's mostly guesswork
 
3:04 PM
@NickCraver Good enough, the rest of us make do with 100%
 
just between me and you, i'm not sure why people upvote any of my answers, they're all guesses
3
promise not to tell anyone else tho, k?
 
I knew it!
 
shit
 
@NickCraver Sure thing (proceeds to star the message)
 
2 starred posts within 60 seconds.. awesome job!
 
3:07 PM
@NickCraver Now you must be wondering why people star your post on chat!
 
crap, they have transcripts of this, don't they?
 
double crap, i broke the /switch code hehehe
and /leave too (;
 
@rchern Eh... it's just a bunch of if-else statements... how'd you break that?
 
because i changed the selector logic
 
@NickCraver That's my least favorite part of this site.. that everything is logged and stored in perpetuity..
 
3:10 PM
@Fosco If you regret something within two mins of saying it you can still take it back
 
@Fosco - true, I don't see as much value here as SO itself
 
hmm, the case insensitive stuff isn't working
 
Which is more than I can say for the real world ;)
 
@YiJiang It usually takes a day before I regret something :)
 
anyone want to switch this project from linq-to-oracle to linq-to-sql for me?, any takers?
 
3:11 PM
how about linq-to-nolinq
 
oh, i defined the expression as :Contains, but then in my selector used :contains
@NickCraver for a low fee of $50, absolutely i will.
 
you have no idea how much of a steal that'd be
 
@NickCraver Is it possible to use jQuery.expr to override existing selectors?
 
yeah sure just override the name
e.g. .contains would override the existing one there
 
Oh my god... whew.. calm down
 
3:13 PM
yeah, that's what i did
 
well I take that back, I'm not sure what .contains would do, it's not a normal selector
 
I accidentally misclicked revert which was so close to save for web in PS
Thank goodness revert now goes into history
 
:contains() and :not() are specially implemented, don't think they cab be overridden, I'd have to look at the order
 
it seems to work
ok, stackflair.com/SEChatModifications.user.js has the most recent code from me. i'm trying to remember what is next. I know there's the navigation stuff, but I'm leaving that for now. Maybe tonight.
 
ok yeah the way it's coded it'll check for a contains in .expr first: github.com/jeresig/sizzle/blob/master/sizzle.js#L588
 
3:18 PM
I've always had problems with ECMAScript's scopes. Is there any good question on SO or resource elsewhere on the internet that might help?
 
@YiJiang - what's the issue?
 
@NickCraver Closures, event handlers, those two
 
example?
 
@rchern is there documentation on what this does?
 
@NickCraver Well... rather embarrassingly, years ago when working with AS2, I basically gave up trying to maintain how to pass variables to event handlers when I needed them, and just defined everything in the global scope instead
 
3:20 PM
you want to pass them when binding?
jQuery's a little different, you can either create a closure to copy a variable if needed, or if it's shared just use it...or pass it as event data, so a few options open here
 
@Fosco, documentation? what's that? |:
 
new jQuery 1.4.3 allows passing data in event bindings
 
@rchern /help would be nice :)
 
@rchern hehe.. well I don't even know what I just installed..
 
@Fosco - it always did ;) the false is the new part
 
3:23 PM
@Fosco Look through the code if you want a list of the commands
 
in Chat feedback, 7 hours ago, by rchern
@MarcGravell, let's see, right now i've got: starring, quoting, switching rooms, opening the transcript, loading the last page of messages, /me being turned into italics, add/remove/list highlights, scrolling to the last message by a user, listing rooms (not just ones you're already in), joining a room you aren't in, editing a message, (about to add deleting), and leaving a room
 
w00.. nice
tests it again
 
|:
 
:|
 
._.
 
3:25 PM
ah yes, needed to refresh
 
@TimStone Hey, welcome to the party!
 
'Ello
 
You see here: c - a cursed -2 productivity chatroom
The cursed chatroom cannot be unweld!
 
hmm, i gotta remember how to setup a new github repo >_>
and i will absolutely need help figuring out how to incorporate patches and all. my github knowledge is extremely basic
 
git init .
actually github has pretty great docs, have you read through some of those?
 
3:33 PM
yeah. when i was setting up StackFlair. (:
ooh, a new version of GitExtensions
 
@rchern I keep this bookmarked, thinking about buying it some day.. tekpub.com/production/git
I'm not usually one for training/videos, but source control is so anti-me, I'd need to be walked through it in detail.
 
yeah i know that feeling
 
source control is "anti-you"?
like why you would do it, or just all the annoying technical stuff you have to deal with?
"oh a huge broken merge, fml"
 
@ecoffey I've resisted it everywhere I've worked. I just hate dealing with it, and never committed myself to getting comfortable with it.
@ecoffey at the last place, I actually had someone else do it for me. lol.
 
hmmm
 
3:43 PM
My current job has a really neat home-grown approach that makes things pretty painless.
 
which is?
what i hear there is you're still solving the problem :-)
you recognize that tracking history on a code base is important
 
is it?
I recognize that it is for some projects
fyi I am not saying I'm right..
 
heh
its cool
 
i recognize the importance, but when it takes longer to deal with source control than to actual code the damn project... (;
 
for me and developers i work with working with version control is such a base assumption, that i'm trying to figure out how i can explain why i like and why you should use it without appearing to call you out :-P
when you launch something, or push up a fix to a production box, what happens if you're wrong? what if you introduced a silly "<=" instead of a "<" somewhere?
 
3:48 PM
@ecoffey too late :) I guess the difference is that I don't often work with others on the same code-base.
@ecoffey it would've failed testing?
 
if you have it under version control thats a simple step back in history and re pushing everything up
its insanely handy to be able to look back at group of commits, looking at diffs: "yes this is the only thing i'm pushing"
ok well if the tests are your objectivity then it's even more important to track changes to them
 
ok, you've converted me. I'm going to buy those GIT videos and learn it all.
 
hehe
 
The open-source project I'm working on is going to integrate with Git anyways :)
 
i'll paypal you the 15 bucks :-P
 
3:50 PM
oh no, an evangelist!
 
git is pretty conceptually simple / interesting as well
haha
 
Maybe you'd like to join the project to assist with the git integration??..
 
haha maybe :-P
what's the project?
 
a web based team IDE based around a chat room interface, with server managed source control
mock ui: posiverse.com/jason/fosco login/pass: test/test
 
that sounds like bespin a bit yeah?
 
3:52 PM
hmm, this is going to be a mess
i need a local directory for my github repo, i need to be committing changes to github, i need the code on stackflair.com to pull the extension, but i've also been just editing the file in my extensions directory
 
@ecoffey perhaps a bit.. let me check it out
 
it's certainly a neat idea to explore though
 
how the heck am i going to manage this lol
 
looks like bespin is a single file editor?
 
@fosco maybe, i've never actually played with it :-P
 
3:55 PM
@rchern by not editing the file in your extensions folder
 
@rchern so your code is going to live on your box in MyShinyAwesomeProject
 
@ecoffey looks that way.. in which case, my project is much much bigger.
 
you should be able to add remotes for github
 
gotta run to lunch.. bbl
 
and a remote for stackflair
so you can push to github and stackflair independently
i have no idea i just answered the right question for you though :-P
 
3:56 PM
ecoffey, i just meant there are a lot of places this code needs to exist
and managing upgrades seems like a mess
 
right
git handles that with remotes
its how git repos talk to each other and exchange diffs
 
oh, hrm
 
actually the rails 3 tutorial uses git and has some good examples for setting up remotes to push to github and heroku
@Fosco your idea also kind of reminds me of google wave a bit; which really would make a pretty good foundation for this, just with a very custom UI
 
wondering how this chat room is built :)
 
with magic!
 
4:03 PM
what kinda magic :)
 
uhhhhhh
puppies and unicorns?
 
lol
 
it's pretty slick; i like how they put that little dashed line in at the point you tabbed away; makes it easier to slack off at work!
 
@ecoffey do you happen to have a link?
 
@rchern yep that's the one
 
4:28 PM
gah, new repository isn't being listed at github.com/rchern
 
what is it called?
 
@Fosco, @NickCraver: jQuery input special event plugin released :) whattheheadsaid.com/projects/input-special-event
 
@AndyE Nice Wordpress theme. :-) But why is it so wide? I get a horizontal scrollbar worth 2-3 screen widths...
 
@Andy - ah very cool, shall play in a bit :)
@Tomalak bigger monitors is the only clear solution...
 
@ecoffey StackExchangeScripts
 
4:42 PM
what did git say after you did 'git push'?
 
@Tomalak: I didn't create the theme, I'm no designer :-) Which browser, and what resolution?
 
@Andy - and appreciate the shout :)
 
@NickCraver Um. If 1600px is not wide enough…
 
@NickCraver np, I was glad for the help.
 
@Tom - 2560x1600 x2 ;)
 
4:43 PM
@rchern or rather do: 'git remote' and tell me what it says
 
@NickCraver Sharp eyes :-)
 
@Andy - anytime!
 
@AndyE Current Chrome dev release, 1600x1200
 
nah, dell's 30" monitors look about the same pixel size as a normal 17" 1600x1200, I just needed more pixels...work as a contractor, work from home, tax writeoff to get your equipment ;)
 
@Tomalak: Weird, I'm on the same resolution and it looks fine for me in the current stable release.
 
4:45 PM
@AndyE Ah well. The scrollbar doesn't kill me. :-)
 
yeah I'm not using half a monitor on this and it fits in the window, you have a SS @Tom?
 
Well, that's all from me for now, folks. See you in a bit :)
 
@ecoffey i'm sure i'm doing something wrong in GitExtensions. init worked fine and push says the repo doesn't exist. i'm trying!
 
@NickCraver What's an SS?
 
screenshot ;)
 
4:47 PM
Hi to all
 
@rchern aahhh, i think you might have to create the repo through githubs ui before you can push stuff into it
 
@AndyE later!
 
I can ask support here?
 
@support: can Luca ask you things?
 
@NickCraver Yes, here: imgur.com/WZ963
 
4:49 PM
@Tom - ah, I see what you mean, definitely a Chrome dev or addon bug
 
@ecoffey, oy i'm a doof! works now #: github.com/rchern/StackExchangeScripts
 
Link only the question because i still trying but nothing :-(
 
@rchern: go team!
 
@NickCraver does not look like that for me on chrome dev
 
@NickCraver Think so, too.
 
4:50 PM
@Luca - you have a question open on SO?
 
Yes
 
paste the link here, by itself, no other text :)
 
0
Q: jQuery: Modify the structure of an input.

LucaHi to all, i have wrote today because i need some help with a simple function in jquery for modify the structure of an input [reCaptcha] and hide the image showed. The code of the page(s) that contains the reCaptcha plugin is: http://pastebin.com/Qahph2ZB Is possible to make this in Jquery? ...

 
Thanks you :)
 
@Luca - The answer provided works, you can inject elements with JavaScript, the same effect...since you can't mess with things on the remote domain.
 
4:55 PM
But,how i can inject 'div' ?
 
$("body").append("<div class='myDiv' />");, can give it inline CSS or stylesheet
 
Now i try
Fixed,thanks to all :)
 
5:31 PM
Resig and the dudes should really update the constructor to be able to take multiple jQuery instances and do x to each of their internal collections; for instance: $($("p"), $("div")).each(...)
.. instead of having to do $($("p").get(), $("div").get())...
 
Uh...
$("p, div").each(...)
 
Aye, but if you've got things cached
... like you do, most times
 
0
Q: Merging jQuery objects

DavidIs it possible to merge several jQuery DOM objects into one array and call jQuery methods on all of them? F.ex: <button>one</button> <h3>two</h3> <script> var btn = $('button'); var h3 = $('h3'); $([btn,h3]).hide(); </script> This doesn't work. I know I...

 
still; I think it looks cleaner to just call the constructor with multiple instances
 
who was it that asked for documentation? i added a readme with a list of commands
 
5:54 PM
@rchern That was me (;
 
@rchern Excellent work! You're full of good ideas (:
 
6:12 PM
^__^
suggestions welcome (:
 
Pol
6:57 PM
Do someone know how to pass jCarousel height/width of item, so i can get rid of error.?
The error is: jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...
 
@Pol - this is usually because an element it's trying to show is not visible/present
 
Pol
What should i do?
What do you mean not visible?
 
hidden/missing/etc.
 
Pol
I'm just truing load it dynamically by ajax...
looks like Everything is visible
Tell me please how to get rid of this error without making changes in jCarousel
 
7:49 PM
Hello guys
 
hi
 
how's it going?
 
Hey
I have a bunch of data in javascript
I want the client to download it as an XML file
so given I can make the data into a string formatted like an XML file
is there a way I can prompt for a download with just Javascript
No Server Side language
 
Not really
 
I'm guessing i'd have to have them copy/paste into a text file
 
7:55 PM
yeah pretty much
 
dang it..
 
or have a server-side thing :)
 
you could try a data: url
 
If you have the data in a JS object/array, you could try this: thomasfrank.se/xml_to_json.html (from a quick Google) to get it into XML format.
A server-side thing wouldn't be all that hard if you have any language at all on your host.
 
well
the idea is the application is mainly offline
so I'm perfectly fine using server side stuff..
 
7:58 PM
Are you using AIR or something like that?
 
right now it is just in the browser as an HTML5 app
 
Or a locally-hosted server?
 
hopefully this will be able to be ran when offline
 

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