Re: [jQuery] Kinda funny way to getting jQuery some exposure
Gaah! My eyes! Classic! I'm still giggling. - Brian That page with the email animations is awesome! It's like a web Chamber of Horrors :-) I think you won that comments debate. Paul Caton. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] hoverIntent r5 = plug-in ready to be plugged-in
Thank you. That really means a lot! :) I had a similar need about 6 months ago. A client wanted a lot of information displayed in a tooltip, and there was the possibility of ~30 tooltips per page. We couldn't load all of that data at one time, so I wrote the beginnings of this script in pure, custom JavaScript. Since then I've found a few other instances where I've wanted something similar, but didn't want to rewrite my custom code for another custom use. Then, in January, I met jQuery... I found the hover function... and at some point I realized my determine user intent script was really a modified version of hover, and I challenged myself to hack it and make my first plug-in. jQuery not only provided that crucial second-stage of inspiration, but it enabled me to write this plug-in in the most abstract/re-usable way... and then provide me with a mechanism for packaging it up and distributing it to the community. ...so empowering! I guess this is my long-winded way of saying I agree with you. jQuery has made coding JavaScript and building interactive sites/applications pleasurable. :) ...and I'm glad someone else is finding a use for my plug-in. Thanks again. Brian. On 3/28/07, Theo Welch [EMAIL PROTECTED] wrote: Great work, Brian! Thanks for sharing this really helpful plug-in! On a site I am building (NDA'd) I am currently using setTimeout() to delay drop-down menu appearance (and disappearance) to avoid that flicker problem so common with drop-downs. It actually works quite well. But hoverIntent creates an even more intuitive and slick UI. I find that insignificant interface details like this can really make a website a pleasurable (or awful) to use. And it is jQuery with flexible plugins like yours that make websites a pleasure to build. Cheers, -THEO- On Mar 28, 2007, at 2:25 AM, Brian Cherne wrote: I'm happy to announce that my first plug-in, hoverIntent, is ready for general use. http://cherne.net/brian/resources/jquery.hoverIntent.html hoverIntent is a function that attempts to determine the user's intent onMouseOver. It works like, was derived from and is interchangeable with jQuery's built-in hover. However, instead of immediately calling the onMouseOver function, hoverIntent tracks the user's mouse and waits until it slows down enough before making the call. hoverIntent r5 ... is $-friendly ... has configurable options ... has onMouseOut timeout option Thanks for all the feedback from before. I hope this is the first of many plug-ins. :) Brian. P.S. How does one get their plug-in linked to from the jQuery plug-ins page? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] nightly builds
It hasn't worked since the one time that you forced it (around r1485 or so). - Brian I think he means with the builds being generated. I think it's having problems building the right builds, again. --John On 3/29/07, Brandon Aaron [EMAIL PROTECTED] wrote: What kind of problems are you having? I do know that there are some issues with fx in the nightlies but I don't know of any other issues. -- Brandon Aaron On 3/29/07, mmjaeger [EMAIL PROTECTED] wrote: anybody else experiencing problems with the nightly build downloads? -- View this message in context: http://www.nabble.com/nightly-builds-tf3488239.html#a9740412 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Quality control for plugins
Jörn, if everyone wrote as coherently as you babble, I think all threads would benefit. :) I agree that a low barrier to entry is beneficial. I remember writing my first lines of jQuery code (back in January). From download to tutorial to production-ready functionality, it was about 1hr... for something I though would take an afternoon or longer. ... talk about low barriers. I hope folks are lurking on this thread and thinking about how (and encouraged) to play nicely with others... even if we don't force them too. jQuery is as much about simplicity of code as it is about community. Brian. On 3/27/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: Brian Cherne schrieb: On 3/26/07, *Jörn Zaefferer* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Unfortuanetely, Javadoc is a bit limited for documenting jQuery plugins. For example, most plugins offer options, that is, they accept a object whose properties are used to override any set defaults. How do you document all these options via Javadoc? That is a very good question and a serious limitation. Do you think no standard is better than an incomplete standard? Maybe someone should come up with jQueryDoc ;-) We are pretty close to scriptdoc, but not the same. I wonder if John could move the efforts around scriptdoc to the jQuery community, that could help alot to bring both forward. And back to Howard's initial message: Is there a standard for plug-ins to follow? I've read a lot of plugin code since I came to jQuery, and wrote some parts of the current plugin authoring guide. That was more an approach to document standards, instead of actually standarizing anything. Of course those change pretty fast, and currently I consider the guide to be out of date on several parts. Mainly because my own coding style changed a lot, as you can observe by comparing my tooltip plugin and the accordion or the treeview ;) There is one important convention that every plugin should, maybe even must stick to: Provide sensible defaults for every option, and make it possible to customize as much as reasonable. The result is that everyone can start using a plugin withou reading too much or any documentation at all. That sets the inital barrier very low, something I consider very important. I hate having to give up using some great framework or software just because its too hard to get it working the first time and I lack the time to do it. By providing lots of options, based on actual requirements or requests, a plugin can be pushed around to do anything you like it to. After figuring out how to use a plugin, its easy to learn how to customize it. I'm adding additonal features to my plugins once there are one or two requests for it, seems to work pretty well so far. I hope that babbling about my own experiences on those could answer your question a bit. -- Jörn Zaefferer http://bassistance.de ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] hoverIntent r5 = plug-in ready to be plugged-in
I'm happy to announce that my first plug-in, hoverIntent, is ready for general use. http://cherne.net/brian/resources/jquery.hoverIntent.html hoverIntent is a function that attempts to determine the user's intent onMouseOver. It works like, was derived from and is interchangeable with jQuery's built-in hover. However, instead of immediately calling the onMouseOver function, hoverIntent tracks the user's mouse and waits until it slows down enough before making the call. hoverIntent r5 ... is $-friendly ... has configurable options ... has onMouseOut timeout option Thanks for all the feedback from before. I hope this is the first of many plug-ins. :) Brian. P.S. How does one get their plug-in linked to from the jQuery plug-ins page? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] hoverIntent r3 -- animate vs. hoverIntent
I had to plug-in my mouse to test this one too. :) The solution was to use a self-calling timeout instead of an interval. That guarantees that the polling intervals (now polling timeouts, I guess) are spaced apart even if one fires later than expected. Argh. How frustrating. If only... Brian. On 3/26/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote: Brian, And thank you Dan -- you were actually much closer to the actual issue than my earlier hypotheses. Animate is not killing hoverIntent, but it is (occasionally) delaying one of the polling intervals, so that two are firing in very close succession. The only reason I suspect this as the root cause is I was having problems recreating the problem using the method you described. (But I was using my trackpoint and my circles were always of various sizes--precise control with a trackpoint is hard. Moving to a mouse--where my circles were very consistent--also popped up the problem.) However, if I moved the cursor back-n-forth in a straight line I noticed the problem. This just got me thinking that the problem probably had to do w/the interval delay and the current mouse positioning. -Dan ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Quality control for plugins
I don't know how I'd feel about being forced to create a getting started, code samples, faq and download area. At some point we'll be asking too much of plug-in authors... but while we're making a list... :) - $-friendly wrapper (as stated before) - jslint error-free (one step up form missing semi-colons) - javadoc commenting of plug-in external interface - clearly stated license in jquery.plugin.js file I've been using Javadoc commenting in my code for a few years now. It's been really nice when going back to fix old bugs or review code because the standardized comments make it easier to understand what's going in and coming out of a function. As for licensing, on my first jQuery project (back in January) the client had a strict no-GPL policy and lawyers found the dual license language confusing. Also, many plug-ins have no explicit license, so I had to seek written permission from the plug-in authors to satisfy the client's lawyers. The wording the lawyers didn't like was the MIT AND GPL (in jquery.jsitself). The better wording comes from the jQuery.com: (the second sentence being the important one) jQuery is currently available for use in all personal or commercial projects under both MIT and GPL licenses. This means that you can choose the license that best suits your project, and use it accordingly. Brian. On 3/26/07, Ariel Jakobovits [EMAIL PROTECTED] wrote: you know what else would be nice in this standard interface? An include of a search from the jQuery archives of any discussions related to that plugin. - Original Message From: Matt2012 [EMAIL PROTECTED] To: discuss@jquery.com Sent: Monday, March 26, 2007 5:01:31 AM Subject: Re: [jQuery] Quality control for plugins I wonder if its worth having a standard interface for plugin support pages. i.e. the jquery form plugin (http://www.malsup.com/jquery/form/) is a great example with getting started, api, code samples, faq and download areas whereas other great plugins have sometimes very confusing support pages ..just a thought.. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Quality control for plugins
The Java engineers at my company told me about Javadoc... I didn't even think to look for JSDoc... but it's essentially the same. I haven't needed to extract the Javadoc code into a MSWord document, but I think such tools already exist. I'll ask around. The other day when I gave Aptana a trial-run I was happily surprised to see it reading my Javadoc comments into a tooltip when I paused while thinking what parameters does this function take again... But the biggest benefit is just in having consistent commenting of functions. For instance, the Javadoc for my plug-in will read something like: /** * hoverIntent is similar to jQuery's built-in hover function except that * instead of firing the onMouseOver event immediately, hoverIntent checks * to see if the user's mouse has slowed down over the object (beneath the * sensitivity threshold) before firing the onMouseOver event. * * hoverIntent r4 // 2007.03.26 // jQuery 1.1.2 * http://cherne.net/brian/resources/jquery.hoverIntent.html * * hoverIntent is currently available for use in all personal or commercial * projects under both MIT and GPL licenses. This means that you can choose * the license that best suits your project, and use it accordingly. * * // basic usage (just like .hover) receives onMouseOver and onMouseOut functions * $(ul li).hoverIntent( showNav , hideNav ); * * // advanced usage receives configuration object only * $(ul li).hoverIntent({ *sensitivity: 2, // number = sensitivity threshold (must be 1 or higher) *interval: 50, // number = milliseconds of polling interval *over: showNav, // function = onMouseOver callback (required) *timeout: 0, // number = milliseconds delay before onMouseOut function call *out: hideNav// function = onMouseOut callback (required) * }); * * @param f onMouseOver function || An object with configuration options * @param g onMouseOut function || Nothing (use configuration options object) * @returnThe object (aka this) that called hoverIntent, and the event object * @authorBrian Cherne [EMAIL PROTECTED] */ (function($) { $.fn.hoverIntent = function(f,g) { }; })(jQuery); Now that's rather verbose, but I'm sure it'll help a year from now when I've forgotten all about it. :) Brian. On 3/26/07, Matt Kruse [EMAIL PROTECTED] wrote: - javadoc commenting of plug-in external interface Using what tool? jsDoc? I've found that jsDoc works great for class-based structures, but not so well for stand-along functions or library interfaces like jquery plugins. There should be some standard javadoc-style syntax, but not necessarily exactly as used in jsdoc. In any event, I think all plugins should certainly have embedded API documentation, and the jquery.com site itself should be able to present each plugin's API docs in the same format, using the same tool. I would also suggest implementing additional jquery-specific doc tags for dependencies, etc. I've yet to find a tool that I really like to parse and report on these javadoc-style tags with the flexibility that I want. I don't even want a js parser - I can provide the full documentation, function name, parameters, etc within my comments. So I started writing a tool in php that will output the documentation on-the-fly. Of course, it's about 10% done, like most things I start... Matt ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Quality control for plugins
(sorry Howard for hijacking your thread) Yes, the comments would be stripped from your compressed (packed/minified) code. However, there's nothing keeping you from copying/pasting a simplified comment block into the compressed code. So, for example, my minified plug-in would have the comment: /** * hoverIntent r4 // 2007.03.26 // jQuery 1.1.2 * http://cherne.net/brian/resources/jquery.hoverIntent.html * * @param f onMouseOver function || An object with configuration options * @param g onMouseOut function || Nothing (use configuration options object) * @returnThe object (aka this) that called hoverIntent, and the event object * @authorBrian Cherne [EMAIL PROTECTED] */ (function($){$.fn.hoverIntent=function(f,g){ };})(jQuery); Hopefully folks are submitting fully-commented/formated in addition to packed/minified files. This is even more important when you combine plug-in files together to reduce server requests... you'll need to keep track of where those plug-ins came from. This does fall apart on more complex plug-ins with multiple external interfaces. I can't think of one off the top of my head, but if your plug-in had a $().startPlugin *and* $().stopPlugin calls it would be hard to document that if they were contained in the same anonymous function($) call. Maybe using Javadoc as a standard is a nice-to-have, but not required...? Brian. On 3/26/07, Kenneth [EMAIL PROTECTED] wrote: Oh no, you're actually correct then. I thought you were asking if you could compress the code with the documentation included, not the other way around... Yeah, since the compressed code is only meant to be used and not modified or read, the documentation would be stripped, and therefore running any tool to gather such information would return nothing I (or very little). And that's if *my understanding is correct :P Sorry if I confused you! On 3/26/07, Christopher Jordan [EMAIL PROTECTED] wrote: Oh... that's exactly the reason I thought it *wouldn't* work. I don't really understand javadocs... this is the first I've heard of them... but it sounded like it took your comments and turned them into these docs. I thought that since compressed js usually has the comments stripped out, that it wouldn't work. I'm probably dead wrong, and should have just lurked this conversation, huh? ;o) Chris Kenneth wrote: It should as long as the compressor removes comments. On 3/26/07, *Christopher Jordan* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: That wouldn't work for compressed JS would it? Chris Brian Cherne wrote: The Java engineers at my company told me about Javadoc... I didn't even think to look for JSDoc... but it's essentially the same. I haven't needed to extract the Javadoc code into a MSWord document, but I think such tools already exist. I'll ask around. The other day when I gave Aptana a trial-run I was happily surprised to see it reading my Javadoc comments into a tooltip when I paused while thinking what parameters does this function take again... But the biggest benefit is just in having consistent commenting of functions. For instance, the Javadoc for my plug-in will read something like: /** * hoverIntent is similar to jQuery's built-in hover function except that * instead of firing the onMouseOver event immediately, hoverIntent checks * to see if the user's mouse has slowed down over the object (beneath the * sensitivity threshold) before firing the onMouseOver event. * * hoverIntent r4 // 2007.03.26 // jQuery 1.1.2 * http://cherne.net/brian/resources/jquery.hoverIntent.html http://cherne.net/brian/resources/jquery.hoverIntent.html * * hoverIntent is currently available for use in all personal or commercial * projects under both MIT and GPL licenses. This means that you can choose * the license that best suits your project, and use it accordingly. * * // basic usage (just like .hover) receives onMouseOver and onMouseOut functions * $(ul li).hoverIntent( showNav , hideNav ); * * // advanced usage receives configuration object only * $(ul li).hoverIntent({ *sensitivity: 2, // number = sensitivity threshold (must be 1 or higher) *interval: 50, // number = milliseconds of polling interval *over: showNav, // function = onMouseOver callback (required) *timeout: 0, // number = milliseconds delay before onMouseOut function call *out: hideNav// function = onMouseOut callback (required) * }); * * @param f onMouseOver function || An object with configuration options * @param g onMouseOut function
Re: [jQuery] Quality control for plugins
On 3/26/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: Unfortuanetely, Javadoc is a bit limited for documenting jQuery plugins. For example, most plugins offer options, that is, they accept a object whose properties are used to override any set defaults. How do you document all these options via Javadoc? That is a very good question and a serious limitation. Do you think no standard is better than an incomplete standard? Maybe someone should come up with jQueryDoc ;-) Thanks for writing/sharing your docTool. And back to Howard's initial message: Is there a standard for plug-ins to follow? Any plans to mark/filter one's that play by the rules? Perhaps http://jqueryplugins.com/ will take care of this. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] hoverIntent r3 -- animate vs. hoverIntent
I've updated the Firebug console.log messages. They are now showing: - coordinates from the polling interval - message when previous == current - message when mouseOut function is called An example of console.log: c= 444 956 c= 448 958 c= 485 939 c= 458 910 c= 424 951 c= 459 966 c= 440 925 li.p4; makeShort(){ animate() } c= 349 919 c= 349 919 li.p3; previous == current; makeTall() ... and there was no way my mouse was stationary at 349, 919. Note: It appears that animate() only needs to be called to kill mouseMove. It is not animate returning anything. Note: If I add a console.log() to hoverIntent's handleHover, to show when a mouseover has been triggered, this bug goes away. Adding console.log() to mouseMove also alters the playing field. I really hate it when taking a measurement alters your experiment in a significant way. Note: This bug does not happen on my Mac in Firefox. It only happens in Firefox on my WinXP laptop. Later today/tomorrow I'll test a few other machines and report back. (I hope it's not just my laptop). I will also try storing the console.log() output in a buffer string to see if I can get any meaningful data from mouseMove/handleHover. Brian. On 3/24/07, Brian Cherne [EMAIL PROTECTED] wrote: If the mouse is in the target zone and you're moving it, the mouseOver event should not be triggered. You can test this by mousing over just one of the target LI tags. If you stay within that LI and keep your mouse moving the sensitivity threshold is never met (because for sake of testing I reduced it to 1... so the mouse has to be motionless for the threshold to be crossed). When you mouseOut of li.p4 into li.p3 (for example), li.p3's mouseOver event should not be triggered as long as your mouse is moving. However, li.p4's mouseOut function for some reason trips up li.p3's hoverIntent function... or more specifically li.p3's mousemove listener. Without that listener the coordinates for your mouse do not update, so the polling interval (which compares coordinates) thinks your mouse has stopped moving. Turning the polling interval down would only speed up this last step (coordinate comparison). Otherwise it has no effect. Once this bug is fixed, I'll dial it down and increase the threshold to an acceptable level. Removing animate() from the mouseOut function is the only thing that stops this bug from happening. In Firebug, I'm logging what object (li) is inside compareMouseCoordinates(). If you change that to show the mouse coordinates, you'll see that they are frozen after another li's animate mouseOut function is called. Brian. On 3/24/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote: Brian, From my playing around it seems that it gets triggered because mouse is in the target zone at each check (even though it's been moved around a lot.) Does the bug go away if you lower the interval way down? -Dan -- *From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf Of *Brian Cherne *Sent:* Saturday, March 24, 2007 7:44 PM *To:* jQuery Discussion *Subject:* [jQuery] hoverIntent r3 -- animate vs. hoverIntent I've re-written hoverIntent since the last time I posted. It now has configurable options, a mouseOut timeout, and is $-friendly. However, not all is good in the land of hoverIntent. I've been struggling with this one bug for a while (hence the delay since my last update) and I've finally (sucked up my pride and) decided to approach the list for help. I have some example code on my web site that explains the problem in detail. http://cherne.net/brian/resources/jquery.hoverIntent.html (demo requires Firefox and Firebug) Simply put, when multiple instances of hoverIntent are in-play the mouseOut of one can kill the mouseMove of another. This happens when the mouseOut uses animate(). Functions like html() do not kill the other instance of hoverIntent. And when hoverIntent is killed, the polling interval lives on (presumably because timers/intervals live in a different context). Unfortunately, the mouseMove function of hoverIntent isn't updating the current set of mouse coordinates (because it was killed), so the polling interval compares frozen coordinates and of course they're the same, thus triggering an accidental mouseOver. I can see the symptoms, but I don't understand what's going on. Can someone explain what's happening and suggest a way to fix it? And why it breaks with animate() but not html() is also a mystery... Note, this problem exists in the much simpler r1. It is not something I introduced with the inclusion of the mouseOut timeout. Thanks in advance, Brian. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] hoverIntent r3 -- animate vs. hoverIntent
I'm going to stop replying to myself now :) I'm getting closer to the answer and I think I can walk it in from here. And thank you Dan -- you were actually much closer to the actual issue than my earlier hypotheses. Animate is not killing hoverIntent, but it is (occasionally) delaying one of the polling intervals, so that two are firing in very close succession. Hopefully my next posting will have an official ready for production plug-in announcement. :) Brian. On 3/25/07, Brian Cherne [EMAIL PROTECTED] wrote: I've updated the Firebug console.log messages. They are now showing: - coordinates from the polling interval - message when previous == current - message when mouseOut function is called An example of console.log: c= 444 956 c= 448 958 c= 485 939 c= 458 910 c= 424 951 c= 459 966 c= 440 925 li.p4; makeShort(){ animate() } c= 349 919 c= 349 919 li.p3; previous == current; makeTall() ... and there was no way my mouse was stationary at 349, 919. Note: It appears that animate() only needs to be called to kill mouseMove. It is not animate returning anything. Note: If I add a console.log() to hoverIntent's handleHover, to show when a mouseover has been triggered, this bug goes away. Adding console.log() to mouseMove also alters the playing field. I really hate it when taking a measurement alters your experiment in a significant way. Note: This bug does not happen on my Mac in Firefox. It only happens in Firefox on my WinXP laptop. Later today/tomorrow I'll test a few other machines and report back. (I hope it's not just my laptop). I will also try storing the console.log() output in a buffer string to see if I can get any meaningful data from mouseMove/handleHover. Brian. On 3/24/07, Brian Cherne [EMAIL PROTECTED] wrote: If the mouse is in the target zone and you're moving it, the mouseOver event should not be triggered. You can test this by mousing over just one of the target LI tags. If you stay within that LI and keep your mouse moving the sensitivity threshold is never met (because for sake of testing I reduced it to 1... so the mouse has to be motionless for the threshold to be crossed). When you mouseOut of li.p4 into li.p3 (for example), li.p3's mouseOver event should not be triggered as long as your mouse is moving. However, li.p4's mouseOut function for some reason trips up li.p3's hoverIntent function... or more specifically li.p3's mousemove listener. Without that listener the coordinates for your mouse do not update, so the polling interval (which compares coordinates) thinks your mouse has stopped moving. Turning the polling interval down would only speed up this last step (coordinate comparison). Otherwise it has no effect. Once this bug is fixed, I'll dial it down and increase the threshold to an acceptable level. Removing animate() from the mouseOut function is the only thing that stops this bug from happening. In Firebug, I'm logging what object (li) is inside compareMouseCoordinates(). If you change that to show the mouse coordinates, you'll see that they are frozen after another li's animate mouseOut function is called. Brian. On 3/24/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote: Brian, From my playing around it seems that it gets triggered because mouse is in the target zone at each check (even though it's been moved around a lot.) Does the bug go away if you lower the interval way down? -Dan -- *From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf Of *Brian Cherne *Sent:* Saturday, March 24, 2007 7:44 PM *To:* jQuery Discussion *Subject:* [jQuery] hoverIntent r3 -- animate vs. hoverIntent I've re-written hoverIntent since the last time I posted. It now has configurable options, a mouseOut timeout, and is $-friendly. However, not all is good in the land of hoverIntent. I've been struggling with this one bug for a while (hence the delay since my last update) and I've finally (sucked up my pride and) decided to approach the list for help. I have some example code on my web site that explains the problem in detail. http://cherne.net/brian/resources/jquery.hoverIntent.html (demo requires Firefox and Firebug) Simply put, when multiple instances of hoverIntent are in-play the mouseOut of one can kill the mouseMove of another. This happens when the mouseOut uses animate(). Functions like html() do not kill the other instance of hoverIntent. And when hoverIntent is killed, the polling interval lives on (presumably because timers/intervals live in a different context). Unfortunately, the mouseMove function of hoverIntent isn't updating the current set of mouse coordinates (because it was killed), so the polling interval compares frozen coordinates and of course they're the same, thus triggering an accidental mouseOver. I can see the symptoms, but I don't understand what's going on. Can someone explain
Re: [jQuery] getting the selectedIndex of a dynamic select
var valueOfSelected = $(#list [EMAIL PROTECTED]).val(); And, instead of onClick you probably want to use onChange. Note, when you are in the function this refers to the DOM object that fired the event (that has selectedIndex). When you wrap it in $(this) you then have the jQuery object (which does not have selectedIndex, but can be used for all other jQuery events/methods). I hope this helps, Brian. On 3/24/07, narven [EMAIL PROTECTED] wrote: Hi, Im having some problems getting the value of selectedIndex of a select box. im using... // this is populated dynamic using ajax select id=list name=list size=15/select $(function() { $('#list').bind('click', function() { alert( $(this).selectedIndex ); }); }) But always gives me undefined :| ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] hoverIntent r3 -- animate vs. hoverIntent
I've re-written hoverIntent since the last time I posted. It now has configurable options, a mouseOut timeout, and is $-friendly. However, not all is good in the land of hoverIntent. I've been struggling with this one bug for a while (hence the delay since my last update) and I've finally (sucked up my pride and) decided to approach the list for help. I have some example code on my web site that explains the problem in detail. http://cherne.net/brian/resources/jquery.hoverIntent.html (demo requires Firefox and Firebug) Simply put, when multiple instances of hoverIntent are in-play the mouseOut of one can kill the mouseMove of another. This happens when the mouseOut uses animate(). Functions like html() do not kill the other instance of hoverIntent. And when hoverIntent is killed, the polling interval lives on (presumably because timers/intervals live in a different context). Unfortunately, the mouseMove function of hoverIntent isn't updating the current set of mouse coordinates (because it was killed), so the polling interval compares frozen coordinates and of course they're the same, thus triggering an accidental mouseOver. I can see the symptoms, but I don't understand what's going on. Can someone explain what's happening and suggest a way to fix it? And why it breaks with animate() but not html() is also a mystery... Note, this problem exists in the much simpler r1. It is not something I introduced with the inclusion of the mouseOut timeout. Thanks in advance, Brian. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] hoverIntent r3 -- animate vs. hoverIntent
If the mouse is in the target zone and you're moving it, the mouseOver event should not be triggered. You can test this by mousing over just one of the target LI tags. If you stay within that LI and keep your mouse moving the sensitivity threshold is never met (because for sake of testing I reduced it to 1... so the mouse has to be motionless for the threshold to be crossed). When you mouseOut of li.p4 into li.p3 (for example), li.p3's mouseOver event should not be triggered as long as your mouse is moving. However, li.p4's mouseOut function for some reason trips up li.p3's hoverIntent function... or more specifically li.p3's mousemove listener. Without that listener the coordinates for your mouse do not update, so the polling interval (which compares coordinates) thinks your mouse has stopped moving. Turning the polling interval down would only speed up this last step (coordinate comparison). Otherwise it has no effect. Once this bug is fixed, I'll dial it down and increase the threshold to an acceptable level. Removing animate() from the mouseOut function is the only thing that stops this bug from happening. In Firebug, I'm logging what object (li) is inside compareMouseCoordinates(). If you change that to show the mouse coordinates, you'll see that they are frozen after another li's animate mouseOut function is called. Brian. On 3/24/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote: Brian, From my playing around it seems that it gets triggered because mouse is in the target zone at each check (even though it's been moved around a lot.) Does the bug go away if you lower the interval way down? -Dan -- *From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf Of *Brian Cherne *Sent:* Saturday, March 24, 2007 7:44 PM *To:* jQuery Discussion *Subject:* [jQuery] hoverIntent r3 -- animate vs. hoverIntent I've re-written hoverIntent since the last time I posted. It now has configurable options, a mouseOut timeout, and is $-friendly. However, not all is good in the land of hoverIntent. I've been struggling with this one bug for a while (hence the delay since my last update) and I've finally (sucked up my pride and) decided to approach the list for help. I have some example code on my web site that explains the problem in detail. http://cherne.net/brian/resources/jquery.hoverIntent.html (demo requires Firefox and Firebug) Simply put, when multiple instances of hoverIntent are in-play the mouseOut of one can kill the mouseMove of another. This happens when the mouseOut uses animate(). Functions like html() do not kill the other instance of hoverIntent. And when hoverIntent is killed, the polling interval lives on (presumably because timers/intervals live in a different context). Unfortunately, the mouseMove function of hoverIntent isn't updating the current set of mouse coordinates (because it was killed), so the polling interval compares frozen coordinates and of course they're the same, thus triggering an accidental mouseOver. I can see the symptoms, but I don't understand what's going on. Can someone explain what's happening and suggest a way to fix it? And why it breaks with animate() but not html() is also a mystery... Note, this problem exists in the much simpler r1. It is not something I introduced with the inclusion of the mouseOut timeout. Thanks in advance, Brian. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Jquery can learn from Mootools for distribution its code
I really like the one-size fits all idea. At ~20k it's really not bad (even on high traffic sites). While I don't use all of jQuery's functions on a given project it's really nice to know what's available to me... without having to patch the base library. It will be really tricky to write complex plug-ins for customized jQuery base packages. Plug-in writers will need to state overtly what $.x, $.y and $.z's are required for their plug-in to work. And I think between my custom code and my most favorite/used plug-ins (tabs, jqModal, etc) I would end up using most of the jQuery library anyhow. But then again, when I found jQuery I didn't think writing JavaScript could be made as easy / as fun as jQuery has made it. Perhaps John has some nifty idea to maintain jQuery's simplicity while allowing for customization/efficiency. :) Brian. On 3/23/07, Andy Matthews [EMAIL PROTECTED] wrote: I'm not as concerned with file size as I once was. ~20k is smaller than a single medium-sized JPG. Plus, once it gets cached, the file size is no longer an issue. I'm all for smaller file size, but I'd much rather see new development in speed or functionality than have you devs spend time building this packaging tool. andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of agent2026 Sent: Friday, March 23, 2007 5:16 AM To: discuss@jquery.com Subject: Re: [jQuery] Jquery can learn from Mootools for distribution its code I tend to be in this camp as well. At 20k packed, I don't really see the point of breaking it all up. And with people's use of plugins, I'd be interested to see a breakdown of customized vs full package downloads. There's been much debate on this, but in the end I guess we must trust the devs for a solution most will be satisfied with. Adam Matt Kruse-2 wrote: The benefit of having a single (small) package is that the same functionality is there all the time, every time. You don't have different versions of js files on different pages and being cached separately. You don't wonder why plugin X doesn't work, then realize that you have package Y of jQuery instead of package Z. Instead of plugins just requiring jQuery, they would require components A, B, and C of jQuery. It just adds a whole level of confusion. Matt Kruse ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/Jquery-can-learn-from-Mootools-for-distribution-its-co de-tf3449500.html#a9631954 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] hoverIntent = my first plug-in
SHORT ANSWER: hoverIntent will not work onMouseOver/onMouseOut. The children would be firing events, starting and stopping timers, resetting mouse coordinates, etc. It would be a mess. The reason hoverIntent works (well, almost works... there are still some bugs) is that it tracks mouse movement over a larger area (regardless of nested children). LONG ANSWER: I chose to mimic jQuery's hover function because it implements a cross-browser type of IE's onMouseEnter / onMouseLeave. Without that, onMouseOver and onMouseOut will fire your functions on every child, grandchild, etc. If you attached onMouseOver and onMouseOut to the ul both events would fire when you mouse over every LI, A, and SPAN inside that UL... and you'd have to cancel the effects of each and perform all those calculations of determining what to do based on who fired the event... it's a world of hurt/pain. I'm sorry if you already understood this and were simply asking me to assist you in your masochistic tendencies ;) If you're just looking for the intent part of hoverIntent, you could a) pull out my code and use it in yours, or b) call a function on hoverIntent that binds/allows your desired onMouseOver/Out functions to work. Something like: $(ul).hoverIntent( inflictPain, useSafeWord ); $(ul li).mouseover( showMenu ); function inflictPain(){ var enableMenus = true; } function useSafeWord(){ var enableMenus = false; } function showMenu(){ if ( !enableMenus ) { return; } } c) use all those nifty css/xpath selectors that jQuery provides to target the menu/submenu LIs specifically with hover/hoverIntent. Of course, I don't know your exact situation. Perhaps mouseover/mouseout is the right solution. Brian. On 3/22/07, George Adamson [EMAIL PROTECTED] wrote: An excellent idea that works very elegantly. Well done Brian. Might I suggest one more simple config setting... To optionally skip the following check in your handleHover function: if (p == this){return false;} Why? Because I'm using hoverIntent in a hierarchical menu built with *nested* ulli... elements. Without the check for p==this I only need to apply hoverIntent to the top level menu (instead of all the submenus too, and I'm working on a page with many submenus- don't ask!). So an extra config option could be something like ignoreSubElements:true by default then you just need to change the line in handleHover() to if (cfg.ignoreSubElements p == this){return false;} Kind regards, George Brian Cherne wrote: WHAT? hoverIntent is a function that attempts to determine the user's intent... like a crystal ball, only with mouse movement! It works like (and was derived from) jQuery's built-in hover. However, instead of immediately calling the onMouseOver function, it waits until the user's mouse slows down enough before calling the function. WHERE? My sorely out-dated web site. http://cherne.net/brian/resources/jquery.hoverIntent.html WHY? To delay or prevent the accidental firing of animations or ajax calls. Simple timers work for small areas, but if your target area is large it may execute regardless of intent. Also, because jQuery animations cannot be stopped once they've started it's best not to start them prematurely. ... and I wanted something that was easy to swap in/out with hover (so hoverIntent returns the same this and event objects as hover). WHAT'S NEXT? Your feedback! Tear it shreds! Tell me what you think. I would like to keep the script as small as possible, but if I could make this more useful (and more likely to be used) I'm happy to make some enhancements... like... - more compelling/verbose demo/documentation - ability to override default settings (sensitivity, polling interval, etc) - option of a simple onMouseOut timer - make it more jQuery $-friendly (first few attempts have failed) - suggestions for code style/commenting/optimization Thanks in advance, Brian. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/hoverIntent-%3D-my-first-plug-in-tf3394660.html#a9610472 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] (OT) DED|Chain
I have a hard enough time selling jQuery's 20 KB overhead. DED|Chain's 100 KB download is not practical for real-world sites. Not to mention the pronunciation of DED|Chain comes off sounding like Dead Chain... and that just makes it sound so informal / less business-like. But I like this guy's initiative and appreciate the hard work... if anything this will probably help give jQuery more exposure. Brian. On 3/20/07, Kush Murod [EMAIL PROTECTED] wrote: looks good personally though, I prefer JQuery because it is simple and importantly tiny-mini :) Yansky wrote: I just saw this as I was browsing delicious. It seems to be another new library. It's based on YUI has the developer friendliess of jQuery. http://dedchain.dustindiaz.com/ -- Kush Murod, Web applications developer Sensory Networks [E] [EMAIL PROTECTED] [W] www.sensorynetworks.com [T] +61 2 8302 2745 [F] +61 2 9475 0316 [A] Level 6, 140 William Street East Sydney 2011 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Plugins mailing list
Plugins should still be *announced* here, though, so the people who don't subscribe to the plugins mailing list know that they exist. :) - Brian Hi everyone, It seems the new place to post plugin-related stuff is in the plugins mailing list ([EMAIL PROTECTED]). I didn't even know about this list until just recently, so not sure how advertised it is. Anyways just a heads-up in case, like me, you didn't realise it was there :) Chris ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] how do i get LI's UL tag id?
Also, be careful, according to the spec: *ID* and *NAME* tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens (-), underscores (_), colons (:), and periods (.). You can probably get away with using just a number for an ID, but if you start noticing strange behavior in otherwise standard-compliant browsers, this could be the cause. Brian. On 3/19/07, Yansky [EMAIL PROTECTED] wrote: If you want to find the parent element's id of li class=weddy_menu id=5aga/li, you could do something like this: $('#5').parent('ul').attr(id); talkz wrote: hey i have this code, how can i get the visible / hidden from the uls? when i change the sort, i know what id i have on the div, but i want to know what is the ul my moved li is on.. jquery: $('#visible,#hidden').Sortable({ accept : 'weddy_menu', opacity:0.2, onChange: function (sorted) { var bb=# + $(.weddy_menu).attr(id); } }); html: div ul id=visible li class=weddy_menu id=1dook/li li class=weddy_menu id=4rook/li /ul /div hr div ul class=menu_admin id=hidden li class=weddy_menu id=5aga/li li class=weddy_menu id=6baba/li li class=weddy_menu id=7saba/li /ul /div -- View this message in context: http://www.nabble.com/how-do-i-get-%3CLI%3E%27s-UL-tag-id--tf3427869.html#a9556931 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] the pitfalls of jquery
Of course Benjamin knows that this list is public and indexed by search engines (at least Google), so he wouldn't actually rename jQuery to bQuery and honestly think he could get away with it. ;) Good luck! Brian. On 3/16/07, Chris Ovenden [EMAIL PROTECTED] wrote: On 3/15/07, Benjamin Sterling [EMAIL PROTECTED] wrote: I've worked on a project for about two months now that uses jquery for everything. Using such plugins as jqModal, blockUI, jqDebug, jqQuick, dimensions plugin, form plugin, and jqHighlightFade as well as some code I pulled out of other plugins (nextUntil (Jorn), bgIframe(?), pngFixer(actual code came from a post on the forum, I just made it into a chain-able plugin) and well as other plugins specific to this app. Feel free to take a look: http://ov-oba.informationexperts.com/ (there are a bunch of style issues I am working on now) Now coming into jQuery I new a good amount of javascript, not an expert but pretty good. But the point to this message is to show how jquery has made my life much harder. Today, I was given a project which would entail using a lot of javascript for ajax calls and some other basic stuff, and the problems is, I CAN'T USE JQUERY I feel your pain. I had to port some of my jQuery code to an eBay listing, which has very strict rules about what js functions are allowed (though won't say which exact ones). Ended up rewriting the whole lot in standard js. It's quite good for the soul ;-) That said, if your restriction is purely ideological, I'd say go with the renaming thing. Chris -- Chris Ovenden http://thepeer.blogspot.com Imagine all the people / Sharing all the world ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] hoverIntent = my first plug-in
WHAT? hoverIntent is a function that attempts to determine the user's intent... like a crystal ball, only with mouse movement! It works like (and was derived from) jQuery's built-in hover. However, instead of immediately calling the onMouseOver function, it waits until the user's mouse slows down enough before calling the function. WHERE? My sorely out-dated web site. http://cherne.net/brian/resources/jquery.hoverIntent.html WHY? To delay or prevent the accidental firing of animations or ajax calls. Simple timers work for small areas, but if your target area is large it may execute regardless of intent. Also, because jQuery animations cannot be stopped once they've started it's best not to start them prematurely. ... and I wanted something that was easy to swap in/out with hover (so hoverIntent returns the same this and event objects as hover). WHAT'S NEXT? Your feedback! Tear it shreds! Tell me what you think. I would like to keep the script as small as possible, but if I could make this more useful (and more likely to be used) I'm happy to make some enhancements... like... - more compelling/verbose demo/documentation - ability to override default settings (sensitivity, polling interval, etc) - option of a simple onMouseOut timer - make it more jQuery $-friendly (first few attempts have failed) - suggestions for code style/commenting/optimization Thanks in advance, Brian. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Reference to the element that triggered the event (Karl Rudd)
Hi John, I think what you want is event.target $(li.selectable).click(function(e){console.log(e.target)}); http://docs.jquery.com/Events_%28Guide%29 I'm so happy I bookmarked that page because I can't find a link to it anywhere (not even on Google!). Is it old/new? Brian. On 3/13/07, John Cotton [EMAIL PROTECTED] wrote: Thanks Karl. However, that doesn't give me what I'm after...:) A little more explanation. This is my pseudo-HTML li class=selectable content content content a href=##1some link/a content content content content content content img src=## / content content content content content content content content content content content content a href=##1some link/a /li Clicking on any element within this block will trigger the event. But I want to know if the A or IMG elements were clicked. Your suggestion returns me li regardless of where I click. Thanks again. John Date: Tue, 13 Mar 2007 11:45:11 +1100 From: Karl Rudd [EMAIL PROTECTED] Subject: Re: [jQuery] Reference to the element that triggered the event To: jQuery Discussion. discuss@jquery.com Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=UTF-8; format=flowed You don't actually need the * at the start of the selector, it's implicitly there. In the click function, to work out what has been clicked, you can do: var tag = this.nodeName.toLowerCase(); Tag should be the tag name. Karl Rudd On 3/13/07, John Cotton [EMAIL PROTECTED] wrote: Sorry if this is a really thick question, but I've hunted for over an hour on the website/Google/anywhere to find this and am getting nowhere. I have the following code: $(*.selectable).click( function(e) { $(this).toggleClass(selected); saveCookie($(this).attr(id), $(this).attr(class).indexOf(selected)); }); which works fine. But I want to know which element within *.selectable was actually clicked (eg an anchor, an image etc). How do I do that? Thanks in advance John -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.9/719 - Release Date: 12/03/2007 08:41 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ http://jquery.com/discuss/ -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.9/719 - Release Date: 12/03/2007 08:41 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] hoverIntent = my first plug-in
Awesome! Thanks for all the positive feedback everyone! What a way to wake up in the morning. :) The next release will have configurable settings for sensitivity and polling interval. I'll try wrapping the plug-in in a self-calling function, but the last few times I've done that I got JavaScript errors. Is there some trick to it? Brian. On 3/13/07, Brandon Aaron [EMAIL PROTECTED] wrote: Very nice. I believe this will be getting a fair amount of usage! - ability to override default settings (sensitivity, polling interval, etc) This would be great and probably should be done by passing an options hash as the third argument. Usually options as passed as the first argument in plugins but it makes sense to be the third in this case. I would imagine it looking something like this: jQuery.fn.hoverIntent = function(f,g,o) { o = jQuery.extend({ sensitivity: 4, interval: 100 }, o || {}); ... }; - make it more jQuery $-friendly (first few attempts have failed) As already mentioned by Klaus, you can force block scope by wraping your code in the following self calling function. (function($) { ... })(jQuery); -- Brandon Aaron On 3/13/07, Brian Cherne [EMAIL PROTECTED] wrote: WHAT? hoverIntent is a function that attempts to determine the user's intent... like a crystal ball, only with mouse movement! It works like (and was derived from) jQuery's built-in hover. However, instead of immediately calling the onMouseOver function, it waits until the user's mouse slows down enough before calling the function. WHERE? My sorely out-dated web site. http://cherne.net/brian/resources/jquery.hoverIntent.html WHY? To delay or prevent the accidental firing of animations or ajax calls. Simple timers work for small areas, but if your target area is large it may execute regardless of intent. Also, because jQuery animations cannot be stopped once they've started it's best not to start them prematurely. ... and I wanted something that was easy to swap in/out with hover (so hoverIntent returns the same this and event objects as hover). WHAT'S NEXT? Your feedback! Tear it shreds! Tell me what you think. I would like to keep the script as small as possible, but if I could make this more useful (and more likely to be used) I'm happy to make some enhancements... like... - more compelling/verbose demo/documentation - ability to override default settings (sensitivity, polling interval, etc) - option of a simple onMouseOut timer - make it more jQuery $-friendly (first few attempts have failed) - suggestions for code style/commenting/optimization Thanks in advance, Brian. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] hoverIntent = my first plug-in
Thanks Jonathan. A simple onMouseOut interval should not be hard to add. Of course it will be of a user-configurable duration. :) The hover part of hoverIntent should be intact (I lifted that part of the code straight out of jQuery). I will add that to the description/demo, eventually, to make it clear... and if there's a situation where that's not the case please send me some code or a URL so I can see what's broken. I'm not sure if I'll have time tonight to work on the plug-in. But within the next few days ... I'll post again when there's an update. Brian. On 3/13/07, Jonathan Sharp [EMAIL PROTECTED] wrote: Hey Brian, Great work! I have an immediate application for this and once it's a plugin will use it for jdMenu ( http://jdsharp.us/code/jQuery/plugins/jdMenu/)! I never thought about abstracting that behavior out but it is so clean and simple now. Great work again! After looking over your code (and fighting myself for feature bloat) I'd like to suggest the possibility of having two intervals one for mouseover and one for mouseout. The mouseout delay is very useful for example with menus when users unintentionally mouseout when moving to a sub-menu. One other suggestion is adding in support for handling the child node issue that hover addresses. So if there's a child element of say the LI that gains hover a mouseout for the parent LI won't be fired. Great work and I look forward to this! Cheers, -Jonathan On 3/13/07, Brian Cherne [EMAIL PROTECTED] wrote: Awesome! Thanks for all the positive feedback everyone! What a way to wake up in the morning. :) The next release will have configurable settings for sensitivity and polling interval. I'll try wrapping the plug-in in a self-calling function, but the last few times I've done that I got JavaScript errors. Is there some trick to it? Brian. On 3/13/07, Brandon Aaron [EMAIL PROTECTED] wrote: Very nice. I believe this will be getting a fair amount of usage! - ability to override default settings (sensitivity, polling interval, etc) This would be great and probably should be done by passing an options hash as the third argument. Usually options as passed as the first argument in plugins but it makes sense to be the third in this case. I would imagine it looking something like this: jQuery.fn.hoverIntent = function(f,g,o) { o = jQuery.extend({ sensitivity: 4, interval: 100 }, o || {}); ... }; - make it more jQuery $-friendly (first few attempts have failed) As already mentioned by Klaus, you can force block scope by wraping your code in the following self calling function. (function($) { ... })(jQuery); -- Brandon Aaron On 3/13/07, Brian Cherne [EMAIL PROTECTED] wrote: WHAT? hoverIntent is a function that attempts to determine the user's intent... like a crystal ball, only with mouse movement! It works like (and was derived from) jQuery's built-in hover. However, instead of immediately calling the onMouseOver function, it waits until the user's mouse slows down enough before calling the function. WHERE? My sorely out-dated web site. http://cherne.net/brian/resources/jquery.hoverIntent.html WHY? To delay or prevent the accidental firing of animations or ajax calls. Simple timers work for small areas, but if your target area is large it may execute regardless of intent. Also, because jQuery animations cannot be stopped once they've started it's best not to start them prematurely. ... and I wanted something that was easy to swap in/out with hover (so hoverIntent returns the same this and event objects as hover). WHAT'S NEXT? Your feedback! Tear it shreds! Tell me what you think. I would like to keep the script as small as possible, but if I could make this more useful (and more likely to be used) I'm happy to make some enhancements... like... - more compelling/verbose demo/documentation - ability to override default settings (sensitivity, polling interval, etc) - option of a simple onMouseOut timer - make it more jQuery $-friendly (first few attempts have failed) - suggestions for code style/commenting/optimization Thanks in advance, Brian. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Custome selectors use : as seperator, which is an official character for id's
I second this suggestion. Most other meta-languages allow backslash-escaping, I don't see why it would be a bad idea here. - Brian I didn't like the idea of hacking jQuery to make selectors with these special chars work, but as it turned out, that is what should be expected! From the CSS spec: In CSS 2.1, a backslash (\) character indicates three types of character escapes. [...] *Second, it cancels the meaning of special CSS characters.* Any character (except a hexadecimal digit) can be escaped with a backslash to remove its special meaning. For example, \ is a string consisting of one double quote. Style sheet preprocessors must not remove these backslashes from a style sheet since that would change the style sheet's meaning. http://www.w3.org/TR/CSS21/syndata.html#q6 Thus, I think a selector like #my\:elem is perfectly valid and that should be part of jQuery's selector engine... -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] What is the status on the Ext port?
Given that it would be Jack's call, I'd say no. Ext has a very Java-like OO design. It would be hard work to squeeze what he's doing into jQuery calling conventions. That doesn't rule out Jack surprising us and doing all that work anyway. But, that's not where I'd put my money if I were a betting man. :) That also doesn't rule out a plugin-for-the-plugin that simply gives you a new interfafce on the calls. But, someone here would have to do that after the port is complete. - Brian Last question - it looks like the ext port is just using jQuery for the mechanics of ext itself. Are there plans to port the ext functions to jQuery syntax? John Resig wrote: Ext 1.0 Alpha 2 is already running on jQuery: http://www.yui-ext.com/forum/viewtopic.php?t=3084 We're working to make some improvements to jQuery to better handle the demanding animations that Ext requires. But yeah, you can begin using it now! We were waiting for Jack to make an official announcement, but it doesn't seem to have come out yet - so we may just announce this officially, anyway. --John On 3/5/07, Daemach [EMAIL PROTECTED] wrote: I, like probably everyone else on this list, is anxiously awaiting the port of EXT to jQuery. Is there a timeline for this? I am about ready to rebuild one of my clients sites and would very much like to use the ext components as a base. -- View this message in context: http://www.nabble.com/What-is-the-status-on-the-Ext-port--tf3349725.html#a9314336 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/What-is-the-status-on-the-Ext-port--tf3349725.html#a9316661 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.1.2
Expandos are not proprietary to Microsoft. They are custom attributes. For instance: var oDiv = document.getElementById('myDiv'); oDiv.collapsible = true; // safe expando var oSpan = document.getElementById('mySpan'); oDiv.relatedSpan = oSpan; // potentially dangerous expando oDiv.relatedSpanId = oSpan.id; // safe expando Please correct me if I'm understanding this the wrong way. Strings are safe. Object references are not. I haven't had time to read the MSDN article from the previous reply, but I'm pretty sure this is what they're talking about. Brian. On 3/1/07, Chris Ovenden [EMAIL PROTECTED] wrote: I'm confused. Are these expandos proprietory Microsoft attributes with a specific meaning, or can it also apply to a non-standard attribute that I may invent for a particular purpose (eg all collapsible elements on a page might have a custom attribute collapsible=true)? If it's the latter, I don't see how such attributes can reference anything at all, at least as far as the DOM model is concerned. They're just strings. Personally I avoid this kind of extra attribute; class is a pretty good catch-all for most needs of this kind. I know you can make them valid HTML by extending the DTD, but that seems like a lot of extra work for not much gain. Chris On 3/1/07, Karl Rudd [EMAIL PROTECTED] wrote: I believe so. As I said an expando attribute is basically any non-standard attribute that gets added to an element (doesn't matter how). As Klaus notes, the memory leakage is only a problem in IE when the attribute references other DOM elements (directly, or indirectly via closures). Karl Rudd On 3/1/07, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote: so any non standard attribute accessed simple as object.hello is an expando? no matter if you call getAttribute or not?? On 2/28/07, Karl Rudd [EMAIL PROTECTED] wrote: Err no, actually expandos refers to non-standard attributes that get added to DOM elements. They expand the attributes that are available on an element. For instance adding an expando attribute called hello: input type=submit value=blah hello=Hello world! Because they're non-standard they can cause memory leak problems under Internet Explorer if they refer to other DOM elements. More info here: http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/expando.asp Karl Rudd On 3/1/07, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote: Fil, did you ever get a definition of DOM 0 expandos... they're the shortcuts that were provided with dom level 0, that are short cuts for certain html(only) attributes, and collections of dom nodes. like a.href is an 'expando' whereas a. a.getAttribute('href') is not. and document.forms is an expando whereas a.getElementsbyTagname('form') is not. I'm pretty sure thats what it means! bonne chance! On 2/28/07, Fil [EMAIL PROTECTED] wrote: * Changed: Events are now internally stored in elem.$events rather than elem.events (due to a nasty bug relating to DOM 0 expandos). I'm translating this blog into French, but I can't figure how to translate this sentence. DOM 0 expandos ? Anyway this is available at http://www.jquery.info/spip.php?article42 -- Fil ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Chris Ovenden http://thepeer.blogspot.com Imagine all the people / Sharing all the world ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .next() bug?
It's hard enough to get everything working properly for documents that are well-formed. I don't think that it's worth the effort to force consistency in how jQuery handles broken documents. If you do anything on top of an invalid DOM, you can't make the results predictable. Even if you could, the code would be so huge that your page would never load. - Brian Now, my mark-up is wrong. I should have wrapped the nested ul in it's own li, but I missed it. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .next() bug?
I see what you're saying. You're worried that because there's a difference here, there might be a differnce in a non-broken document that we haven't found yet. Personally, I wouldn't worry about it until/unless there's an actual use case that's having this same problem on a non-broken DOM. - Brian That's not what I'm looking for at all. The point was whether or not .next() is always returning the correct element in a given situation. It was merely a concern, not a request to make jQuery work on broken docs. Adam Citrus wrote: It's hard enough to get everything working properly for documents that are well-formed. I don't think that it's worth the effort to force consistency in how jQuery handles broken documents. If you do anything on top of an invalid DOM, you can't make the results predictable. Even if you could, the code would be so huge that your page would never load. - Brian Now, my mark-up is wrong. I should have wrapped the nested ul in it's own li, but I missed it. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/.next%28%29-bug--tf3309804.html#a9207359 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Interface problem
Is all your of your main code in a ready block? Just a guess, but it might be trying to operate on the DOM before it's loaded. - Brian Hi there, I've got a really odd problem with the interface plugin. The thing is that when I go to the specific site that uses Interface theres no problem, but when I update the page I get this: http://img02.picoodle.com/img/img02/7/2/25/f_Interfaceerm_e3ca35b.gif So, following a link or typing in the url results in no error, but pressing F5, or rightclick/reload does. This is in FF 1.5. In IE7 I get a IE could not open the internet site ... operation aborted followed by a Internet Explorer cannot display the webpage infopage. I'm sorry I can't give you any specific code, just hoping that someone has had a similar problem sometime and solved it. Oh and the javascript is included IN the body, is that a problem? Would really appreciate som help here. //Kristinn ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] What would be the best way to...?
Thanks for the advice, I should have figured it was that easy. Although, you both didn't wrap this in a $() before using jQuery methods on it. :) I'll use it this week. - Brian $([EMAIL PROTECTED]).each(function(i){ this.append(textarea name=' + this.attr(name) + ' + this.val() + /textarea).remove() }) is a bit shorter... and throwing the remove at the end of the chain will save you a small fraction of a millisecond! I just took Glen's code and shortened it. I've used the append and remove before. On 2/23/07, Glen Lipka [EMAIL PROTECTED] wrote: I havent tested, but this is in the ballpark I think: $([EMAIL PROTECTED]).each(function(i){ currentName = this.attr(name); currentValue = this.val(); this.append(textarea name=' + currentName + ' + cuurentValue + /textarea; this.remove (); }); So this would destroy the input and replace with textarea. There might be a better way, but I think this should work. Glen On 2/23/07, Brian Miller [EMAIL PROTECTED] wrote: I need to replace a whole lot of input type=text elements on a page with textarea elements. (I have limited control over how the fields are generated.) The contents of the form fields must remain - I just want to change the shape of the field to make it bigger and allow multiline input. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] non AJAX request
This is a little strange, but I want to do a non AJAX request. I thought it might be a synchronous request, instead of asynchronous, but that didn't work. This is what I tried: function compDetail(compid) { ajaxOptions = { async: false, type: get, url: compdetail.php, data: compid= + compid }; $.ajax(ajaxOptions); } I have this called from an onclick in a tr tag. I want it to go to a new page (compdetail.php), not just return the information. Guess I'm forgetting the meaning of a/synchronous. One idea is to just wrap the tr/tr in a href/a, but I don't think that would work the way I want it to. Anyone know if this is possible? -- Brian Ronk ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] ANNOUNCEMENT: jQuery Ext Partner to Deliver Integrated JavaScript UI, Features
Ideally, there should eventually be one selector base that uses the best methods of both jQuery's selector engine and DomQuery. That way, there's no longer an issue of which one is used. - Brian Hi Rajesh, Were investigating the possibility of supporting the use of DomQuery, Exts selector engine, as an alternative (not a replacement) to jQuerys CSS Selector code. Rey... R. Rajesh Jeba Anbiah wrote: On Feb 20, 5:30 am, Rey Bango [EMAIL PROTECTED] wrote: Today, we're proud to announce that the jQuery Project and Jack Slocum's Ext Project, have partnered to integrate the amazingly lightweight and powerful jQuery framework with Ext's awesome UI library. snip I previously asked about DOM Query support [*]. And asking the same question:) [*] news:[EMAIL PROTECTED] ( http://groups.google.com/group/jquery-discuss/msg/ c74f44b95ac863cb ) -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] ANNOUNCEMENT: jQuery Ext Partner to Deliver Integrated JavaScript UI, Features
This kind of reminds me of auto racing. The rules limit you to a total gross vehicle weight, but you want to get as much engine under the hood as you possibly can, without going over the limit. Personally, I think that we should keep adding speed optimizations until we're at 19. kb compressed. :) (Although, I also think that maybe John should raise the limit by 1.5 times every 18 months. :-D) - Brian Well, there are fundamental tradeoffs that need to be made. If you want a very small codebase, it's difficult to squeeze in all the speed optimizations. And if you value speed above all else, you might produce a fairly large, blazing library. We're looking at these issues to try and come to a conclusion that will benefit the jQuery community. -- Yehuda On 2/20/07, Brian Miller [EMAIL PROTECTED] wrote: Ideally, there should eventually be one selector base that uses the best methods of both jQuery's selector engine and DomQuery. That way, there's no longer an issue of which one is used. - Brian Hi Rajesh, We're investigating the possibility of supporting the use of DomQuery, Ext's selector engine, as an alternative (not a replacement) to jQuery's CSS Selector code. Rey... R. Rajesh Jeba Anbiah wrote: On Feb 20, 5:30 am, Rey Bango [EMAIL PROTECTED] wrote: Today, we're proud to announce that the jQuery Project and Jack Slocum's Ext Project, have partnered to integrate the amazingly lightweight and powerful jQuery framework with Ext's awesome UI library. snip I previously asked about DOM Query support [*]. And asking the same question:) [*] news:[EMAIL PROTECTED] ( http://groups.google.com/group/jquery-discuss/msg/ c74f44b95ac863cb ) -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Yehuda Katz Web Developer | Wycats Designs (ph) 718.877.1325 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Form Plugin curiosity
I've got an example page, basically a watered down version of what I'm working on. I'm actually using his sha1 implementation. Just put in some information (nothing is actually saved, the script just displays what you inputed). Oh, and the email address isn't really checked, you can put in whatever right now. But, the email and passwords do need to match. Just hit create, and see what it does. I did test it, and it's still being funky. http://brian.radioactivepickles.us/formtest/ On 2/16/07, Benjamin Sterling [EMAIL PROTECTED] wrote: Are you using something like http://pajhome.org.uk/crypt/md5/ for your encryption? are you doing something like: var options = { beforeSubmit: function(formArray, jqForm) { encryptform(); // just example }}; Maybe an example page? -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Brian Ronk ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Form Plugin curiosity
Ok, I made those changes. I actually was doing the sha1 that way before, but changed it to see if that was the problem. If you take a look at it now, I think you'll laugh. Basically, the alert shows the correct info (the sha1'd password), but what is displayed is still plain text. I'm wondering if this is related to the issue with the plugin sending info twice (one of the other threads going around right now). On 2/16/07, Benjamin Sterling [EMAIL PROTECTED] wrote: Brian, two things and a suggestion: try $( '#account_pass' ).val(hex_sha1( $( '#account_pass' ).val())); $( '#account_pass_confirm' ).val(hex_sha1( $( '#account_pass_confirm' ).val())); instead of accform.account_pass.value = hex_sha1( accform.account_pass.value ); accform.account_pass_confirm.value = hex_sha1( accform.account_pass_confirm.value ); Just before you do return true; alert($( '#account_pass' ).val()); just to make sure it is converted. also, I would suggest that you don't do if(error) { // errors $( '#account_pass' ).val(); $( '#account_pass_confirm' ).val(); return false; } that will make your end user frustrated, IMO hope this helps -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Brian Ronk ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Google's Summer of Code
Here's the thing. jQuery, along with plugins, covers a lot of what other libraries do. I just went looking around in dojo and YUI, and while one can do most of what they do by combining plugins, what's missing is the kind of bullet-proofing that people Alex Russell and Eric Miraglia have gotten into their respective libraries by way tight management. jQuery's whole philosphy runs counter to that, with a real spirit of roll your own. It's led to some very cool and unlikely plugins, but they're not all necessarily as stable as the core is. So, one thing I propose is that we take a list of plugins/functionalities that we want to have officialized, and have one of the programmers that we get from SoC to just do a thorough review, squish all bugs, test on all supported platforms, and add some cool enhancements. One example: Kelvin Luck's date picker is a good calendar control implementation. But, it does still require some work, and it's also not as flexible as Yahoo's calendar (although, one might argue that Yahoo's level of calendar features aren't necesarily desirable...) Also, there's a lot of work that Interface can use, even though it gets better every day. Sometimes, it seems like Stefan and Paul don't have enough hands. This isn't a complaint, I'm just saying that they'd probably appreciate as much help as they can get. Interface is big. Ideally, I'd like to see this: After the pick-a-plugin system is deployed, I should be able to go in and almost create a drop-in replacement for any other popular library that's out there today, and get at least that library's level of hardness and fidelity. For example: if I like the YUI widgets, but I want to use jQuery, I should be able to check off Core+Calendar+Interface+Menu, and I have something that's not only as complete feature-wise as YUI, but something that's just as bug-free and cross-browser. Unfortunately, testing and hardening aren't the cool part of programming. But, it's something that I think the whole project would really benefit from. As for any other little features I'd like to see, I could use a good time-picker control, and support for more advanced XPath selectors. If you're looking for something big and new, perhaps a port of Jack Slocum's layout stuff? That might take more than an summer, though. :) This is all just stuff to think about. I'm going pie-in-the-sky here. - Brian Hey Everyone - Google's Summer of Code has just opened up for 2007, and I'd love to have jQuery be a part of it: http://code.google.com/soc/ If you're not familiar with how SoC works, Google pays a number of college students to work on an open source project for an entire summer. This is a great opportunity for the kids, and for the projects that they're supporting. In order to be able to apply, we'd have to come up with a list of things that we'd like them to do. So, I'm asking you (the jQuery community) what you think 1-3 decent coders could do for us for a summer? Some examples of good ideas (which should be expanded upon): - Build or port an unobtrusive charting plugin - Add jQuery support to a popular CMS/Framework - Build some interactive demos for jQuery.com - Add new functionality to Interface We're already working on the following improvements to the web site (so you don't need to ask for these): - A new plugins repository - A new forum area - A customizable download area Feel free to post your suggestions - all are welcome! --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Google's Summer of Code
Actually, I think that the best thing to do would be to detect what the browser has, and use whatever's there transparently. If Canvas is there, use it. If not, try SVG. If there's no SVG, try VML. If there's no suitable graphics system in the browser, signal the user to download and install a canvas plugin (kind of like what happens when people don't have Flash installed). - Brian I think Canvas would be preferable (like porting Plotkit, for example). Considering that it's possible to make it work in all browsers. --John On 2/16/07, Jake McGraw [EMAIL PROTECTED] wrote: When you mention charting, what method would you suggest for chart rendering? SVG? - jake On 2/16/07, John Resig [EMAIL PROTECTED] wrote: Hey Everyone - Google's Summer of Code has just opened up for 2007, and I'd love to have jQuery be a part of it: http://code.google.com/soc/ If you're not familiar with how SoC works, Google pays a number of college students to work on an open source project for an entire summer. This is a great opportunity for the kids, and for the projects that they're supporting. In order to be able to apply, we'd have to come up with a list of things that we'd like them to do. So, I'm asking you (the jQuery community) what you think 1-3 decent coders could do for us for a summer? Some examples of good ideas (which should be expanded upon): - Build or port an unobtrusive charting plugin - Add jQuery support to a popular CMS/Framework - Build some interactive demos for jQuery.com - Add new functionality to Interface We're already working on the following improvements to the web site (so you don't need to ask for these): - A new plugins repository - A new forum area - A customizable download area Feel free to post your suggestions - all are welcome! --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Form Plugin curiosity
I'm new to jQuery, and found the Forms plugin. So far it seems to be working fine, but I ran into 2 issues earlier. First, it was working, but it was acting like a normal form, not an ajax form. I had some errors in my script (used the wrong id in checking a password), and when I changed that, it started working fine. No clue why. Secondly, I want to encrypt a password (I'm using this on an account creation page, and it returns a blurb if it was successful or not). Anyway, as I'm testing, I'm noticing that while it's encrypted on the client side (I see the password change length in the password form), when the user is entered into the database, the password is unencrypted. Why is this? I'm I just encrypting it at the wrong point? -- Brian Ronk ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery Nightly Builds
Thank you! Thank you! Thank you! :) - Brian This is a re-post of a blog post written by Paul McLanahan: http://jquery.com/blog/2007/02/13/jquery-nightly-builds/ Hey Everyone - After much wailing and gnashing of teeth, we now have automated nightly builds of jQuery ready for mass consumption. These builds came about due to we community members who would like to experiment with the most recent features of jQuery, on our projects, but who for whatever reason, don't have access to the subversion repository. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] how to simplify this
Believe it or not, this isn't incredibly bad. One thing you should do is search for things by ID using the ID only. It's actually a bit faster. If you want to remind yourself of the tag type, put in a comment after the line. Another thing you can do to make this a bit cleaner is to use a comma to put things that you're doing the same thing(s) to in the same search. e.g. $('#standard dd,#profi dd').removeClass('ausgewaelt'); Keep in mind also that you can get to the DOM element in an event callback through its data object reference. This way, you don't have to re-search for li#normal from within the click event function that you glued to it. Just remember to name the reference. I'm not sure how useful it is in this particular case, but it's helpful to know. HTH, - Brian Hello, I am looking for a way to simplify this chunk of code: $('li#normal').click(function() { $('#bereit').ScrollTo(800); $('li#normal dd').toggleClass('ausgewaehlt'); $('li#standard dd').removeClass('ausgewaehlt'); $('li#profi dd').removeClass('ausgewaehlt'); $('label#label_radiobutton_1').toggleClass('ausgewaehlt'); $('label#label_radiobutton_2').removeClass('ausgewaehlt'); $('label#label_radiobutton_3').removeClass('ausgewaehlt'); $('input#radiobutton_1').attr('checked','checked'); $('input#radiobutton_2').attr('checked',''); $('input#radiobutton_3').attr('checked',''); }); $('li#standard').click(function() { $('#bereit').ScrollTo(800); $('li#normal dd').removeClass('ausgewaehlt'); $('li#standard dd').toggleClass('ausgewaehlt'); $('li#profi dd').removeClass('ausgewaehlt'); $('label#label_radiobutton_1').removeClass('ausgewaehlt'); $('label#label_radiobutton_2').toggleClass('ausgewaehlt'); $('label#label_radiobutton_3').removeClass('ausgewaehlt'); $('input#radiobutton_1').attr('checked',''); $('input#radiobutton_2').attr('checked','checked'); $('input#radiobutton_3').attr('checked',''); }); $('li#profi').click(function() { $('#bereit').ScrollTo(800); $('li#normal dd').removeClass('ausgewaehlt'); $('li#standard dd').removeClass('ausgewaehlt'); $('li#profi dd').toggleClass('ausgewaehlt'); $('label#label_radiobutton_1').removeClass('ausgewaehlt'); $('label#label_radiobutton_2').removeClass('ausgewaehlt'); $('label#label_radiobutton_3').toggleClass('ausgewaehlt'); $('input#radiobutton_1').attr('checked',''); $('input#radiobutton_2').attr('checked',''); $('input#radiobutton_3').attr('checked','checked'); }); It controls a list, when you click on one of the three items, it scrolls down to a online form (first line), the item is highlighted (first three lines), one of three radioboxes is checked (line 6-8) and the label for the checked radiobox is also highlighted (last three lines). Can you help me? Thanks, Dominik ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery Validation 1.0 Alpha
Kevin, the 3-4 scripts are heavily commented, and it would be very easy to combine them all into one js file and compress it ;) Kevin Fricovsky wrote: You're library though seems to be very robust, I'm just concerned with the 3 (or is it 4) js scripts required for it to work. I too am a fan of Particle Tree's unobtrusive style of form validation: http://particletree.com/features/a-guide-to-unobtrusive-javascript-validation/ I'm working on a project right now that may allow for me to work on a solution similar to the ones below using Jquery. Yup, know this is the Jquery mailing list but I really like the examples I've seen using prototype or mootools. Here's a good example of the moo and proto examples: http://clientside.cnet.com/code-snippets/really-easy-field-validation-with-mootools/ Here's the js - http://clientside.cnet.com/scripts/validator/mooValidation.js http://clientside.cnet.com/3rd-party-libraries/really-easy-field-validation-with-prototype/ You're right, there's no reason why jquery can't have a similar tool set. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jörn Zaefferer Sent: Thursday, February 08, 2007 4:59 PM To: jQuery Discussion. Subject: [jQuery] jQuery Validation 1.0 Alpha Hi folks, there were some questions about my very first version of the validation plugin (it's still on the plugin page). If you are interested in form validation, you may want to take a look at the current state of the plugin: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ It's 1.0 version is now in alpha status: That means that I can't guarantee to not change the API until the beta release. But apart from that, the plugin is already pretty stable, and should provide nearly everything you need for client-side form validation. It uses the metadata plugin, therefore you can choose between specifiying your validition in the markup via extra class infos or custom attributes. Or, in case you don't want to use inline markup, you can just pass the rules as a JavaScript object to the plugin (see the examples). The plugin is aimed at both fast prototyping and highly customized validation: There are default messages for all provided methods (required, email etc.) that can be overriden by using the title attribute on input elements, specifying custom error messages in the markup (the old method with labels) or via a JavaScript object passed to the plugin. The plugin page contains some more information about known issues, migration from the old plugin and, in the extreme contrast to the old version, a nearly complete documentation. I'm sure there is room for imrovement, but at least it covers everything. Demos ( http://jquery.bassistance.de/validation/validateTest.html ) cover also integration with the form plugin: http://jquery.bassistance.de/validation/formPluginIntegration.html Your feedback is highly appreciated! We should be able to create the definite solution for jQuery form validation... Regards -- Jörn Zaefferer http://bassistance.de ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/jQuery-Validation-1.0-Alpha-tf3196319.html#a112 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Plug-in: Check Availability
I made this little plug-in for an application I'm working on. It's really simple, but maybe others will find it useful and perhaps save some time.. All it does is attach a link to the desired input field and queries a database (or xml file, or whatever you want to query) for an existence of the input text. http://www.brianlitzinger.com/code/checkavailability View the demo I put together in 5 minutes -- View this message in context: http://www.nabble.com/Plug-in%3A-Check-Availability-tf3164062.html#a8777258 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] ANN: Brandon Aaron Joins learningjquery.com
You know... The folks over at Mootools refer to theirs as Mootorials. Maybe we should call them jQ-torials? :) - Brian Hello dear friends, Just a quick note to announce that Brandon Aaron -- regular contributor to this list, member of the jQuery development team, and plugin author -- has agreed to join me in publishing tutorials on learningjquery.com. He will focus on intermediate- and advanced-level topics. Check out his first entry, posted last night, about his cloneEvents() plugin: Copy Events from One Element to Another http://www.learningjquery.com/2007/01/copy-events-from-one-element-to- another He also has some great ideas for redesigning the site and enhancing it with jQuery magic. Stay tuned for more from Brandon coming your way! Cheers, --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jquery.corner.js freezes IE6
Is it this? http://meyerweb.com/eric/thoughts/2004/09/16/when-browsers-attack/ - Brian IE6 freezes, and I need to kill the proccess. After that, I visited Damn, it sure does. I'll have a look at it Juan. Interesting. It's this call that causes the problem: var h = jQuery.curCSS(this, 'height'); Anyone know why that might be? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jquery.corner.js freezes IE6
This might be a better one: http://www.cameronmoll.com/archives/000892.html - Brian IE6 freezes, and I need to kill the proccess. After that, I visited Damn, it sure does. I'll have a look at it Juan. Interesting. It's this call that causes the problem: var h = jQuery.curCSS(this, 'height'); Anyone know why that might be? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] AJAX-filled div broken after 1.04 - 1.1 update
Hi everyone. After wrestling with this one for awhile I've come to the conclusion that I need your help. For your reference, here are two pages. They differ only in which version of jQuery they use. The first uses 1.1, the second uses 1.04. http://furzle.com/user_functions/register http://furzle.com/jquery104.html Don't bother filling in the form; just hit submit. If your browsers behave like mine, you'll notice version 1.04 updates a div upon submission, while 1.1 just sits there. The code in question is this: script type=text/javascript $(document).ready(function() { /// Looks for submit form link $('#submit_form').click(function() { $(div#create_user_status).load(http://furzle.com/elements/php/ dynamic_forms.php,{first_name:$('#first_name').val(), last_name:$('#last_name').val(), email_address:$('#email_address').val(), gender:$('#gender').val(), birthday_mon:$('#birthday_mon').val(), birthday_day:$('#birthday_day').val(), birthday_yr:$('#birthday_yr').val(), username:$('#username').val(), password_one:$('#password_one').val(), password_two:$('#password_two').val(), zip:$('#zip').val(), fields_list:$('#fields_list').val(), handler:$('#handler').val() }); }); /// Looks for form submission $('#new_user_form').submit(function() { $(div#create_user_status).load(http://furzle.com/elements/php/ dynamic_forms.php,{first_name:$('#first_name').val(), last_name:$('#last_name').val(), email_address:$('#email_address').val(), gender:$('#gender').val(), birthday_mon:$('#birthday_mon').val(), birthday_day:$('#birthday_day').val(), birthday_yr:$('#birthday_yr').val(), username:$('#username').val(), password_one:$('#password_one').val(), password_two:$('#password_two').val(), zip:$('#zip').val(), fields_list:$('#fields_list').val(), handler:$('#handler').val() }); }); }); /script What I'm doing is gathering the values from the form and sending it to dynamic_forms.php. Whatever dynamic_forms.php returns gets assigned to div#create_user_status. I'm drawing inspiration from this code: $(div#dhtml).load(html.cgi,{name:John}); Taken from this page: http://jquery.com/demo/ajax/ Despite my best efforts, I can't get any of the code above to work in 1.1 (even the very simple name:John example). I must be doing something wrong. Any suggestions? Thanks in advance. BT - Brian Tobin e-mail: [EMAIL PROTECTED] cell: 805-698-6365
Re: [jQuery] Slow Selector... What should I do?
You can comma-delimit the selector, so you can package up all the td elements you're looking for into one $ function. Also, if you limit your context (to, say, the table in question), it'll help speed things up. mytable = $(#mytable); FlexCells = $([EMAIL PROTECTED] + ShiftDate + ], [EMAIL PROTECTED] + ShiftDate2 + ], mytable); This is a good start. Once you have all your elements, you can iterate thorugh them with $.each(), which is relatively speedy. - Brian Hi gang, I've got a for loop in which I have jQuery select a different DOM element for each iteration. The code I've got that selects the element is: FlexCell = $([EMAIL PROTECTED] + ShiftDate + ]); So far, it's taking about three seconds to complete a loop of fifteen iterations. Yikes! :o( If I remove the above line from the code, it's lightning quick! I should mention that the three second approximation is *after* I upgraded to the very latest jQuery build (jquery-latest.pack.js... from the jquery.com main page). So upgrading did give me a slight performance increase. Can anybody help me speed this up? Thanks, Chris -- http://www.cjordan.info ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Slow Selector... What should I do?
You can still start off by grabbing your table, and that will make each individual search for a td quicker. mytable = $('#mytable'); ... FlexCell = $([EMAIL PROTECTED] + ShiftDate + ], mytable); Or, even better, you can grab all the td elements that have a dateValue in the first place. mycells = $('[EMAIL PROTECTED]'); ... FlexCell = $([EMAIL PROTECTED] + ShiftDate + ], mycells); As for the rest... it looks like it would be painful to refactor your whoe method just to get the selection outside of the iteration. So, hopefully, you'll get enough help out of limiting the context that your speed will go down by a good bit. Given that it's taking 3 seconds, I'm guessing that you're running this on a relatively large DOM. The bigger the DOM, the more benefit you get from limiting the context. - Brian Brian, The only problem I see with that is that the dates come from the object that I'm looping over. I maybe should have included the entire for loop in my original post: for(i = 0; i ThisRecordCount; i++){ ShiftDate = {ts ' + CFJS.ListFirst(FlexOrderData.data.SHIFTDATE[i],.) + '}; TempDate = $.odbcDateTimeParse(ShiftDate); BackgroundColor = #ThisWeekdayColor#; if(!(TempDate.getDay() % 6)){ BackgroundColor = #ThisWeekendColor#; } FlexCell = $([EMAIL PROTECTED] + ShiftDate + ]); FlexCell.removeClass(CalendarCellDisabled).addClass(CalendarCellEnabled).attr(state, Enabled).css({background:BackgroundColor, color:#someColdFusionVar#}); } I don't know the ShiftDates ahead of time, nor how many there will be. Can I still apply you possible solution? Thanks, Chris Brian Miller wrote: You can comma-delimit the selector, so you can package up all the td elements you're looking for into one $ function. Also, if you limit your context (to, say, the table in question), it'll help speed things up. mytable = $(#mytable); FlexCells = $([EMAIL PROTECTED] + ShiftDate + ], [EMAIL PROTECTED] + ShiftDate2 + ], mytable); This is a good start. Once you have all your elements, you can iterate thorugh them with $.each(), which is relatively speedy. - Brian Hi gang, I've got a for loop in which I have jQuery select a different DOM element for each iteration. The code I've got that selects the element is: FlexCell = $([EMAIL PROTECTED] + ShiftDate + ]); So far, it's taking about three seconds to complete a loop of fifteen iterations. Yikes! :o( If I remove the above line from the code, it's lightning quick! I should mention that the three second approximation is *after* I upgraded to the very latest jQuery build (jquery-latest.pack.js... from the jquery.com main page). So upgrading did give me a slight performance increase. Can anybody help me speed this up? Thanks, Chris -- http://www.cjordan.info ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] tabs plugin - how to start with all content blocks hidden?
I'm trying to use the tabs plugin, but I want all the content areas hidden until one of the tabs is clicked. I tried it with CSS, but the content areas remain hidden even when the tab is clicked. Is there support for this? -- View this message in context: http://www.nabble.com/tabs-plugin---how-to-start-with-all-content-blocks-hidden--tf2925872.html#a8179196 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] slideUp/Down flicker with 1.0.4
I noticed it Firefox, but surprisingly it doesn't happen for me in Safari. I'm injecting html into a div then sliding it down, and I assumed I might not have written the code correctly, but I also noticed it on normal elements as well. Brian Mika Tuupola wrote: Upon upgrading to jQuery 1.0.4 some of my slideUp/Down elements started to flicker. With 1.0.3 this problem did not exist. http://www.appelsiini.net/~tuupola/jquery/slideupdown/slideupdown5.html http://www.appelsiini.net/~tuupola/jquery/slideupdown/slideupdown6.html (Click the blue box in the corner). Am I missing something obvious or is this just css problem? -- Mika Tuupola http://www.appelsiini.net/~tuupola/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/slideUp-Down-flicker-with-1.0.4-tf2919581.html#a8160201 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Interface: Sortables ghosted item doesn't take the css correctly
I have a sortable list which contains quite a bit of html which includes a child ul, and I noticed when I drag the element not all the css styles are retained in the ghosted item. For example the child ul has the list-type: none, but when its drug the bullets appear. A couple elements with negative margins are disappearing on drag, but re-appearing onStop. One of these items is my drag handle... so it looks kind of weird. Anyone had similar issues? -- View this message in context: http://www.nabble.com/Interface%3A-Sortables-ghosted-item-doesn%27t-take-the-css-correctly-tf2919869.html#a8160367 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] center() plugin
I can't seem to find the center() plugin that is listed at visualjquery.com, anyone know where it is? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Duplicating a row...
This strikes me as a task where creating new elements may be less gremlin-prone than cloning. Michael Geary's Easy DOM Creation plugin might make it easier to write a function that creates the appropriate DOM tree branch. http://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype - Brian I'm working with recipes and I want to use some jQuery goodness to clone a DOM construct that will contain a few form fields so that adding ingredients is easy, and fun. I thought that it would be pretty easy to code but it's giving me some trouble and I wanted to see if you guys could help me out. My HTML: ol id=ingList li class=ingredientinput type=text name=ing_01input type=button class=addIng value=+/li /ol Here's the jQ code I have thus far: $(document).ready( function(){ $('#ingList .ingredient .addIng').click( function() { $('#ingList .ingredient').clone().appendTo('#ingList:last-child'); }); }); The goal is that the user would fill the first field then click the + button. Then the following would occur: 1) Clone current LI tag 2) Append it to itself. 3) Clear the value from the form field 4) Increment the name value of the form element, ing_01, ing_02, etc. 5) Lastly, remove the plus button from the elemet just previous to the new one. I'm working with various jQ methods but I can't seem to get this working. Does anyone have input on this? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] scrolling effect
Hi, I love jquery so far, just learning. I'm trying to develop a scrolling effect, to scroll a list of news headlines inside a div tag. I'm sure I probably should be adjusting the clip region, I just can't figure out how to do it. Anyone know how, or has someone done this? Brian ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] More DOM Query Speed Tests
looking for an ID (which should be unique) after getting the tags is worthless. Should we re-write the case of tag#id to use elem.getElementBYId(), and then remove the element if it's not the right tag? - Brian ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Check element visibility
$(':visible', this).length == 0 (Or 1, if the root of the context is returned, which I'm not sure of.) Note: This will be kind of inefficient if you're working with a big DOM tree. - Brian Hello all, How can I check if a given element is visible or not (i.e. has display:block). I have the folowing situatioin - I need to hide all li class=label elements that have ALL their li class=clearfix descendant hidden. (if one or more of the li class=clearfix descendants is visible, then the label must stay visible). I intend to do sometning like that: $(div.specifications li.label).each(function() { to_hide = 1; $( li.clearfix, this).each(function() { if($(this).IS_VISIBLE to_hide = 0; }) if($.trim(this.innerHTML) == 'nbsp;') $(this).parent().parent().toggle(); if(to_hide) { $(this).hide(); } }) What might IS_VISIBLE be ? Any hints ? -- Best regards, Stoyan mailto:[EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Interface: Resizeable question
Does anyone know how to alter the iresizeable.js file to allow multiple resizeable elements on the page? Right now it seems very dependant on IDs, but I need it to be class based. For example I need the handles in each one of these divs to resize the parent div. Right now it just resizes the last element with the resizeable class on the page. div style= class=phaseWrapper div style=width: 100px class=phase draggable resizeable id=a1 div class=resizeE/div div class=resizeW/div /div /div div style= class=phaseWrapper div style=width: 200px class=phase draggable resizeable id=a2 div class=resizeE/div div class=resizeW/div /div /div Any ideas? I've been staring at the code and I'm clueless on what to change :/ -- View this message in context: http://www.nabble.com/Interface%3A-Resizeable-question-tf2810150.html#a7841608 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Lost
Relax, Anrdea. :) Lots of things get lost in mailing lists. The style is very good. There's a lot to like about it. I do have some suggestions, though. 1. You should probably measure out the screen of the browser (dimensions.js can help here), and expand the windows to use more of the available space. On my screen, the panels look kind of small. 2. The method names should be clickable. The link at the top left isn't 100% obvious to everyone as the think to click on. Whereas a lot of people (especially people who read javadocs a lot) are very user to clicking on a method name to get its documentation. 3. What would be awesome is if you had an input at the top of the screen, which did a real-time search of the method names. Basically, if I typed remo, it should scroll the first panel down to the first instance of the remove method. This is a lot of work, though, and I don't really expect you to do it. :) Keep up the good work! - Brian There are two things that I posted here a lot of time ago, but with little to no feedback at all. Well, they are not simple things actually. They hide hours of work and your comments do are a reward. I'll be glad to receive any kind of comments, everything in the range from I love it to I hate you :-) but please write a couple of words! Am I getting paranoid or is this usual in a discussion list? I don't know, I'm at my first experience in such a thing. I also thought I could have been doing something wrong. Maybe I used rude words or evil sentences, or I didn't do something that I had to. Please put me back on the right path. Thanks. 2006-10-17 (posted again on 2006-11-21) http://jquery.com/discuss/2006-November/017714/ 2006-11-28 http://jquery.com/discuss/2006-November/018337/ -- View this message in context: http://www.nabble.com/Lost-tf2774303.html#a7738911 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] current jQuery version
You know, we see this request a lot. John (or somebody), can you cron-job a nightly build? I don't want to be pushy or anything, but I think that would make a bunch of people very happy. - Brian well, http://jquery.com/src/jquery-svn.js is not the current version (that's the problem). Thanks to Aaron Mathias 2006/12/7, Erik Beeson [EMAIL PROTECTED]: http://jquery.com/src/jquery-svn.js On 12/7/06, Mathias Bank [EMAIL PROTECTED] wrote: Hi, can anyone send me the current jQuery.js (complete): i cannot connect to the svn server because the local firewall blocks it. It would be a pleasure, if there could be a nightly build at jquery.com Mathias ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Efforts to Convert Folks to jQuery
Keep in mind that Bob Ippolito is a Python guru, and he specifically wrote mochikit to make JS behave a bit more like Python. To him, any language sucks if it uses C-family idioms. :) We can choose to be more positive, using a phrase like, Makes programming Web 2.0 fun! Or, something. - Brian 4. mochikit: Makes JavaScript suck less. - I love this one First I liked it too, after I thought about it, I don't like the attitude. Who said, JavaScript sucks...? I wouldn't want to program in a language that I think it sucks, with or without an API. I'm really wondering if the gurus think that JavaScript sucks? -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Departure
Hey, don't look at it as us vs. them. One of the great things about jQuery is that it plays well with others. I use them together for a bunch of things, and there's no reason why you can't introduce it for tasks where it's well suited. After all, isn't Web 2.0 all about mashups? :) Good luck with the new thing! - Brian Unfortunately, I am leaving Intuit. (Friday is my last day) In the past 6 months, I have tried to spread the gospel of jQuery at Intuit. Unfortunately, where I am going, YUI is already being used. I really enjoyed using jQuery and think that it is something special. I haven't been this excited about a technology since CSS. Some sites launching or launched: http://www.turbotax.com is moving towards using jQuery extensively this tax season on their public website. http://www.intuit.com uses it all over and once the test is done will use it even more. Shared account management experiences Shared checkout experiences. Error checking http://www.payroll.com Global Header - TBD launch, depends on political issues I will organize the examples on my site before I go. Thanks for everything! *Very jQuery!* Best regards, Glen ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] HI
Oops! I guess I jumped the gun a little, thanks for clearing that up. I actually knew that, but I responded without thinking it through... - Brian On 04/12/06, Brian Miller [EMAIL PROTECTED] wrote: The id and name attributes must always be unique on a form. It's breaking because you made them the same. They *must* be different, even if they are on different forms. - Brian Name doesn't have to be unique (how else would radio buttons or checkbox groups work?), but id's do. To get field values I do: var fielddata = $(#form_id :input).serialize(); ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Jquery+TinyMCE problem
You could try wrapping the div with the TinyMCE editor with another div, and applying the event to the wrapper div instead? MiB wrote: http://www.c2design.hu/liliomdomb/test.html look at first. I would like to attach any event to Tinymce but i cant. There is a div in inframe( id=scroll, u can view this CTRL+SHIFT+I in Firefox) and i would like to attach a event to this div. I tryed to search any elem in iframe but i didnt get effect. It is very important for me, and it would be great if somebody could help me. -- View this message in context: http://www.nabble.com/Jquery%2BTinyMCE-problem-tf2750523.html#a7683866 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] HI
The id and name attributes must always be unique on a form. It's breaking because you made them the same. They *must* be different, even if they are on different forms. - Brian hi,everyone I find use jQ, one page have two form, but the form id is diff. i find $(form_id).ajaxSubmit(options); will submit both them data. i want to know how to split them , thank and i have a requirement, one page ,two form ,have one input id in both them same. i want to know how to split them. please give me help thank -- yours ÆëÓÀºã ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Designing for reuse
Heh, I should have read this first, before suggesting it myself. *blush* - Brian On 01/12/06, Christof Donat [EMAIL PROTECTED] wrote: Hi, Controller set of methods is returned.. $('#grid').grid().data(data).drig().show() $('#grid').grid().scrollToRow(6).drig().css(border, 1px) A controller object is returned.. var grid = null $(grid).grid({ data: data, onComplete: function(controller) { grid = controller } }) grid.srollToRow(6) What is best practice? How about the Idea to have a jQuery-function that returns the controller object: $('#grid').grid({data:data}).show().gridController().scrollToRow(6); An perhaps have a method that returns you back to jQuery object? Calling it 'end' (or any other jQuery method name) may be confusing, something like 'endGrid'. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] MyDayLite (to-do list) release. All files included.
I originally showed this 3-4 months ago in its very early stages. I've been working on it periodically and using it everyday since then and I think its finally to a stage where I can release it. I'm not a rockstar PHP or JS programmer... I'm sure there are areas that can be optimized so be nice :) jQuery has a great community and new plug-ins are coming out everyday and I want to contribute back. So below you'll find a zip file containing everything needed to install this app on your own server. Eventually I'll have a hosted solution. I hope one or more people can look at the code and see the plug-ins in use in an actual application and learn something from it. I know I learned a lot making this. Idea I wanted to create a better to-do list that I can use in my Google homepage, and wanted it to feel like a Google application. The design is highly based off Gmail. I also wanted it to feel natural and easy to use... mainly in the mark off feature as well as the quick priority and label assignment (see the help page or video for example). Features sort and prioritize to-dos to-dos and labels can be edited in line to-dos can be marked off much like you'd mark off something on a piece of paper. to-dos can be archived, and retrieved from the archive or deleted permanently. the same files can be used in a standalone page, or in your Google homepage (use the xml file included) quickly assign a priority or label via typing only create a new label and to-do at the same time (ex: new label name this is my to-do) tested in FF 2, Safari, and IE 7 Email me with any bugs, or code improvements you might have: litzinger at gmail dot com Online Demo: http://brianlitzinger.com/mydaylite/demo/ Video Demo: http://brianlitzinger.com/mydaylite/demo/video.mov Files: http://brianlitzinger.com/mydaylite/demo/MyDayLite.0.3.zip Google preview: http://brianlitzinger.com/mydaylite/demo/google_preview.gif Big thanks to Yehuda/wycats for helping me with random JS questions via AIM, and for taking my idea for the quick priority and label assignment (first few lines in the global.js file) and greatly improving/recreating the crappy code I originally had. -- View this message in context: http://www.nabble.com/MyDayLite-%28to-do-list%29-release.-All-files-included.-tf2725759.html#a7601164 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] MyDayLite (to-do list) release. All files included.
I just re-uploaded the zip file and made sure it contained the same files as the demo. Thanks for the feedback everyone. I'll keep posting updates to the same page, and will eventually take care of the character encoding and string cleaning (as well as a hosted version with username/password signin). As for the desktop usage, I guess it could work with Windows Active Desktop, or when OS 10.5 comes out it should work as a dashboard widget (though I think someone released a widget to display a webpage but it doesn't work so well). -- View this message in context: http://www.nabble.com/MyDayLite-%28to-do-list%29-release.-All-files-included.-tf2725759.html#a7604261 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] MyDayLite (to-do list) release. All files included.
David, the priority uses the ! character, and the labels use the character. I originally had it as :, but I found that I actually used : in some of my to-do text for time of day and it borked the input. You can also change them to whatever you want (look in the global.js and label.class.php files). David Arango wrote: I tried to write med: to change priotity, doesn´t work for me (FF2 Windws XP) Spanish characters (ñ, á, é...) working nice :-) Very nice interface! -- David Arango, el único desarrollador con una orden de alejamiento de Jeffrey Zeldman Simplelogica.net, ahora con un 33,3% más de intromisión en listas de correo Cuando no hago otra cosa escribo en mildiez.net ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/MyDayLite-%28to-do-list%29-release.-All-files-included.-tf2725759.html#a7604333 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Bug: display: none plus getComputedStyle in Safari
Is this patch generalized enough to add to the core? Just a thought... - Brian John Resig schrieb: Unfortunately, the hack to work around that is too monstrous to comprehend. For now, it works fine in Safari for most cases, and that's what matters. That is exactly the problem I have. So I will have to live with my patched version for Plazes? -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery rejected by VirtualMart author
The solution is actually relatively simple. If enough people who depend on the software request it, they'll give it more consideration. It's easy to rebuff one person. It's harder to to that to a larger chunk of the user community. What I would do to start, though, is answer his points directly, like so: 1. jQuery is *considerably* better than Prototype. In fact, many frustrated Prototype users have hacked their own implementations of jQuery's features into Prototype to make up for the fact that Prototype hasn't kept up. 2. jQuery overwrites the $() function in its default configuration, but it is trivial to change the symbol that it uses for its core function to something else, so that it doesn't collide with Prototype. Since jQuery consciously avoids the use of for-in, and doesn't add things to the core object prototypes, if actually doesn't break *any* other js library. Given that it's both easy and harmless to support, I don't see what the hangup is with including it. - Brian I'm relatively new to jQuery but am excited about using it. I recently posted a request to have the jQuery library added to the list of libraries supported natively by VirtualMart, a Joomla ecommerce component. The author of VirtualMart has rejected the request: http://virtuemart.net/index.php?option=com_smfItemid=71topic=23597.0 I writing in hope that someone with more experienced and knowledge about jQuery than I could respond to him. Here is a list of Javascript libraries that are supported: http://virtuemart.net/index.php?option=com_openwikiItemid=109id=tutorials:javascript_libraries Thanks, Erin ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.1 by the end of Nov
Personally, I'm noticing a lot of requests for XML namespace selection in the parser. Can we get that into 1.1? Apperently, making $('myns:div') would raise holy hell because it would clash with the pseudos, but $('myns|div') might be doable. Can we make $('myns:div') work if there's no pseudo matching :div ? Just a thought. - Brian Hi Everyone - I want to start a discussion about the features that should go into (or be removed from) the upcoming 1.1 release. I'd like to shoot for a release by the end of this month. Let me know if you have any ideas. --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.1 by the end of Nov
I'm not suggesting bloat here, Rik. I think that, at the very least, support for $('myns|whatever') is core stuff, and is doable without a lot of code. Since it's about the basic functionality of selection, I think that it's one of the few things that *shouldn't* be a plugin. I won't have time to actually take a crack at it for a few days, but I'd appreciate it if someone could demonstrate just how much space such an addition would take up. I can't see it being more than like 10-15 lines or so, but I've been wrong before. :) - Brian Without sounding rude, I don't think I would ever use this and I don't think most developers would either. We need jQuery to be small and flexible, not a huge bloated framework like some of the other libraries (that I will leave nameless)... Maybe extending jQuery, or building a plug-in may be the way round this? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Allow onclick (etc) on disabled input
One thing you can do is not use disabled at all. If you decorate the control like it's disabled, and leave it with an ID (so jquery can find it) but no name, it will be an unsuccessful control, and won't send. If someone enters something in the field, you can use $('myinput').attr('name', 'myinput') to add the name attribute. That will get the effect you're looking for, without trying to make events run on disabled inputs. - Brian Sorry for ~spam, I found that adding the onclick to the parent element (a TD fortunately) is a good enough solution in this situation. BTW: The behaviour is slightly different in IE7 vs Fx2: in IE the click passes through the input, but in Fx the click must be in the TD, outside the input. jazzle wrote: I have discovered that if an input is disabled all its events are as well. For example input type=text disabled=disabled onclick=alert('x'); / won't work. I have an input like this and want it disabled (to prevent it being posted) unless the user wants to change the value. I thought I could simple use input type=text disabled=disabled onclick=$(this).removeAttr('disabled'); / or it might need input type=text disabled=disabled id=x onclick=$('#x').removeAttr('disabled'); / But alas, no luck. Is there some way to force an onclick to work in this situation? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Building a Community (was: Re: New way of animating
I second that notion! Please create a contrib or an incoming branch in SVN, and allow anyone to drop plugins in there. A bunch of us can take turns vetting the plugins to make sure that they're not spam or crap. - Brian Rey Bango wrote: Hi Dan, Still, I suppose if you make enough examples of everythin everyone else has done, and then throw jQuery's own killer features, then we might get more converts! :D There's plenty of cool stuff out there that we should push more and more. Yep! See, part of my concern is that it seems that the other libraries get a ton more exposure than jQuery does so when someone creates a new whiz-bang page using moo or Prototype, it gives a ton of press to those libraries even though in many cases, jQuery has had those features for some time. So I think its important to empathize, in some tangible fashion, these capabilities especially to new visitors. I think the folks at Scriptaculous have done a really good job of this with their new site. This is in part that we are not well coordinated as a community and I think we are going through some growing pains. In the month+ that I have been playing with jQuery it seems like the list of new posters has more than doubled. The one thing that I find very had about jQuery is that there are a lot of person blogs and sites the contain a lot of the key information the is required to learn it, but it is not always obvious where to go look or how to find that information. We seem to have a lot of individual contributors doing their own things for the community, but we don't seem to have an organized community. If that makes sense. Some examples: I now bookmark every plugin reference, because there is no one single place to find the plugins. There is a plugin section in svn, there is a plugin page on the site, but many (most?) of the bookmarks are not there. In fact I remember a post a short while ago about some plugin getting lost because the site no longer existed. Some things we could do: create a contrib directory in svn the would allow us to capture more of these plugins in an unsupported way. Write up a simple standards doc for inclusion. Think of the Perl CPAN site as an example. Make it easier to find the other sites that promote jQuery, like visualjquery.com and learningjquery.com How can we better leverage the resources of the community? Like the jQuery button contest, but also promoting jQuery with announcement every time some creates a new plugin, or releases a site built on jQuery, etc. Recruit someone to work on a site redesign if John would be up for something like that. Personally, I would rather have John working on jQuery core than spending a lot of time on a new website because with a little guidance from John others could take that on and contribute to the community. Things like the following and comparisons to other library features is another thing the people from the community can work on as part of site content. Going along your comments, I think you're right that we need to clearly delineate whats already built-in to jQuery, what can be enhanced via a plugin, and what should be added to some best practices/demo page so that we're not constantly reinventing the wheel. I would just hate for someone to come by and say, Well, jQuery doesn't seem to have this animation capability that I saw on Ajaxian simply because its not obvious to them from what they see on the site. Rey... Anyway, I do not mean for any of this to be taken as criticism, its more an observation of where I think we are and what make sense to move it to the next level. I'm new to jQuery and I may be totally off base. If that is case please delete this and accept my apology. I think I hear a lot of desire for this to happen in the form of the suggestions that are focused on smaller tactical steps of trying to improve the doc or tutorials, etc. These are all things that are important and need to be done but I think a building and growing a community takes some planning and coordination and some leadership and thinking big. One way to do this is for the leadership (whoever that may be) to think about where they want this to go or what their vision is. Then identify concrete tasks of things that need to be done and ask for volunteers to work on them. I'm probably not say anything that you don't already know, but I hope putting it into words generates some discussion and action and provide a mechanism to focus community members on improving jQuery. I have to say that one of the better aspects of this community is the list and the support I have gotten from it. It is a very positive and instructive environment. Thanks and best regards, -Steve ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http
Re: [jQuery] jQuery Metadata Plugin
Keep in mind that there are characters allowed in classes that are not allowed in the CSS spec for selection of classes. In other words, if you include a paren or a bracket in a class, it can't be styled. Therefore, you can use it for script, without worrying that someone will accidently style over the class you're using. Just make sure to avoid putting spaces into class data that you're using, so it's not broken up into multiple classes. - Brian I don't think it will break jquery. but by adding code into a class css will still treat each word as a class and apply that style, for your example, it would invoke a class called some or a class called data. On 11/1/06, John Resig [EMAIL PROTECTED] wrote: of course the data option is easiest but will break validation the class works too, but what if you define a css class called some or even data? I don't follow. The class technique doesn't break existing addClass/removeClass functionality - everything works as you might expect. -- â¿âââ - ××¢×§× ÊÇ¡Ç©È© á«áªá¦á¬ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery Metadata Plugin
In the original discussion about validation, I had suggested using label for= as a way to associate validation with form elements, while making the notation semantically separate from the form element. It would be great to do that for other elements, but I'm pretty sure that the HTML spec calls for label to be used only for form elements, and not non-form elements. There are good arguments both for and against binding element settings with the element. - Brian Original-Nachricht Datum: Thu, 2 Nov 2006 02:08:26 -0500 Von: John Resig [EMAIL PROTECTED] An: jQuery Discussion. discuss@jquery.com Betreff: Re: [jQuery] jQuery Metadata Plugin From John's example, the following classes could be applied: someclass, {some: (illegal), 'data'} (illegal), anotherclass Yeah, the whole embedding-data-in-classes idea is just messy to begin with. Another option that I plan on working in is so that you could add classes in the format: option:value giving you a result like: defaultColumn:3 Let me know how this sounds. If anyone has any sample pieces of code from plugins that've already done something similar, let me know. Well, I used this inside a class for validation rules: $v(required,min:3) No spaces, therefore no way that to apply any styles by that thing. But just using class=someclass {some:'data'} someotherclass should by fine, too. Just avoid spaces inside your meta data. The strength of placing meta data in elements rather then their own script elements is the direct assosiaction of data to elements. I'll try to modify my validation stuff to use your meta-data plugin. My current idea is that I let the user choose via the meta-data plugin in which way he wants to specify the validation rules. -- Jörn Zaefferer http://bassistance.de -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Xpath and tab selection
Darius, $= means attribute ends with. Check out http://jquery.com/docs/Base/Expression/CSS/ , the Supported, but different section. Taking a close look at the selection documentation might also help you with item #2 a bit. You're going to have to figure out how to text-match your relative URL with the absolute URL that will be in location.pathname using plain old regular expressions. Keep in mind that IE automatically converts relative URLs to absolute ones in memory, while the other browsers don't. This may affect your results. - Brian So I have a tabbed navigation system, and I am using jquery to auto-select the current tab. Here's the html: ul id=main_nav li /services/ SERVICES /li li /store/ STORE /li li /about-us/ ABOUT US /li li /gallery/ GALLERY /li li /press/ PRESS /li /ul Here's my jQuery code (adapted from http://leftlogic.com/info/articles?id=1): if (location.pathname.substring(1)) { $('#main_nav [EMAIL PROTECTED]' + location.pathname.substring(1) + ']').parent().attr('id', 'current'); } I'm using parent() so that the id gets applied to the 'li' element and not the 'a' element. All of this works. However, I'm unclear about a couple of things: First, why is the dollar sign $ necessary in the xpath statement? i've seen no documentation on it, and when i try it without the dollar sign, it doesnt work. Second, Sometimes I have a url like: /about-us/4/3 and my jQuery statement fails because the href != location.pathname. How can i rewrite this statement so that it searches for the href value in the location.pathname value and applies the id to the matching string? Thanks in advance, dd -- View this message in context: http://www.nabble.com/Xpath-and-tab-selection-tf2563069.html#a7143657 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Plugin method question
Personally, I'd rather use a div or span for that sort of thing, rather than a code tag. div class=accordion_initaccordion:false,showSpeed:'slow',hideAll:true/div Then, style div.accordion_init to be hidden, and you get the same effect without misusing the code tag. - Brian Which would work on some markup like this: codeaccordion:false,showSpeed:'slow',hideAll:true/code dl class=accordion dtclick me/dt ddto show me/dd /dl ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Plugin method question
Hey listen, I'd love to be able to pack all of the accordion parameters into classes. But, there's just too much information there to make it make-sensical when read by people who are a bit slow on the uptake, as Paul hints might be the case. Another good, but not very semantic solution, was to include a script tag that only defined an object for containing the parameters. That might be a bit cleaner and easier. - Brian Brian Miller schrieb: Personally, I'd rather use a div or span for that sort of thing, rather than a code tag. div class=accordion_initaccordion:false,showSpeed:'slow',hideAll:true/div Then, style div.accordion_init to be hidden, and you get the same effect without misusing the code tag. Poor people that have to use a text browser, a screenreader, or simply have switched of CSS... I give up! -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] siblings() expression bug?
Perhaps you're right. But, in the mean time, you could always use $('label').siblings().find('input,textarea').addClass('blah'); - Brian Hey, this is my first post to discuss@ and I'm new to jQuery though I'm loving it. I don't know if this is a bug or not... Shouldn't $('label').siblings('input,textarea').addClass('blah'); work? $('input,textarea').addClass('blah') works (but not at the scope of items that are siblings to labels. $('label').siblings('input').addClass('blah').end().siblings ('textarea').addClass('blah').end(); also works for what I'm doing, but it seemed to me the expression in siblings should work the same way as an expression in $(). Am I wrong on that? Thanks in advance, Gavin ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Expressions: Search for children within context
Two thoughts: $( '* dt', context ); OR Just put an ID on the particulat dl that you want to use as the context. :) $( dl#foo dt ); - Brian Hi jQueryians, how do I search for a children within a context? In other words, how to translate this: $(context).children(dt)... into something like this: $(/dt, context) The latter one does unfortuanetely not work... -- Jörn Zaefferer http://bassistance.de ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery Kinda Plugin: every
While it's not very jQuery-like, timers lend themselves to registration. I would attach an object to window or a more permanently/easily available object. This way, you don't have to leave closures around just to keep references to the timers, just so you can stop them later. Also, if you're attaching the timer references to DOM objects, then I think that you are opening the door to possible serious memory leakage. Clever, but perhaps dangerous. - Brian And I just realized I should make it possible to stop the repeating function later on. Code: jQuery.fn.every = function(interval,fn) { return this.each(function() { var self = this; this.$every = window.setInterval(function() { fn.call(self) },interval); }); }; Example: // Display the current time updated every 500 ms $(p.display).every(500,function() { $(this).html(new Date()); }); //... some point later in the code execution $(p.display).each(function() { window.clearInterval(this.$every); this.$every = null; }); -blair Blair Mitchelmore wrote: I don't know if this exists already but I needed this and assumed it didn't and wrote it myself. Essentially it lets you do something to an element every given time interval. -blair ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] How to bind a function only once
I have a group of checkboxes, and as long as any one of the boxes is checked I need a function bound to a select list, but anytime none of the boxes are checked I need the function unbound. What I have below binds and unbinds, but if I select lets say 4 checkboxes the function is bound and called 4 times when I change my select list. How do I just bind it once? $('[EMAIL PROTECTED]').click(function(){ if($([EMAIL PROTECTED]'label_checkbox']).is(:checked)) { $('#label').bind('change', function(){ alert('test'); }); } else { $('#label').unbind('change'); } }); -- View this message in context: http://www.nabble.com/How-to-bind-a-function-only-once-tf2466835.html#a6876978 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jquery snapshots
Which begs the question: Why NOT generate a nightly build? It should take all of 5 minutes to edit the crontab to make it happen. :) Not nightly, but updated now and then: http://jquery.com/src/jquery-svn.js -- Jörn ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery API discussion
I think that there's a simpler answer to this. If we're going to overhaul the API that much, we need to do three things. 1. Talk it out thoroughly, and make sure we get it right this time. 2. Publish a new full release of jQuery (2.0). 3. Put all of the breaking changes at the top of the README. Also, from a different branch of the discussion, I'm all for namespacing. But, in the case of jQuery, where terseness is one of it's greatest assets, we should use very selective namespacing. e.g. $.ajaxStop() - $.ajax.stop() $.serialize() - $.form.serialize(), $.xml.serialize() $.load() - $.on.load(), $.ajax.load() $.unload - $.on.unload() {unload event}, $.un.load() {remove load() event} $.filter - Don't change this. :) The idea is that we make the names VERY English-intuitive, and resolve the name collisions we have using as few characters as possible - adding only a dot to an already existing function, if possible/applicable. Thoughts? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery API discussion
Keep in mind that the namespacing that I'm suggesting is solely for readability, and should only be used where it makes things more readable. You're right that it might put some bumps into the chaining, but I think that making the calls non-colliding and more natural-language-y outweighs that. e.g.: $( '.b0rp' ).filter( '#blap' ).on.click( function() { $( '#foo' ).ajax.load( ... ) } ); To me, it just kind of looks like the functions have a dot in them. One could substitute an underscore for the same effect, so it wouldn't really be namespaced, but would still read nicely, and not be conterintuitive wrt chaining. If we do decide to use namespacing in this way, I'd want to lay some ground rules down. Specifically, only one level max, and the name must be 4 letters or less. Again, we should preserve terseness. - Brian Not too keen on namespacing (is it really required? will make the code more verbose and chaining could become confusing), but I agree that if the API changes that much it should be a 2.0 release rather than 1.x. Breaking changes should be the first thing people see before downloading (or maybe second after saying why it should be downloaded). ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Not sure how to do this...
but how do I take the value of an text field, and check it against the text in a select list? For example, if I type foo in a text field, and I have a select list that looks like the one below it'll automatically make the second option selected. select option value=1bar/option option value=2foo/option option value=3bar/option /select Basically as I type I want to check the value on every key up to see if it exists in the select list(not as the value, but the text) then take a certain action. Any ideas? -- View this message in context: http://www.nabble.com/Not-sure-how-to-do-this...-tf2426822.html#a6766779 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] IE7 and document.ready
Yes, $(document).ready() should only happen once - when the document is first ready. What you're using for magic would infuriate developers on most other projects! :) You should have a separate function for an ajax callback to do whatever you're doing, even if it's the same code, and you're reusing the same Function object for it. - Brian Webunity | Gilles van den Hoven schrieb: Hi Guys, Just found another document.ready bug at least i hope it is a bug :) The document.ready is not firing in IE7 when loading content via ajax into a DIV. Is this a common problem which is allready known? Someone might have a fix for this? The current scenario fires succesfully in both firefox and IE6 just like i want it to be and is like this: - I load some javascripts in the header of the page, in those headers are document.readys - When i load new data into a div, i want the document.readys to fire again, since they do some jQuery magic As said, this scenario successfully works in both Firefox 1.5.0.2 and IE6, just like i want it to do, but fails in IE7. Hope someone can help me. It's weird that it works in IE6 and FF. So far, the solution to this problem was to execute the document ready code in an ajax callback... -- Jörn ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery Browser Detection
There's always the Ultimate Browser Sniffer. The most updated version does involve some object detection, but mostly still chops up the user agent string. It also detects the version of JS. http://www.webreference.com/tools/browser/javascript.html View source on the page to see the current script. It's big, but probably not that bad when packed (although, you might have to lint it and pick out the little things for it to pack successfully). - Brian On 09/10/06, Brian Miller [EMAIL PROTECTED] wrote: Sam, if that's a problem with your user base, then there are issues that go beyond the technical. If my users were that hackish and black-hatted, I wouldn't be giving them any front-end code at all if I could avoid it. I mean, if people are technically savvy enough to change their user agent string, what stops them from overriding the functions that you provide, as well? I say, we split the difference. Leave jquery's browser detection as is, and offer jUntrustworthy as a plugin, which overrides the original implementation with one that uses object detection. - Brian Perhaps I was being a bit paranoid. Most users don't change the user agent, so perhaps this would be better suited as a plugin and the current implementation left as it is. It is the rendering engine that is important, not the browser itself (and all IE-based browsers have MSIE in). There could always be a plugin that is more specific (which version of IE, AOL, Firefox etc) for working around bugs/crashes etc. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery Browser Detection
I'm inclined to disagree. I believe that one should use object detection for cases in which they are invoking that object for it's functionality. A prime example is the XHR (although MS may be messing around with that in IE7). But, if one is best served by simply knowing what browser we are dealing with, one should absolutely use the user agent string. It's where the browser vendor *tells you* what browser it is. Why hack around, when the vendor is telling you what you need to know? For example: you need to apply a hack to get around one of IE6's infamous layout bugs, when dealing with a dynamic web application. Are you going to test for XHR or window.clipboardData? No, you ask the browser what browser it is. If it's IE6, (or IE 5.5 if the bug is there, too), code for that instance. We should avoid being obtuse in our code. Summary: 1. Use object detection to detect objects, when you don't have to care what browser you're using, as long at the object exists and will do what you want it to. 2. Use the user agent string when you're more interested in what browser you're actually using (by name) than you are in whether or not that browser has a specific object available. - Brian Currently, jQuery does a browser detect by checking the user agent. However, I think object detection would probably be a better way. This code does that by detecting unique obects on the window object. However, I am not sure what is unique to Safari. // Figure out what browser is being used jQuery.browser = { safari: /webkit/.test(b), opera: !!window.opera !!window.opera.defineMagicFunction, msie: !!window.clipboardData, mozilla: !!window.XPCNativeWrapper }; The chance of someone defining 'window.opera.defineMagicFunction', window.clipboardData' and 'window.XPCNativeWrapper' is virtually non existent (far far less likely than someone changing the user agent string). defineMagicFunction (http://www.opera.com/support/tutorials/userjs/specs/) is used by user scripts on Opera, clipboardData (http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/clipboarddata.asp) is for working with the clipboard and XPCNativeWrapper (http://kb.mozillazine.org/XPCNativeWrapper) is used by privileged code (i.e. extensions) to access unprivileged code (i.e. content on a webpage) in a secure way. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery Browser Detection
Sam, if that's a problem with your user base, then there are issues that go beyond the technical. If my users were that hackish and black-hatted, I wouldn't be giving them any front-end code at all if I could avoid it. I mean, if people are technically savvy enough to change their user agent string, what stops them from overriding the functions that you provide, as well? I say, we split the difference. Leave jquery's browser detection as is, and offer jUntrustworthy as a plugin, which overrides the original implementation with one that uses object detection. - Brian On 09/10/06, Brian Miller [EMAIL PROTECTED] wrote: I'm inclined to disagree. I believe that one should use object detection for cases in which they are invoking that object for it's functionality. A prime example is the XHR (although MS may be messing around with that in IE7). But, if one is best served by simply knowing what browser we are dealing with, one should absolutely use the user agent string. It's where the browser vendor *tells you* what browser it is. Why hack around, when the vendor is telling you what you need to know? For example: you need to apply a hack to get around one of IE6's infamous layout bugs, when dealing with a dynamic web application. Are you going to test for XHR or window.clipboardData? No, you ask the browser what browser it is. If it's IE6, (or IE 5.5 if the bug is there, too), code for that instance. We should avoid being obtuse in our code. Summary: 1. Use object detection to detect objects, when you don't have to care what browser you're using, as long at the object exists and will do what you want it to. 2. Use the user agent string when you're more interested in what browser you're actually using (by name) than you are in whether or not that browser has a specific object available. - Brian So what do you do in the case when the user agent string has been changed (all browser vendors allow it to be changed)? I just don't completely trust what the user agent string returns. I am testing for objects, but these objects are unique to each browser. You could say it is abusing the objects (i.e. not using them for what they are intended for). There is no foolproof solution to browser detection though. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to implement file upload using AJAX?
You can't use ajax to send files. It's not supported because it's not permitted. The libraries that do it (e.g. Yahoo UI) create a hidden iframe on the fly, with a form inside the iframe (that has a file upload control), which gets submitted. It's as much of a pain as it sounds like it is. Other efforts use Flash or a Java applet to help. That said, it's possible that someone can put together a plugin that implements the iframe hack. - Brian Hi, Does anybody know how a file pload using AJAX can be implemented in JQuery? If so, please give me an example. I intend to use PHP for the data receiving, but the problem is the sending actually. Thanks in advance Emilian -- View this message in context: http://www.nabble.com/How-to-implement-file-upload-using-AJAX--tf2408953.html#a6714606 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery Plugin question
Create an empty object, pass it to the .each() block, and add each id as a property of it as you go. My first crack (which is probably hopelessly b0rked, but may get the point across...): var myInputs = {}; function sliderCallback { myInputs[this.id].rangeEl = $(this).siblings().filter(input.range); ...; }; $(.slider).each( sliderCallback( myInputs ) ); I hope I'm on the right track...? - Brian Is there a way to set a variable in an each that will be stored separately for each instance of the plugin (for example, if I am performing an action on all inputs, is there a way to store the input type and reuse it later?). Maybe I'm not being clear, so here's the example: $(.slider).each(function() { rangeEl = $(this).siblings().filter(input.range); rangeEl.css(border, 1px solid green); rangeMax = parseInt(rangeEl.attr(max)) || 100; rangeMin = parseInt(rangeEl.attr(min)) || 0; rangeVal = parseInt(rangeEl.val()) || 0; step = parseInt(rangeEl.attr(step)); difference = rangeMax - rangeMin; differential = difference / 100.0; $(this).Slider({ accept: .indicator, fractions: (difference / step), onSlide: function(cordx, cordy, x , y) { rangeEl.val(parseInt((cordx * differential) + rangeMin)) } }); $(this).SliderSetValues([[234 * ((rangeVal - rangeMin) / (difference)),0]]); rangeEl.val(rangeVal); }); What seems to be happening is that the rangeEl element is getting overwritten, and all sliders are using the same (last) element. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Chainable if/else - hot or not?
I like this idea. I think that it gives everyone what they want, and none of the methods are going to be as confusing to a newcomer that way. My one complaint is that I don't like filterend as a method name. It sounds... clunky. I'm sure that one of us can do better. :) - Brian Hi, I don't know, I've been using .filter( foo, Function ) and .find( foo, Function ) for a while now and I find them to be immensely useful - especially considering that they're non-destructive. Well, if it was destructive it would be more consistent. I don't think that it would be a problem, because you always have end(): $('.hideme').hide().filter('.showme').show().end().addclass('IamCrazy'); is currently equivalent to $('.hideme').hide().filter('.showme', function() { $(this).show(); }).addclass('IamCrazy'); It feels a bit odd to me. I'd expect this to be equal to the first line: $('.hideme').hide().filter('.showme', function() { $(this).show(); }).end().addclass('IamCrazy'); The Problem arises when chaining a lot of filter(), find(), etc. functions. Then your way is IMO less readable. How about shortcut-functions for e.g. filter().end(): $.fn.filterend = function(s,c) { return this.filter(s,c).end(); } $('.hideme').hide().filterend('.showme', function() { $(this).show(); }).addclass('IamCrazy'); I think that would be less confusing. Just my 2 cents. Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Chainable if/else - hot or not?
Elegant? Perhaps. Breaks the Principle of Least Surprise? Absolutely, unfortunately. I'm with Chris. One method that's always destructive, and another method that's always not. - Brian I thought, I'd add on my personal thoughts on this subject. Personally, I find the anonymous function version of filter et. al. to be quite intuitive. You can either modify the stack temporarily and continue the chain until you .end() this modified stack and return to the original, or you can simply apply the methods you want to the argument you provided leaving the original stack intact without needing to .end() the modified stack seeing as it wasn't modified. Please please keep this syntax as it's too elegant to not keep around. -blair Christof Donat wrote: Hi, [...] .method( Hash, arg1, ..., argN, ContextFunction ) [...] That all was not my point. My point was that it is irritating that the same function may be destructive or not just by providing the context-function. I'd vote for either never be destructive, or always. Since for functions like filter() it is difficult to go the never destructive-way, I'd like it to be always destructive and have an alternative version which is never destructive. So, with .filter(foo,function) I'm taking the opportunity to remove the need for: .filter(foo).each(function(){ }).end() That is exactly what the suggestet the filterend()-function is for. That way filter() ist always destructive and filterend() never. In both cases with or without a context function. $('div').filter('.test') // return value only contains divs with class 'test' $('div').filter('.test, // return value only contains divs with class 'test' function() { ... }); $('div').filterend('.test') // return value contains all divs (useless) $('div').filterend('.test, // return value contains all divs function() { ... }); The last to calls have the same effect as $('div').filter('.test').end() $('div').filter('.test').each( function() { ... }).end(); In all cases the context function is evaluated for each div with the class 'test'. The difference between filter() and filterend() is just the return value. Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Fast form serializer function for review
I'd say that .serialize() should take a boolean argument, retainOrder, which will retain semantic order if true, and not if false/null/not entered. That would be perfect. The documentation should then make clear that the retainOrder option will be slower for large forms. - Brian I wonder if we could reduce the overall code by merging both seriliaze methods. -- Jörn ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] input and textarea field resizing
I ran across a plugin that would automatically expand an input or text area field while typing... but I can't seem to find it now. Anyone know what I'm talking about or where its at? Thanks. -- View this message in context: http://www.nabble.com/input-and-textarea-field-resizing-tf2376275.html#a6620356 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] input and textarea field resizing
Ugh, and I just went to the Interface site and didn't see it. Thanks. -- View this message in context: http://www.nabble.com/input-and-textarea-field-resizing-tf2376275.html#a6620900 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/