[jquery-dev] Re: suggestion: delayed related AJAX requests

2009-03-27 Thread oliver

Quick passes:

jQuery.delay = function(callback, delay) {
var timeout;
return function() {
clearTimeout(timeout);
timeout = setTimeout(callback, delay);
}
}

jQuery.throttle = function(callback, delay) {
var prev = new Date().getTime() - delay;
return function() {
var now = new Date().getTime();
if (now - prev > delay) {
prev = now;
callback.call();
}
}
}


On Mar 27, 11:38 pm, oliver  wrote:
> I agree that this is a common use case, and also that it would be
> better implemented as an optional parameter to ajax rather than a
> wholly separate method.
>
> I find I also use similar code within animations, so perhaps the code
> could be implemented in such a way as to also be exposed as a utility
> function.
>
> Perhaps: $.delay(function, delay) - returns a function handler which
> can be called many times, but the registered function will only fire
> once, [delay] milliseconds after the last time it was called.  The
> innards of the function would be mostly as Miloš has above.
>
> A potentially useful corollary might be: $.throttle(function, delay) -
> returns a function handler which could be called as many times as
> desired, but the registered function would only fire every [delay]
> millis at most.
>
> Names are just off the top of my head, of course.
>
> oliver
>
> On Mar 27, 3:27 pm, Daniel Friesen  wrote:
>
>
>
> > Rather than an entire other function, what about just a {delay: ms} to .ajax
>
> > ~Daniel Friesen (Dantman, Nadir-Seen-Fire)
>
> > Miloš Rašić wrote:
> > > Here's a suggestion for a feature that I think would be useful to AJAX
> > > developers. Sometimes, we need an AJAX feature that could allow a user
> > > to cause a large number of consequent AJAX requests, for example in
> > > auto-complete for searches (like Google Suggest) or filter forms that
> > > submit whenever something is changed in them. In a case like this,
> > > especially when the user has a slow internet connection, we have no
> > > way of knowing if the AJAX responses will arrive in the same order as
> > > the requests were sent. A solution to this is to wait for some time to
> > > make sure that the user has stopped manipulating the controls that
> > > cause AJAX requests before sending a request. At the moment, I do it
> > > like this:
>
> > >    function submit_filter() {
> > >            $('#item_list').html('loading...');
> > >            $.post('some url',$('#filter').serialize(),function(data) {
> > >                    $('#item_list').html(data);
> > >            });
> > >            return false;
> > >    }
>
> > >    $('.ajax_control').change(function() {
> > >            clearTimeout(ajaxTimeout);
> > >            ajaxTimeout = setTimeout(submit_filter,2000);
> > >    });
>
> > > Basically, whenever a control is changed a timeout for ajax request is
> > > reset to 2 seconds. A request is sent only when a user changes
> > > something an hasn't made new changes last 2 seconds.
>
> > > Since this is a frequent use case, it would be great if there would be
> > > a $.post_delayed() function which would have additional 2 parameters:
> > > an id, which would be used to identify related controls, and a time
> > > interval to wait before submitting the request.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Re: suggestion: delayed related AJAX requests

2009-03-27 Thread oliver

I agree that this is a common use case, and also that it would be
better implemented as an optional parameter to ajax rather than a
wholly separate method.

I find I also use similar code within animations, so perhaps the code
could be implemented in such a way as to also be exposed as a utility
function.

Perhaps: $.delay(function, delay) - returns a function handler which
can be called many times, but the registered function will only fire
once, [delay] milliseconds after the last time it was called.  The
innards of the function would be mostly as Miloš has above.

A potentially useful corollary might be: $.throttle(function, delay) -
returns a function handler which could be called as many times as
desired, but the registered function would only fire every [delay]
millis at most.

Names are just off the top of my head, of course.

oliver

On Mar 27, 3:27 pm, Daniel Friesen  wrote:
> Rather than an entire other function, what about just a {delay: ms} to .ajax
>
> ~Daniel Friesen (Dantman, Nadir-Seen-Fire)
>
>
>
> Miloš Rašić wrote:
> > Here's a suggestion for a feature that I think would be useful to AJAX
> > developers. Sometimes, we need an AJAX feature that could allow a user
> > to cause a large number of consequent AJAX requests, for example in
> > auto-complete for searches (like Google Suggest) or filter forms that
> > submit whenever something is changed in them. In a case like this,
> > especially when the user has a slow internet connection, we have no
> > way of knowing if the AJAX responses will arrive in the same order as
> > the requests were sent. A solution to this is to wait for some time to
> > make sure that the user has stopped manipulating the controls that
> > cause AJAX requests before sending a request. At the moment, I do it
> > like this:
>
> >    function submit_filter() {
> >            $('#item_list').html('loading...');
> >            $.post('some url',$('#filter').serialize(),function(data) {
> >                    $('#item_list').html(data);
> >            });
> >            return false;
> >    }
>
> >    $('.ajax_control').change(function() {
> >            clearTimeout(ajaxTimeout);
> >            ajaxTimeout = setTimeout(submit_filter,2000);
> >    });
>
> > Basically, whenever a control is changed a timeout for ajax request is
> > reset to 2 seconds. A request is sent only when a user changes
> > something an hasn't made new changes last 2 seconds.
>
> > Since this is a frequent use case, it would be great if there would be
> > a $.post_delayed() function which would have additional 2 parameters:
> > an id, which would be used to identify related controls, and a time
> > interval to wait before submitting the request.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Re: Structure Plugin Authoring

2009-03-27 Thread Daniel Friesen

Bleh, I never noticed this one.

The __load is actually there pretty much for completeness just to make 
coding of plugins complete when we have __unload. Quite frankly __load 
would probably be run right after you run addPlugin in your plugin's js.
The __unload would be run if someone decided to run 
.removePlugin('yourName');

If really wanted we could actually set things up so you could unload a 
plugin and reload it without running the actual plugin code.

~Daniel Friesen (Dantman, Nadir-Seen-Fire)

tres wrote:
> I like where you are going with that. Please elaborate a bit on your
> idea of what would constitute loading and unloading.
>
> Mike, where you been?
>
> -Trey
>
>
>
> On Mar 12, 9:11 am, Daniel Friesen  wrote:
>   
>> After a bit of thought I just thought about one.
>> A __load and __unload for when the plugin is loaded and unloaded. This
>> will allow for the plugin to do extension type stuff and be able to unload.
>>
>> Assuming jQuery.css.addHook and jQuery.css.removeHook for adding and
>> removing css hooks (an extensibility feature that ideally will get into
>> jQuery after John does his $.attr and $.curCSS refactor)
>>
>> (function(jQuery) {
>>
>> function cssCallback(elem, name, value, force) {
>>   ...
>>
>> }
>>
>> jQuery.addPlugin('obscureCompat', {
>>   __load: function() {
>> jQuery.css.addHook(cssCallback);
>>   },
>>   __unload: function() {
>> jQuery.css.removeHook(cssCallback);
>>   }
>>
>> });
>> })(jQuery);
>>
>> ~Daniel Friesen (Dantman, Nadir-Seen-Fire)
>>
>> tres wrote:
>> 
>>> Thanks for the feedback, Daniel.
>>>   
>>> I see what you mean about jQuery.options instead of jQuery.fn.options.
>>> My reasoning for this, though, is by putting it on .fn you can assign
>>> different options to different elements instead of setting it globally
>>> for the plugin. This way options are persistent and can be changed on
>>> the fly.
>>>   
>>> I did think about giving the ability to assign a plugin to jQuery and
>>> not just jQuery.fn, but couldn't find a very graceful way to implement
>>> it as I just wanted to get the .fn working first. Could add a third,
>>> boolean, argument called addToFn and default it to true since it is
>>> the most likely case.
>>>   
>>> "Magic" methods can also be supported. Say you want to execute a
>>> function when the object is constructed, or when the options are
>>> changed. This isn't currently documented, but '__construct' works,and
>>> others would be fairly easy to implement.
>>>   
>>> Another idea would be to have an argument in jQuery.addPlugin to pass
>>> in an object of default options which would automatically apply
>>> options to the passed objects using jQuery.fn.options.
>>>   
>>> That said, I'm trying to keep a good balance of simplicity and
>>> extensibility, so more features isn't necessarily the right answer.
>>>   
>>> Anybody have anymore ideas or want to collaborate?
>>>   
>>> Thanks,
>>> -Trey
>>>   
>>> On Mar 5, 1:34 pm, Daniel Friesen  wrote:
>>>   
 I think it could do with the ability to handle methods on jQuery itself
 instead of being limited to just jQuery.fn, perhaps a second
 object/function to addPlugin;
 
 Likewise I'd prefer jQuery.options over jQuery.fn.options;
 
 ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://nadir-seen-fire.com]
 -Nadir-Point & Wiki-Tools (http://nadir-point.com) (http://wiki-tools.com)
 -MonkeyScript (http://monkeyscript.org)
 -Animepedia (http://anime.wikia.com)
 -Narutopedia (http://naruto.wikia.com)
 -Soul Eater Wiki (http://souleater.wikia.com)
 
 treshug...@gmail.com wrote:
 
> There has been a lot of activity about plugin authoring and how it can
> be more structured and extensible. I've posted a couple of comments on
> some threads and sent an email to John, but I thought I'd create a new
> thread since I haven't had any feedback yet. John, I understand you
> probably get a lot of email and are very busy.
>   
> I've written a plugin that I'd like to get feedback on from you guys.
> It's still evolving, but should be stable in what it currently is
> designed to do and I have found it invaluable when authoring larger,
> more advanced plugins. It would be nice to see similar functionality
> built into jQuery as I think others would also find it useful.
>   
> Link:http://plugins.jquery.com/project/plugin-authoring
>   
> Cheers,
> Trey
>   
> >
>   

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--

[jquery-dev] Re: Color library

2009-03-27 Thread Daniel Friesen

I was thinking of doing some work on the Color library today but it 
looks like the code isn't accessible anymore.

~Daniel Friesen (Dantman, Nadir-Seen-Fire)

Daniel Friesen wrote:
> Just following up with a note. I didn't get around to setting up the
> repo right away, and on Friday the UI on my laptop completely broke. I
> have the entire hard drive safe but setting up the environment on the
> new system will take a bit of time. I'll startup a repo once I get
> back into a good dev environment.
>
> On Mar 5, 3:15 am, Daniel Friesen  wrote:
>   
>> Mark Gibson wrote:
>> 
>>> Hi Daniel, thanks for your feedback, just to clear up some points:
>>>   
>>> On Mar 4, 10:10 am, Daniel Friesen  wrote:
>>>   
 I'm not really a fan of the [float, float, float] but if 'rgb(255, 255,
 255)'; is supported I suppose that's ok (heck I could throw a function
 rgb(r, g, b) into code).is taking time.
 
>>> RGB values use the range 0..255, whereas HSV is 0..1 - even the hue
>>> value.
>>> I didn't see the point in using degrees asJavascriptangles are in
>>> radians anyway, so I though 0..1 was the best compromise.
>>>   
 However I don't really like the explicit $.color.parse call, I think
 these should already understand that if a string is passed the data
 should be parsed.
 
>>> This is what thecolor.object.js code is for. It provides a simple to
>>> use object that will accept a variety of value presentations. I've
>>> modelled it on the way jQuery.Event works. So you can choose whether
>>> to explicitly use 'new' or not. Examples:
>>>   
>>> $.Color('rgb(255,255,255)')
>>> new $.Color('#ff')
>>> new $.Color([255,255,255], 'RGB')
>>> $.Color([128,0,255])
>>> $.Color('red')
>>> $.Color('rgb(50%,0%,100%)', 'HSV')
>>>   
>>> The first arg is your colour: as a valid CSS string or $.Colorobject
>>> or an array of channel values.
>>> The second arg is the colour space you wish the new object to be in.
>>>   
>>> If the first arg is an array, then the second indicates what space
>>> that array represents (defaults to 'RGB').
>>> But if a string or $.Colorobject is supplied then it is converted to
>>> the colour space requested.
>>>   
>>> Internally $.Colorbasically just extends the Array object -
>>> containing the individual channel values, and adds some methods and a
>>> 'type' property that indicates the colour space ('RGB', 'HSV' etc.) -
>>> these types are implemented by functions kept in the $.color.RGB/
>>> $.color.HSV namespaces. This allows users of thelibrarya choice of
>>> functional or OO depending on their needs.
>>>   
>>> * If you know you have a string (ie, a CSS value) and only want RGB
>>> values then this will do: $.color.parse(str)
>>>   
>>> * If you want to convert it to a HEX representation, you have the
>>> choice:
>>> $.color.RGB.toHEX($.color.parse(str))
>>> or
>>> $.Color(str).to('HEX') - this is essentially an OO wrapper for the
>>> above
>>>   
>>> * To get a colour as HSV regardless of it's original form (ie, could
>>> be a string, or a $.Colorobject of either RGB or HSV):
>>> $.Color(color, 'HSV')
>>>   
 Is there an actual repository yet? If you don't have one yet then at
 least a small github repo for now would be good. Then I can fork (fork
 in git speak, nothing to do with project forking) and commit
 improvements you can pull.
 
>>> It's currently in our internal SVN, was hoping to use jQuery-UI repos
>>> eventually. I'm a bit busy on other things at present, so thelibrary
>>> is on hold for a couple of weeks and won't be changed by me. I've not
>>> used git for much, so if you'd like to setup a public repos for it,
>>> feel free to grab the code in it's current state, that would be great
>>> - same goes for the colour picker too.
>>>   
>> Sure. It's late right now, so I'll probably do it tomorrow. I'll setup a
>> repo or two on GitHub. That way you can just hit fork on GitHub and the
>> Network tab will start tracking both of us and show the differences
>> between what we've committed to flag new things to pull from each other.
>>
>> 
 I'm very interested in thatcolorpicker to. Every othercolorpicker
 I've run into has been a full fledged bloatedcolorpicker that defines
 the entire ui, or uses some crappy theming system. However that one you
 have basically just defines nothing but the standard UI pieces that are
 stuck inside ofcolorpickers. That's the kind of thing minimalist
 enough for me to make use of inside our project at work.
 We're not using a stockcolorpicker because as part of our UI we're
 also trying to improve the usability and try new things with thecolor
 picker.
 
>>> Yeah, this is one of the main reasons I started my own.
>>>   
 However at the same time while you have the hue bar and hue wheel, it
 doesn't have the classic wheel with internal 
 triangle:http://www.qtsoft

[jquery-dev] Re: Need help with an IE issue (of course!)

2009-03-27 Thread Gilles

I replaced all the ; by some \n but the result is the same, I am using
the for approach at the moment.
And I have amended all my loop to use var i = 0; thanks for pointing
that out :)



On Mar 27, 10:14 pm, Daniel Friesen  wrote:
> code += init.join(';')+';';
>
> and
>
> for (i = 0; i < jsl-1; i++) code += init[i]+';';
>
> Don't output the same.
> For "" the first one will be ";" the second one will stay ""
> It's possible that IE has an issue with eval(";"); if I understand this
> thread right.
>
> Side note, you should be using for (var i = 0
>
> ~Daniel Friesen (Dantman, Nadir-Seen-Fire)
>
> Gilles wrote:
> > Ok, I don't have the bug anymore, but my script is no longer working
> > (and I know why so at least I know where to look)
>
> > For information purposes all I did was changed this line
>
> > code += init.join(';')+';';
>
> > to this line and the error message went away
>
> > for (i = 0; i < jsl-1; i++) code += init[i]+';';
>
> > only issue is, I use an alert to display code afterward and this is
> > what happens:
>
> > 1. When the first line is used the alert will display the code to eval
> > perfectly, but the error message will be there and the code doesn't
> > work
> > 2. When the second line is used the alert is blank, and of course
> > there is no error because it eval('');
>
> > Note the jsl-1 is temporary it's just in my example need the ui core
> > so removed 1 out of the new length to avoid undefined being inserted
> > in the code, at start I thought that it was the reason for the alert
> > being blank, but it isn't)
>
> > Both lines of code works perfectly as expected in FF3 (haven't tried 2
> > yet) and Safari 4 (accordion bit jerky on it like on ie)
> >http://codeserenity.com/jquery/scriptless/demo4.html- for demo - code
> > same as above but 4, working on it so might not always work :p
>
> > So my guess is join() and += in IE don't work the same. I don't know
> > why the code variable becomes blank tho. The only silly thing I think
> > of is maybe the return of eval is ''. My only worry is that if I can
> > make it not blank I'll just get the error again.
>
> > Oh, and only tried on IE7 so far as well for the bug, not IE6 or IE8.
>
> > On Mar 27, 5:18 pm, Gilles  wrote:
>
> >> Thanks for that great tip, I'll try to keep that in mind :)
>
> >> On Mar 27, 3:21 pm, Tony Dillon  wrote:
>
> >>> Hi Karl,
> >>> Boy, these sure are some of the hardest problems to track down This is
> >>> why I always try to do my comparisons using the format:
>
> >>> if( 'constant' == $variable )
>
> >>> so it gets picked up as an error by the compiler (because of course you
> >>> can't assign a variable to a string constant).
>
> >>> Hope this helps you avoid future problems.
>
> >>> Be well,
> >>> Tony
>
> >>> On Fri, Mar 27, 2009 at 3:09 PM, Gilles  wrote:
>
>  Thanks for pointing it out Karl, will go fix that now, can't believe I
>  type that wrong.
>
>  Karl Swedberg wrote:
>
> > Hi Gilles,
>
> > Not sure about that bug, but wondering if these lines are
> > intentionally assigning the variable rather than testing for equality :
>
> >                       if (d = 'ui') js.push('ui.'+cw); // line 151
> >                       else if (d = 'fx') js.push('effects.'+cw); // line
>
>  152
>
> >                       if (d = 'ui') css.push('ui.'+cw);  // line 156
>
> > seems they should have == rather than = .
>
> > --Karl
>
> > 
> > Karl Swedberg
> >www.englishrules.com
> >www.learningjquery.com
>
> > On Mar 27, 2009, at 5:06 AM, Gilles wrote:
>
> >> Not sure wether it would help or not but here full plugin code.
>
> >>http://codeserenity.com/jquery/scriptless/js/jquery.scriptless3.js
>
> >> If anyone know how I could get rid off that "Object doesn't support
> >> property" bug on IE I would really appreciate. Any advices and/or tips
> >> on how to improve it would be welcome as well, still learning :)
>
> >> On Mar 26, 12:23 pm, John Resig  wrote:
>
> >>> I'm not seeing an issue off-hand - could you simplify the code that
> >>> you're trying to execute? For example, does this error only occur if
> >>> getScript is used?
>
> >>> --John
>
> >>> On Thu, Mar 26, 2009 at 7:15 AM, Gilles  wrote:
>
>  Hi,
>
>  I normally bebug my code myself, cos I believe it helps me improve
>  myself, but here I just can't figure it out.
>
>  basically I am writing a JQuery plugin, that JQuery plugin
>  generate a
>  bit of code that I then eval later. The code is a casacde of
>  getScript
>  with some initialization command being trigger in the middle (when
>  all
>  the getScript are finished)
>
>  To make my life easy I thought I use $.globalEval(code) to make sure
>  it works accross all browsers. Like expected no issue with safari 3,
>  safari 4, FF2 or FF3 but as soon as i tried my test page on 

[jquery-dev] Re: suggestion: delayed related AJAX requests

2009-03-27 Thread Daniel Friesen

Rather than an entire other function, what about just a {delay: ms} to .ajax

~Daniel Friesen (Dantman, Nadir-Seen-Fire)

Miloš Rašić wrote:
> Here's a suggestion for a feature that I think would be useful to AJAX
> developers. Sometimes, we need an AJAX feature that could allow a user
> to cause a large number of consequent AJAX requests, for example in
> auto-complete for searches (like Google Suggest) or filter forms that
> submit whenever something is changed in them. In a case like this,
> especially when the user has a slow internet connection, we have no
> way of knowing if the AJAX responses will arrive in the same order as
> the requests were sent. A solution to this is to wait for some time to
> make sure that the user has stopped manipulating the controls that
> cause AJAX requests before sending a request. At the moment, I do it
> like this:
>
>   function submit_filter() {
>   $('#item_list').html('loading...');
>   $.post('some url',$('#filter').serialize(),function(data) {
>   $('#item_list').html(data);
>   });
>   return false;
>   }
>
>   $('.ajax_control').change(function() {
>   clearTimeout(ajaxTimeout);
>   ajaxTimeout = setTimeout(submit_filter,2000);
>   });
>
> Basically, whenever a control is changed a timeout for ajax request is
> reset to 2 seconds. A request is sent only when a user changes
> something an hasn't made new changes last 2 seconds.
>
> Since this is a frequent use case, it would be great if there would be
> a $.post_delayed() function which would have additional 2 parameters:
> an id, which would be used to identify related controls, and a time
> interval to wait before submitting the request.
>
> >
>   

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Re: Need help with an IE issue (of course!)

2009-03-27 Thread Daniel Friesen

code += init.join(';')+';';

and

for (i = 0; i < jsl-1; i++) code += init[i]+';';

Don't output the same.
For "" the first one will be ";" the second one will stay ""
It's possible that IE has an issue with eval(";"); if I understand this 
thread right.

Side note, you should be using for (var i = 0

~Daniel Friesen (Dantman, Nadir-Seen-Fire)

Gilles wrote:
> Ok, I don't have the bug anymore, but my script is no longer working
> (and I know why so at least I know where to look)
>
> For information purposes all I did was changed this line
>
> code += init.join(';')+';';
>
> to this line and the error message went away
>
> for (i = 0; i < jsl-1; i++) code += init[i]+';';
>
> only issue is, I use an alert to display code afterward and this is
> what happens:
>
> 1. When the first line is used the alert will display the code to eval
> perfectly, but the error message will be there and the code doesn't
> work
> 2. When the second line is used the alert is blank, and of course
> there is no error because it eval('');
>
> Note the jsl-1 is temporary it's just in my example need the ui core
> so removed 1 out of the new length to avoid undefined being inserted
> in the code, at start I thought that it was the reason for the alert
> being blank, but it isn't)
>
> Both lines of code works perfectly as expected in FF3 (haven't tried 2
> yet) and Safari 4 (accordion bit jerky on it like on ie)
> http://codeserenity.com/jquery/scriptless/demo4.html - for demo - code
> same as above but 4, working on it so might not always work :p
>
> So my guess is join() and += in IE don't work the same. I don't know
> why the code variable becomes blank tho. The only silly thing I think
> of is maybe the return of eval is ''. My only worry is that if I can
> make it not blank I'll just get the error again.
>
> Oh, and only tried on IE7 so far as well for the bug, not IE6 or IE8.
>
>
>
> On Mar 27, 5:18 pm, Gilles  wrote:
>   
>> Thanks for that great tip, I'll try to keep that in mind :)
>>
>> On Mar 27, 3:21 pm, Tony Dillon  wrote:
>>
>> 
>>> Hi Karl,
>>> Boy, these sure are some of the hardest problems to track down This is
>>> why I always try to do my comparisons using the format:
>>>   
>>> if( 'constant' == $variable )
>>>   
>>> so it gets picked up as an error by the compiler (because of course you
>>> can't assign a variable to a string constant).
>>>   
>>> Hope this helps you avoid future problems.
>>>   
>>> Be well,
>>> Tony
>>>   
>>> On Fri, Mar 27, 2009 at 3:09 PM, Gilles  wrote:
>>>   
 Thanks for pointing it out Karl, will go fix that now, can't believe I
 type that wrong.
 
 Karl Swedberg wrote:
 
> Hi Gilles,
>   
> Not sure about that bug, but wondering if these lines are
> intentionally assigning the variable rather than testing for equality :
>   
>   if (d = 'ui') js.push('ui.'+cw); // line 151
>   else if (d = 'fx') js.push('effects.'+cw); // line
>   
 152
 
>   if (d = 'ui') css.push('ui.'+cw);  // line 156
>   
> seems they should have == rather than = .
>   
> --Karl
>   
> 
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
>   
> On Mar 27, 2009, at 5:06 AM, Gilles wrote:
>   
>> Not sure wether it would help or not but here full plugin code.
>> 
>> http://codeserenity.com/jquery/scriptless/js/jquery.scriptless3.js
>> 
>> If anyone know how I could get rid off that "Object doesn't support
>> property" bug on IE I would really appreciate. Any advices and/or tips
>> on how to improve it would be welcome as well, still learning :)
>> 
>> On Mar 26, 12:23 pm, John Resig  wrote:
>> 
>>> I'm not seeing an issue off-hand - could you simplify the code that
>>> you're trying to execute? For example, does this error only occur if
>>> getScript is used?
>>>   
>>> --John
>>>   
>>> On Thu, Mar 26, 2009 at 7:15 AM, Gilles  wrote:
>>>   
 Hi,
 
 I normally bebug my code myself, cos I believe it helps me improve
 myself, but here I just can't figure it out.
 
 basically I am writing a JQuery plugin, that JQuery plugin
 generate a
 bit of code that I then eval later. The code is a casacde of
 getScript
 with some initialization command being trigger in the middle (when
 all
 the getScript are finished)
 
 To make my life easy I thought I use $.globalEval(code) to make sure
 it works accross all browsers. Like expected no issue with safari 3,
 safari 4, FF2 or FF3 but as soon as i

[jquery-dev] Re: CONTEXT LOGIC

2009-03-27 Thread Daniel Friesen

Context is not scope!

Context's purpose is not to narrow down querying. It is perfectly valid 
to use a selector without context. Context's purpose is for sorting out 
document context.

You're telling me that my $('#foo .someclass'); selectors are slow 
because they don't have context, which is a horrible lie.

~Daniel Friesen (Dantman, Nadir-Seen-Fire)

DBJDBJ wrote:
> Can we just have next  jQuery(selector, context)  version throw an
> exception,
> IF context argument is not jQ instance or dom element exception will
> be thrown. As simple as that.
>
> I would even suggest going even further. Throw an exception if context
> argument is not given.
> Make context mandatory. And make it right.
>
> Otherwise people will start blaming jQuery for slow pages, instead of
> sorting out their lazy $(selector) calls without any context given
> to act as a SCOPE to narrow down the querying of the dom document
> tree ...
>
>
> On Mar 26, 3:04 pm, Daniel Friesen  wrote:
>   
>> Example 1 is invalid jQuery.
>>
>> Example 2's speed comparison to Example 3 is trivial. In fact Example 2
>> has an advantage to it. Do remember IE6's bug with getElementById,
>> jQuery's selectors have code to fix that bug.
>>
>> ~Daniel Friesen (Dantman, Nadir-Seen-Fire)DBJ wrote:
>> 
>>> // jq132-vsdoc.js, line # 145
>>>  return jQuery(context).find(selector);
>>>   
>>> From this one might draw following Conclusions :
>>>   
>>> C1:  if context is not a dom document jQ will find things faster
>>>because the scope of the search is narrow(er)
>>> C2: if context above is a single dom node (aka element) jQ will
>>>   find things the fastest, please refer to:  jq132-vsdoc.js, line # 107
>>>   
>>> (please everyone use this structure in a discussion :
>>> 
>>>
>>>  
>>>  
>>> 
>>>   
>>> 
>>> )
>>>   
>>> We are in the royal mess because we have no crystal clear and
>>> unambigious terminology here. On top of that one important term is
>>> missing:
>>> SCOPE.
>>>   
>>> Right now we have this (by now apparently) ambiguous term: CONTEXT.
>>> Sometimes it is (acts like, is used for) scope and sometime it does not.
>>>   
>>> 1 :: $("[name]", "#people" )  // CONTEXT
>>> (internaly: selector := "#people [name]", context := document )
>>>   
>>> 2 :: $("[name]", $("#people") ) // SCOPE
>>> (internaly: selector := "[name]", context := element with id 'people'  )
>>>   
>>> 3 :: $("[name]", document.getElementByID("people") ) // SCOPE
>>> (internaly: selector := "[name]", context := element with id 'people'  )
>>>   
>>> Do we all agree  with the above? If not we have to, I think.
>>>   
>>> Furthermore. Line 3:: above is the fastest possible $() , because it
>>> boils down to  :
>>> $( document.getElementByID("people")).find("[name]") ;
>>>   
>>> This provides immediate and narrow scope for Sizzle to work in.
>>> (reminder: jQuery.find = Sizzle )
>>>   
>>> And last but not the least >:o)
>>>   
>>> Please refer to : jq132-vsdoc.js, line # 100
>>>   
>>> What am I asking for is to enforce this in jQuery. Nothing much and
>>> nothing else. So :
>>>   
>>> $( selector:string, context:string )
>>>   
>>> Should be forbidden. should throw an exception.
>>>   
>>> The non-enforcing style of jQuery sometimes bears no fruit. The above
>>> line is now possible, same as just saying : $() , because jQuery
>>> authors think it is a "good thing" not to slap junior or senior but
>>> lazy jQuery users, when they do these kind of coding.
>>>   
>>> But. It is a fact that companies are using jQuery. The more they use
>>> it, the more problems they have with code that uses context in a wrong
>>> way. And. 90% of coders actualyl use no context at all. The badly
>>> written code mushroms and slows things down exponentially. One way out
>>> if that (mess?) would be to enforce proper usage of context and define
>>> the term SCOPE. Explain it to people and gently force them to use it.
>>>   
>>> 2009/3/26 Daniel Friesen :
>>>   
 I disagree. First thing to note is there are two definitions of context.
 jQuery(selector).context; And jQuery(selector, context);
 
 They are two different things which overlap just a bit.
 jQuery(selector).context; Is the document context. It is the only
 "context" that is stored in jQuery.
 
 jQuery(selector, context); Is a node/document context for the query.
 It's primary purpose is to establish document context so that jQuery
 knows what document (current document, an iframe, another frameset) to
 perform selectors in and use when constructing new document nodes to
 insert. It does have the ability to be used to limit the scope of a
 query, however that is unintuitive and makes programs confusing to read.
 
 Your pagination example would be better handled in a different way:
 $('.pagination .pagelist'); // jQuery selectors are not single-

[jquery-dev] Re: Need help with an IE issue (of course!)

2009-03-27 Thread Gilles

Ok, I don't have the bug anymore, but my script is no longer working
(and I know why so at least I know where to look)

For information purposes all I did was changed this line

code += init.join(';')+';';

to this line and the error message went away

for (i = 0; i < jsl-1; i++) code += init[i]+';';

only issue is, I use an alert to display code afterward and this is
what happens:

1. When the first line is used the alert will display the code to eval
perfectly, but the error message will be there and the code doesn't
work
2. When the second line is used the alert is blank, and of course
there is no error because it eval('');

Note the jsl-1 is temporary it's just in my example need the ui core
so removed 1 out of the new length to avoid undefined being inserted
in the code, at start I thought that it was the reason for the alert
being blank, but it isn't)

Both lines of code works perfectly as expected in FF3 (haven't tried 2
yet) and Safari 4 (accordion bit jerky on it like on ie)
http://codeserenity.com/jquery/scriptless/demo4.html - for demo - code
same as above but 4, working on it so might not always work :p

So my guess is join() and += in IE don't work the same. I don't know
why the code variable becomes blank tho. The only silly thing I think
of is maybe the return of eval is ''. My only worry is that if I can
make it not blank I'll just get the error again.

Oh, and only tried on IE7 so far as well for the bug, not IE6 or IE8.



On Mar 27, 5:18 pm, Gilles  wrote:
> Thanks for that great tip, I'll try to keep that in mind :)
>
> On Mar 27, 3:21 pm, Tony Dillon  wrote:
>
> > Hi Karl,
> > Boy, these sure are some of the hardest problems to track down This is
> > why I always try to do my comparisons using the format:
>
> > if( 'constant' == $variable )
>
> > so it gets picked up as an error by the compiler (because of course you
> > can't assign a variable to a string constant).
>
> > Hope this helps you avoid future problems.
>
> > Be well,
> > Tony
>
> > On Fri, Mar 27, 2009 at 3:09 PM, Gilles  wrote:
>
> > > Thanks for pointing it out Karl, will go fix that now, can't believe I
> > > type that wrong.
>
> > > Karl Swedberg wrote:
> > > > Hi Gilles,
>
> > > > Not sure about that bug, but wondering if these lines are
> > > > intentionally assigning the variable rather than testing for equality :
>
> > > >                       if (d = 'ui') js.push('ui.'+cw); // line 151
> > > >                       else if (d = 'fx') js.push('effects.'+cw); // line
> > > 152
> > > >                       if (d = 'ui') css.push('ui.'+cw);  // line 156
>
> > > > seems they should have == rather than = .
>
> > > > --Karl
>
> > > > 
> > > > Karl Swedberg
> > > >www.englishrules.com
> > > >www.learningjquery.com
>
> > > > On Mar 27, 2009, at 5:06 AM, Gilles wrote:
>
> > > > > Not sure wether it would help or not but here full plugin code.
>
> > > > >http://codeserenity.com/jquery/scriptless/js/jquery.scriptless3.js
>
> > > > > If anyone know how I could get rid off that "Object doesn't support
> > > > > property" bug on IE I would really appreciate. Any advices and/or tips
> > > > > on how to improve it would be welcome as well, still learning :)
>
> > > > > On Mar 26, 12:23 pm, John Resig  wrote:
> > > > >> I'm not seeing an issue off-hand - could you simplify the code that
> > > > >> you're trying to execute? For example, does this error only occur if
> > > > >> getScript is used?
>
> > > > >> --John
>
> > > > >> On Thu, Mar 26, 2009 at 7:15 AM, Gilles  wrote:
>
> > > > >>> Hi,
>
> > > > >>> I normally bebug my code myself, cos I believe it helps me improve
> > > > >>> myself, but here I just can't figure it out.
>
> > > > >>> basically I am writing a JQuery plugin, that JQuery plugin
> > > > >>> generate a
> > > > >>> bit of code that I then eval later. The code is a casacde of
> > > > >>> getScript
> > > > >>> with some initialization command being trigger in the middle (when
> > > > >>> all
> > > > >>> the getScript are finished)
>
> > > > >>> To make my life easy I thought I use $.globalEval(code) to make sure
> > > > >>> it works accross all browsers. Like expected no issue with safari 3,
> > > > >>> safari 4, FF2 or FF3 but as soon as i tried my test page on IE7
> > > > >>> everything broke...
>
> > > > >>> And of course I get the well know and very easy to debug error
> > > > >>> 80020101.
>
> > > > >>> 1. It's not because of comment (none used anywhere)
> > > > >>> 2. I have tried:
>
> > > > >>> eval(code)
> > > > >>> eval(code,$)
> > > > >>> window.eval(code)
> > > > >>> execScript(code)
> > > > >>> window.execScript(code)
> > > > >>> window['code'] = code; window.eval(window['code'])
> > > > >>> window['code'] = code; eval(window['code'])
> > > > >>> window['code'] = code; window.execScript(window['code'])
> > > > >>> window['code'] = code; execScript(window['code'])
> > > > >>> and many other approach I fund during my search (window.eval ||
> > > > >>> eval)
> > > > >>> (code try {} 

[jquery-dev] Re: reference to undefined property jQuery.cache[id][name] for large element

2009-03-27 Thread John Resig

No, we don't have it on a definite timeline.

--John



On Thu, Mar 26, 2009 at 11:11 PM, hassafrass  wrote:
>
> Hmm, any idea when that release will be :-) ?
>
> On Mar 26, 1:27 pm, John Resig  wrote:
>> Correct, this is an issue with strict mode. It's something that we're
>> looking to tackle in an upcoming release.
>>
>> --John
>>
>> On Thu, Mar 26, 2009 at 3:38 PM, hassafrass  wrote:
>>
>> > updated to 1.3.2 same problem.
>>
>> > On Mar 26, 11:45 am, hassafrass  wrote:
>> >> Also if I change strict warnings in Firefox to false I no longer get
>> >> this message, but then my jquery function fails anyway...
>>
>> >> On Mar 26, 11:19 am, hassafrass  wrote:
>>
>> >> > I am using a jquery plugin (liquid canvas) to round the corners of a
>> >> > div after page load, it works great in Firefox, IE 6 & 7 .  However on
>> >> > certain pages this div is populated with a lot of data which makes it
>> >> > a very long div (many page scrolls) and it breaks firefox with this
>> >> > Jquery error:
>>
>> >> > reference to undefined property jQuery.cache[id][name]   (like 679 of
>> >> > jquery-1.2.6.js)
>>
>> >> > I am assuming this is because of the size, because it only happens
>> >> > when the div is very long, it works fine in IE 6 and IE 7...  I
>> >> > disabled firebug and HTML tidy incase they were interfering...
>>
>> >> > Help
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Re: ADDING METHOD TO OBJECT.PROTOTYPE BREAKS SIZZLE ?

2009-03-27 Thread John Resig

First, please don't use all-caps in your email subjects.

Second, Yes, this is known - and it's highly recommended that you
don't extend Object.prototype - it'll do far more than break jQuery.

Third, it's something that we're looking into for the future, but
please don't do it, regardless of the state of jQuery.

http://erik.eae.net/archives/2005/06/06/22.13.54/

--John



2009/3/27 DBJDBJ :
>
>
> I have found this:
>
> If I do this, in a global scope :
>
> Object.prototype.any_method = function () {}
>
> Then Sizzle fails.
>
> [ jQuery.1.3.2 (uncompressed) ]
>
> 1583:            while (expr && set.length) {
> 1584:                for (var type in Expr.filter) {
> 1585:                    if ((match = Expr.match[type].exec(expr)) !=
> null) {
> 1586:                        var filter = Expr.filter[type], found,
> item;
> 1587:                        anyFound = false;
> 1588:
> 1589:                        if (curLoop == result) {
> 1590:                            result = [];
> 1591:                        }
>
> Line 1585 , causes an exception "Object does not support this property
> or method".
> This is because Expr.match[type].exec is "undefined", when type ==
> any_method
> An it inevitably will become that because of the
> Object.protoype.any_method "extension" ...
>
> In the presence of jQuery (Sizzle) users should be able to add methods
> to Object prototype, I think ?
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Re: Need help with an IE issue (of course!)

2009-03-27 Thread Gilles

Thanks for that great tip, I'll try to keep that in mind :)

On Mar 27, 3:21 pm, Tony Dillon  wrote:
> Hi Karl,
> Boy, these sure are some of the hardest problems to track down This is
> why I always try to do my comparisons using the format:
>
> if( 'constant' == $variable )
>
> so it gets picked up as an error by the compiler (because of course you
> can't assign a variable to a string constant).
>
> Hope this helps you avoid future problems.
>
> Be well,
> Tony
>
> On Fri, Mar 27, 2009 at 3:09 PM, Gilles  wrote:
>
> > Thanks for pointing it out Karl, will go fix that now, can't believe I
> > type that wrong.
>
> > Karl Swedberg wrote:
> > > Hi Gilles,
>
> > > Not sure about that bug, but wondering if these lines are
> > > intentionally assigning the variable rather than testing for equality :
>
> > >                       if (d = 'ui') js.push('ui.'+cw); // line 151
> > >                       else if (d = 'fx') js.push('effects.'+cw); // line
> > 152
> > >                       if (d = 'ui') css.push('ui.'+cw);  // line 156
>
> > > seems they should have == rather than = .
>
> > > --Karl
>
> > > 
> > > Karl Swedberg
> > >www.englishrules.com
> > >www.learningjquery.com
>
> > > On Mar 27, 2009, at 5:06 AM, Gilles wrote:
>
> > > > Not sure wether it would help or not but here full plugin code.
>
> > > >http://codeserenity.com/jquery/scriptless/js/jquery.scriptless3.js
>
> > > > If anyone know how I could get rid off that "Object doesn't support
> > > > property" bug on IE I would really appreciate. Any advices and/or tips
> > > > on how to improve it would be welcome as well, still learning :)
>
> > > > On Mar 26, 12:23 pm, John Resig  wrote:
> > > >> I'm not seeing an issue off-hand - could you simplify the code that
> > > >> you're trying to execute? For example, does this error only occur if
> > > >> getScript is used?
>
> > > >> --John
>
> > > >> On Thu, Mar 26, 2009 at 7:15 AM, Gilles  wrote:
>
> > > >>> Hi,
>
> > > >>> I normally bebug my code myself, cos I believe it helps me improve
> > > >>> myself, but here I just can't figure it out.
>
> > > >>> basically I am writing a JQuery plugin, that JQuery plugin
> > > >>> generate a
> > > >>> bit of code that I then eval later. The code is a casacde of
> > > >>> getScript
> > > >>> with some initialization command being trigger in the middle (when
> > > >>> all
> > > >>> the getScript are finished)
>
> > > >>> To make my life easy I thought I use $.globalEval(code) to make sure
> > > >>> it works accross all browsers. Like expected no issue with safari 3,
> > > >>> safari 4, FF2 or FF3 but as soon as i tried my test page on IE7
> > > >>> everything broke...
>
> > > >>> And of course I get the well know and very easy to debug error
> > > >>> 80020101.
>
> > > >>> 1. It's not because of comment (none used anywhere)
> > > >>> 2. I have tried:
>
> > > >>> eval(code)
> > > >>> eval(code,$)
> > > >>> window.eval(code)
> > > >>> execScript(code)
> > > >>> window.execScript(code)
> > > >>> window['code'] = code; window.eval(window['code'])
> > > >>> window['code'] = code; eval(window['code'])
> > > >>> window['code'] = code; window.execScript(window['code'])
> > > >>> window['code'] = code; execScript(window['code'])
> > > >>> and many other approach I fund during my search (window.eval ||
> > > >>> eval)
> > > >>> (code try {} catch {} etc
>
> > > >>> (debugging IE so tried any stupid way I could think off too which
> > > >>> would explain some of the non-valid example above, I was desperate
> > > >>> lol)
>
> > > >>> 3. I have checked and checked the code I am trying to eval and I
> > > >>> just
> > > >>> don't get it, I am pretty sure it's not a JQuery bug of course,
> > > >>> but as
> > > >>> I am trying to do this via JQuery it give me an excuse to come and
> > > >>> ask
> > > >>> the JQuery community and team where the best javascript developers
> > > >>> are! (kissing asses sometimes help :p)
>
> > > >>> Here is the code I am trying to eval:
>
> > > >>> Unformatted (I tried sending it using return carriage, compressed,
> > > >>> with space none of them works)
>
> > > >>> $.getScript('js/ui.core.js',function(){
> > > >>>        $.getScript('js/ui.dialog.js',function(){
> > > >>>                $.getScript('js/ui.tabs.js',function(){
> > > >>>                        $.getScript('js/ui.datepicker.js',function(){
> > > >>>                                $.getScript('js/
> > > >>> ui.resizable.js',function(){
> > > >>>                                        $.getScript('js/
> > > >>> ui.accordion.js',function(){
> > > >>>                                                $
> > > >>> ('#foo1').dialog({ bgiframe: true, height: 140, modal:
> > > >>> true });
> > > >>>                                                $
> > > >>> ('#foo2').tabs({}); $('#date1').datepicker({altField: '#alt',
> > > >>> altFormat: 'DD, d MM, yy'});
> > > >>>                                                $
> > > >>> ('#foo3').resizable({ maxHeight: 280, maxWidth:

[jquery-dev] jQuery Developers Guide

2009-03-27 Thread brian grinstead


I have been trying to start contributing to the project by creating
test cases in the Bug Tracker and following this mailing list.
However, I have had trouble finding any good guides for actually
fixing bugs in the source.  This is all that I have found from the
site: http://dev.jquery.com/wiki/DevelopersGuide, which just tells me
how to set up a test suite.  I am honestly a little confused, and was
wondering if someone could explain to me the steps they go through
before, during, and after a bug fix.

The UI project has a couple of good documents, like
http://jqueryui.com/docs/Developer_Guide and 
https://jqueryui.pbwiki.com/Bug-Fixing-Guide.
I am not sure if I am just missing something, or if there is not
anything out there right now to help out a developer new to this
project.

Thanks!
Brian

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Re: Need help with an IE issue (of course!)

2009-03-27 Thread Tony Dillon
Hi Karl,
Boy, these sure are some of the hardest problems to track down This is
why I always try to do my comparisons using the format:

if( 'constant' == $variable )

so it gets picked up as an error by the compiler (because of course you
can't assign a variable to a string constant).

Hope this helps you avoid future problems.

Be well,
Tony


On Fri, Mar 27, 2009 at 3:09 PM, Gilles  wrote:

>
> Thanks for pointing it out Karl, will go fix that now, can't believe I
> type that wrong.
>
> Karl Swedberg wrote:
> > Hi Gilles,
> >
> > Not sure about that bug, but wondering if these lines are
> > intentionally assigning the variable rather than testing for equality :
> >
> >   if (d = 'ui') js.push('ui.'+cw); // line 151
> >   else if (d = 'fx') js.push('effects.'+cw); // line
> 152
> >   if (d = 'ui') css.push('ui.'+cw);  // line 156
> >
> > seems they should have == rather than = .
> >
> >
> > --Karl
> >
> > 
> > Karl Swedberg
> > www.englishrules.com
> > www.learningjquery.com
> >
> >
> >
> >
> > On Mar 27, 2009, at 5:06 AM, Gilles wrote:
> >
> > >
> > > Not sure wether it would help or not but here full plugin code.
> > >
> > > http://codeserenity.com/jquery/scriptless/js/jquery.scriptless3.js
> > >
> > > If anyone know how I could get rid off that "Object doesn't support
> > > property" bug on IE I would really appreciate. Any advices and/or tips
> > > on how to improve it would be welcome as well, still learning :)
> > >
> > >
> > >
> > > On Mar 26, 12:23 pm, John Resig  wrote:
> > >> I'm not seeing an issue off-hand - could you simplify the code that
> > >> you're trying to execute? For example, does this error only occur if
> > >> getScript is used?
> > >>
> > >> --John
> > >>
> > >> On Thu, Mar 26, 2009 at 7:15 AM, Gilles  wrote:
> > >>
> > >>> Hi,
> > >>
> > >>> I normally bebug my code myself, cos I believe it helps me improve
> > >>> myself, but here I just can't figure it out.
> > >>
> > >>> basically I am writing a JQuery plugin, that JQuery plugin
> > >>> generate a
> > >>> bit of code that I then eval later. The code is a casacde of
> > >>> getScript
> > >>> with some initialization command being trigger in the middle (when
> > >>> all
> > >>> the getScript are finished)
> > >>
> > >>> To make my life easy I thought I use $.globalEval(code) to make sure
> > >>> it works accross all browsers. Like expected no issue with safari 3,
> > >>> safari 4, FF2 or FF3 but as soon as i tried my test page on IE7
> > >>> everything broke...
> > >>
> > >>> And of course I get the well know and very easy to debug error
> > >>> 80020101.
> > >>
> > >>> 1. It's not because of comment (none used anywhere)
> > >>> 2. I have tried:
> > >>
> > >>> eval(code)
> > >>> eval(code,$)
> > >>> window.eval(code)
> > >>> execScript(code)
> > >>> window.execScript(code)
> > >>> window['code'] = code; window.eval(window['code'])
> > >>> window['code'] = code; eval(window['code'])
> > >>> window['code'] = code; window.execScript(window['code'])
> > >>> window['code'] = code; execScript(window['code'])
> > >>> and many other approach I fund during my search (window.eval ||
> > >>> eval)
> > >>> (code try {} catch {} etc
> > >>
> > >>> (debugging IE so tried any stupid way I could think off too which
> > >>> would explain some of the non-valid example above, I was desperate
> > >>> lol)
> > >>
> > >>> 3. I have checked and checked the code I am trying to eval and I
> > >>> just
> > >>> don't get it, I am pretty sure it's not a JQuery bug of course,
> > >>> but as
> > >>> I am trying to do this via JQuery it give me an excuse to come and
> > >>> ask
> > >>> the JQuery community and team where the best javascript developers
> > >>> are! (kissing asses sometimes help :p)
> > >>
> > >>> Here is the code I am trying to eval:
> > >>
> > >>> Unformatted (I tried sending it using return carriage, compressed,
> > >>> with space none of them works)
> > >>
> > >>> $.getScript('js/ui.core.js',function(){
> > >>>$.getScript('js/ui.dialog.js',function(){
> > >>>$.getScript('js/ui.tabs.js',function(){
> > >>>$.getScript('js/ui.datepicker.js',function(){
> > >>>$.getScript('js/
> > >>> ui.resizable.js',function(){
> > >>>$.getScript('js/
> > >>> ui.accordion.js',function(){
> > >>>$
> > >>> ('#foo1').dialog({ bgiframe: true, height: 140, modal:
> > >>> true });
> > >>>$
> > >>> ('#foo2').tabs({}); $('#date1').datepicker({altField: '#alt',
> > >>> altFormat: 'DD, d MM, yy'});
> > >>>$
> > >>> ('#foo3').resizable({ maxHeight: 280, maxWidth: 440, minHeight:
> > >>> 155, minWidth: 200 });
> > >>>$
> > >>> ('#foo4').accordion({ icons: { 'header': 'ui-icon-plus'

[jquery-dev] ADDING METHOD TO OBJECT.PROTOTYPE BREAKS SIZZLE ?

2009-03-27 Thread DBJDBJ


I have found this:

If I do this, in a global scope :

Object.prototype.any_method = function () {}

Then Sizzle fails.

[ jQuery.1.3.2 (uncompressed) ]

1583:while (expr && set.length) {
1584:for (var type in Expr.filter) {
1585:if ((match = Expr.match[type].exec(expr)) !=
null) {
1586:var filter = Expr.filter[type], found,
item;
1587:anyFound = false;
1588:
1589:if (curLoop == result) {
1590:result = [];
1591:}

Line 1585 , causes an exception "Object does not support this property
or method".
This is because Expr.match[type].exec is "undefined", when type ==
any_method
An it inevitably will become that because of the
Object.protoype.any_method "extension" ...

In the presence of jQuery (Sizzle) users should be able to add methods
to Object prototype, I think ?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Re: Need help with an IE issue (of course!)

2009-03-27 Thread Gilles

Thanks for pointing it out Karl, will go fix that now, can't believe I
type that wrong.

Karl Swedberg wrote:
> Hi Gilles,
>
> Not sure about that bug, but wondering if these lines are
> intentionally assigning the variable rather than testing for equality :
>
>   if (d = 'ui') js.push('ui.'+cw); // line 151
>   else if (d = 'fx') js.push('effects.'+cw); // line 152
>   if (d = 'ui') css.push('ui.'+cw);  // line 156
>
> seems they should have == rather than = .
>
>
> --Karl
>
> 
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
>
>
>
>
> On Mar 27, 2009, at 5:06 AM, Gilles wrote:
>
> >
> > Not sure wether it would help or not but here full plugin code.
> >
> > http://codeserenity.com/jquery/scriptless/js/jquery.scriptless3.js
> >
> > If anyone know how I could get rid off that "Object doesn't support
> > property" bug on IE I would really appreciate. Any advices and/or tips
> > on how to improve it would be welcome as well, still learning :)
> >
> >
> >
> > On Mar 26, 12:23 pm, John Resig  wrote:
> >> I'm not seeing an issue off-hand - could you simplify the code that
> >> you're trying to execute? For example, does this error only occur if
> >> getScript is used?
> >>
> >> --John
> >>
> >> On Thu, Mar 26, 2009 at 7:15 AM, Gilles  wrote:
> >>
> >>> Hi,
> >>
> >>> I normally bebug my code myself, cos I believe it helps me improve
> >>> myself, but here I just can't figure it out.
> >>
> >>> basically I am writing a JQuery plugin, that JQuery plugin
> >>> generate a
> >>> bit of code that I then eval later. The code is a casacde of
> >>> getScript
> >>> with some initialization command being trigger in the middle (when
> >>> all
> >>> the getScript are finished)
> >>
> >>> To make my life easy I thought I use $.globalEval(code) to make sure
> >>> it works accross all browsers. Like expected no issue with safari 3,
> >>> safari 4, FF2 or FF3 but as soon as i tried my test page on IE7
> >>> everything broke...
> >>
> >>> And of course I get the well know and very easy to debug error
> >>> 80020101.
> >>
> >>> 1. It's not because of comment (none used anywhere)
> >>> 2. I have tried:
> >>
> >>> eval(code)
> >>> eval(code,$)
> >>> window.eval(code)
> >>> execScript(code)
> >>> window.execScript(code)
> >>> window['code'] = code; window.eval(window['code'])
> >>> window['code'] = code; eval(window['code'])
> >>> window['code'] = code; window.execScript(window['code'])
> >>> window['code'] = code; execScript(window['code'])
> >>> and many other approach I fund during my search (window.eval ||
> >>> eval)
> >>> (code try {} catch {} etc
> >>
> >>> (debugging IE so tried any stupid way I could think off too which
> >>> would explain some of the non-valid example above, I was desperate
> >>> lol)
> >>
> >>> 3. I have checked and checked the code I am trying to eval and I
> >>> just
> >>> don't get it, I am pretty sure it's not a JQuery bug of course,
> >>> but as
> >>> I am trying to do this via JQuery it give me an excuse to come and
> >>> ask
> >>> the JQuery community and team where the best javascript developers
> >>> are! (kissing asses sometimes help :p)
> >>
> >>> Here is the code I am trying to eval:
> >>
> >>> Unformatted (I tried sending it using return carriage, compressed,
> >>> with space none of them works)
> >>
> >>> $.getScript('js/ui.core.js',function(){
> >>>$.getScript('js/ui.dialog.js',function(){
> >>>$.getScript('js/ui.tabs.js',function(){
> >>>$.getScript('js/ui.datepicker.js',function(){
> >>>$.getScript('js/
> >>> ui.resizable.js',function(){
> >>>$.getScript('js/
> >>> ui.accordion.js',function(){
> >>>$
> >>> ('#foo1').dialog({ bgiframe: true, height: 140, modal:
> >>> true });
> >>>$
> >>> ('#foo2').tabs({}); $('#date1').datepicker({altField: '#alt',
> >>> altFormat: 'DD, d MM, yy'});
> >>>$
> >>> ('#foo3').resizable({ maxHeight: 280, maxWidth: 440, minHeight:
> >>> 155, minWidth: 200 });
> >>>$
> >>> ('#foo4').accordion({ icons: { 'header': 'ui-icon-plus',
> >>> 'headerSelected': 'ui-icon-minus' } });
> >>>});
> >>>});
> >>>});
> >>>});
> >>>});
> >>> });
> >>
> >>> 4. One last thing that is weird, also nothing and nothing at all
> >>> change sometimes it return an object doesn't support this property
> >>> error instead
> >>
> >>> Here is the code building the code to eval:
> >>
> >>> // Start creating the code to be eval at the end ( we cascade
> >>> getScript)
> >>> for (i = 0; i < jsl; i++) code += '$.getScript(\''+file[i]+'.js
> >>> \',function(){';
> >>
> >>> //

[jquery-dev] Re: Synchronized animations

2009-03-27 Thread Tom Wright

(via 
http://stackoverflow.com/questions/687495/is-there-any-way-to-make-two-jquery-animations-run-properly-simultaneously)

I played around with your syncAnimate function a fair bit. Here are
the outstanding problems I encountered:
1) There's still a little bit of jumpiness
2) It gets "confused" by rapid changes. In my test (using hover rather
than click) it occasionally forgot to collapse divs.

Otherwise though, great job. I'll be watching the development of this
very closely.

Tom

On Feb 5, 10:57 pm, John Resig  wrote:
> Running to dinner, but just mocked up an 
> implementation:http://ejohn.org/files/sync/
>
> Click the red box for a demo.
>
> --John
>
> On Thu, Feb 5, 2009 at 4:29 PM, Jörn Zaefferer
>
>  wrote:
>
> > I'd like to get some help solving a common animation problem:
> > Animating two elements at once, like sliding up one element, while
> > sliding down another at the same time.
>
> > I've created a testpage that shows the standard solution that jQuery
> > promotes, supposedly with improved support since 1.3:
> >http://jquery.bassistance.de/sync-animations/slideUpDown.html
>
> > Fixed in FF: Pretty good, but too much flicker of the bottom edge and
> > therefor content below
> > Fixed in IE6: Similar to FF, though even more flicker
> > Variable in FF: Ugly, there is a big jump at the end, when the real
> > height snaps in, due to the hidden height being calculated wrong
> > Variable in IE6: Surprisingly better than FF, still an ugly jump at the end
>
> > The jQuery UI accordion puts a lot of effort into providing a better
> > animation, with mixed results. I wouldn't be posting this if we had a
> > perfect animation. A simplified testcase:
> >http://jquery.bassistance.de/sync-animations/accordion.html
>
> > Fixed in FF: Bottom edge stable, content below flickers a little bit,
> > nearly perfect
> > Fixed in IE6: Ugly jumps at start and end
> > Variable in FF: Pretty much perfect, content below moves anyway
> > Variable in IE6: A small initial jump on the first animation, pretty
> > much perfect otherwise
>
> > While it would be nice to get the current accordion solution into
> > jQuery (once it actually works and hopefully somewhat simplified), the
> > current priority is to get the accordion working.
>
> > I've commited the test files in case someone wants to do a checkout or
> > fix 
> > something:http://jqueryjs.googlecode.com/svn/trunk/plugins/sync-animations/
>
> > Feel free to contact me via Jabber (this address) to discuss any
> > details outside the list. Your help is welcome!
>
> > Regards
> > Jörn

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Re: Need help with an IE issue (of course!)

2009-03-27 Thread Karl Swedberg
Hi Gilles,

Not sure about that bug, but wondering if these lines are  
intentionally assigning the variable rather than testing for equality :

if (d = 'ui') js.push('ui.'+cw); // line 151
else if (d = 'fx') js.push('effects.'+cw); // line 152
if (d = 'ui') css.push('ui.'+cw);  // line 156

seems they should have == rather than = .


--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Mar 27, 2009, at 5:06 AM, Gilles wrote:

>
> Not sure wether it would help or not but here full plugin code.
>
> http://codeserenity.com/jquery/scriptless/js/jquery.scriptless3.js
>
> If anyone know how I could get rid off that "Object doesn't support
> property" bug on IE I would really appreciate. Any advices and/or tips
> on how to improve it would be welcome as well, still learning :)
>
>
>
> On Mar 26, 12:23 pm, John Resig  wrote:
>> I'm not seeing an issue off-hand - could you simplify the code that
>> you're trying to execute? For example, does this error only occur if
>> getScript is used?
>>
>> --John
>>
>> On Thu, Mar 26, 2009 at 7:15 AM, Gilles  wrote:
>>
>>> Hi,
>>
>>> I normally bebug my code myself, cos I believe it helps me improve
>>> myself, but here I just can't figure it out.
>>
>>> basically I am writing a JQuery plugin, that JQuery plugin  
>>> generate a
>>> bit of code that I then eval later. The code is a casacde of  
>>> getScript
>>> with some initialization command being trigger in the middle (when  
>>> all
>>> the getScript are finished)
>>
>>> To make my life easy I thought I use $.globalEval(code) to make sure
>>> it works accross all browsers. Like expected no issue with safari 3,
>>> safari 4, FF2 or FF3 but as soon as i tried my test page on IE7
>>> everything broke...
>>
>>> And of course I get the well know and very easy to debug error
>>> 80020101.
>>
>>> 1. It's not because of comment (none used anywhere)
>>> 2. I have tried:
>>
>>> eval(code)
>>> eval(code,$)
>>> window.eval(code)
>>> execScript(code)
>>> window.execScript(code)
>>> window['code'] = code; window.eval(window['code'])
>>> window['code'] = code; eval(window['code'])
>>> window['code'] = code; window.execScript(window['code'])
>>> window['code'] = code; execScript(window['code'])
>>> and many other approach I fund during my search (window.eval ||  
>>> eval)
>>> (code try {} catch {} etc
>>
>>> (debugging IE so tried any stupid way I could think off too which
>>> would explain some of the non-valid example above, I was desperate
>>> lol)
>>
>>> 3. I have checked and checked the code I am trying to eval and I  
>>> just
>>> don't get it, I am pretty sure it's not a JQuery bug of course,  
>>> but as
>>> I am trying to do this via JQuery it give me an excuse to come and  
>>> ask
>>> the JQuery community and team where the best javascript developers
>>> are! (kissing asses sometimes help :p)
>>
>>> Here is the code I am trying to eval:
>>
>>> Unformatted (I tried sending it using return carriage, compressed,
>>> with space none of them works)
>>
>>> $.getScript('js/ui.core.js',function(){
>>>$.getScript('js/ui.dialog.js',function(){
>>>$.getScript('js/ui.tabs.js',function(){
>>>$.getScript('js/ui.datepicker.js',function(){
>>>$.getScript('js/ 
>>> ui.resizable.js',function(){
>>>$.getScript('js/ 
>>> ui.accordion.js',function(){
>>>$ 
>>> ('#foo1').dialog({ bgiframe: true, height: 140, modal:
>>> true });
>>>$ 
>>> ('#foo2').tabs({}); $('#date1').datepicker({altField: '#alt',
>>> altFormat: 'DD, d MM, yy'});
>>>$ 
>>> ('#foo3').resizable({ maxHeight: 280, maxWidth: 440, minHeight:
>>> 155, minWidth: 200 });
>>>$ 
>>> ('#foo4').accordion({ icons: { 'header': 'ui-icon-plus',
>>> 'headerSelected': 'ui-icon-minus' } });
>>>});
>>>});
>>>});
>>>});
>>>});
>>> });
>>
>>> 4. One last thing that is weird, also nothing and nothing at all
>>> change sometimes it return an object doesn't support this property
>>> error instead
>>
>>> Here is the code building the code to eval:
>>
>>> // Start creating the code to be eval at the end ( we cascade
>>> getScript)
>>> for (i = 0; i < jsl; i++) code += '$.getScript(\''+file[i]+'.js
>>> \',function(){';
>>
>>> // Add our init functions (we are inside the callback function of  
>>> the
>>> last getScript)
>>> if (init.length > 0) code += init.join('; ')+';';
>>
>>> // Close all our getScripts
>>> for (i = 0; i < jsl; i++) code += '});';
>>
>>> then just
>>
>>> $.globalEval(code);
>>
>>> to call it (used to test for ie, but got nothing that work with  
>>>

[jquery-dev] Re: height() is wrong in Firefox for tables with captions

2009-03-27 Thread Richard D. Worth
On Thu, Mar 26, 2009 at 9:17 PM, Danny  wrote:

>
> Sample page:
> http://youngisrael-stl.org/wordpress/blogfiles/tableheight.html
>
> Firefox does not include the caption in offsetHeight for tables (works
> correctly in IE and Chrome). This is not a jQuery bug, but it might be
> worth working around in the height() function.
>
> Does anyone know where to submit a bug report on Firefox?


See

http://ejohn.org/blog/a-web-developers-responsibility/

for links to each major browser's bug reporting system, as well as some tips
on how to file a good bug.

- Richard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Re: height() is wrong in Firefox for tables with captions

2009-03-27 Thread Richard D. Worth
On Thu, Mar 26, 2009 at 9:17 PM, Danny  wrote:

>
> Sample page:
> http://youngisrael-stl.org/wordpress/blogfiles/tableheight.html
>
> Firefox does not include the caption in offsetHeight for tables (works
> correctly in IE and Chrome). This is not a jQuery bug, but it might be
> worth working around in the height() function.
>
> Does anyone know where to submit a bug report on Firefox?


See

http://ejohn.org/blog/a-web-developers-responsibility/

for links to each major browser's bug reporting system, as well as some tips
on how to file a good bug.

- Richard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Re: CONTEXT LOGIC

2009-03-27 Thread DBJDBJ


Can we just have next  jQuery(selector, context)  version throw an
exception,
IF context argument is not jQ instance or dom element exception will
be thrown. As simple as that.

I would even suggest going even further. Throw an exception if context
argument is not given.
Make context mandatory. And make it right.

Otherwise people will start blaming jQuery for slow pages, instead of
sorting out their lazy $(selector) calls without any context given
to act as a SCOPE to narrow down the querying of the dom document
tree ...


On Mar 26, 3:04 pm, Daniel Friesen  wrote:
> Example 1 is invalid jQuery.
>
> Example 2's speed comparison to Example 3 is trivial. In fact Example 2
> has an advantage to it. Do remember IE6's bug with getElementById,
> jQuery's selectors have code to fix that bug.
>
> ~Daniel Friesen (Dantman, Nadir-Seen-Fire)DBJ wrote:
> > // jq132-vsdoc.js, line # 145
> >  return jQuery(context).find(selector);
>
> > From this one might draw following Conclusions :
>
> > C1:  if context is not a dom document jQ will find things faster
> >        because the scope of the search is narrow(er)
> > C2: if context above is a single dom node (aka element) jQ will
> >       find things the fastest, please refer to:  jq132-vsdoc.js, line # 107
>
> > (please everyone use this structure in a discussion :
> > 
> >    
> >      
> >      
> >     
> >   
> > 
> > )
>
> > We are in the royal mess because we have no crystal clear and
> > unambigious terminology here. On top of that one important term is
> > missing:
> > SCOPE.
>
> > Right now we have this (by now apparently) ambiguous term: CONTEXT.
> > Sometimes it is (acts like, is used for) scope and sometime it does not.
>
> > 1 :: $("[name]", "#people" )  // CONTEXT
> > (internaly: selector := "#people     [name]", context := document )
>
> > 2 :: $("[name]", $("#people") ) // SCOPE
> > (internaly: selector := "[name]", context := element with id 'people'  )
>
> > 3 :: $("[name]", document.getElementByID("people") ) // SCOPE
> > (internaly: selector := "[name]", context := element with id 'people'  )
>
> > Do we all agree  with the above? If not we have to, I think.
>
> > Furthermore. Line 3:: above is the fastest possible $() , because it
> > boils down to  :
> > $( document.getElementByID("people")).find("[name]") ;
>
> > This provides immediate and narrow scope for Sizzle to work in.
> > (reminder: jQuery.find = Sizzle )
>
> > And last but not the least >:o)
>
> > Please refer to : jq132-vsdoc.js, line # 100
>
> > What am I asking for is to enforce this in jQuery. Nothing much and
> > nothing else. So :
>
> > $( selector:string, context:string )
>
> > Should be forbidden. should throw an exception.
>
> > The non-enforcing style of jQuery sometimes bears no fruit. The above
> > line is now possible, same as just saying : $() , because jQuery
> > authors think it is a "good thing" not to slap junior or senior but
> > lazy jQuery users, when they do these kind of coding.
>
> > But. It is a fact that companies are using jQuery. The more they use
> > it, the more problems they have with code that uses context in a wrong
> > way. And. 90% of coders actualyl use no context at all. The badly
> > written code mushroms and slows things down exponentially. One way out
> > if that (mess?) would be to enforce proper usage of context and define
> > the term SCOPE. Explain it to people and gently force them to use it.
>
> > 2009/3/26 Daniel Friesen :
>
> >> I disagree. First thing to note is there are two definitions of context.
> >> jQuery(selector).context; And jQuery(selector, context);
>
> >> They are two different things which overlap just a bit.
> >> jQuery(selector).context; Is the document context. It is the only
> >> "context" that is stored in jQuery.
>
> >> jQuery(selector, context); Is a node/document context for the query.
> >> It's primary purpose is to establish document context so that jQuery
> >> knows what document (current document, an iframe, another frameset) to
> >> perform selectors in and use when constructing new document nodes to
> >> insert. It does have the ability to be used to limit the scope of a
> >> query, however that is unintuitive and makes programs confusing to read.
>
> >> Your pagination example would be better handled in a different way:
> >> $('.pagination .pagelist'); // jQuery selectors are not single-level.
> >> Don't think everything needs to be separated into contexts. Most of the
> >> time it doesn't
> >> var pagination = $('.pagination');
> >> $(pagination).find('.pagelist'); // $(selector, context); is just an
> >> alias to $(context).find(selector); don't abuse it in ways that don't
> >> make sense
> >> pagination.find('.pagelist'); // Your use of another jQuery selector is
> >> completely unnecessary anyways, you already have a jQuery object just
> >> use .find
>
> >> ~Daniel Friesen (Dantman, Nadir-Seen-Fire)
>
> >> chris thatcher wrote:
>
> >>> I'm trying to follow this thread but it's a little loose so apologies if

[jquery-dev] suggestion: delayed related AJAX requests

2009-03-27 Thread Miloš Rašić

Here's a suggestion for a feature that I think would be useful to AJAX
developers. Sometimes, we need an AJAX feature that could allow a user
to cause a large number of consequent AJAX requests, for example in
auto-complete for searches (like Google Suggest) or filter forms that
submit whenever something is changed in them. In a case like this,
especially when the user has a slow internet connection, we have no
way of knowing if the AJAX responses will arrive in the same order as
the requests were sent. A solution to this is to wait for some time to
make sure that the user has stopped manipulating the controls that
cause AJAX requests before sending a request. At the moment, I do it
like this:

function submit_filter() {
$('#item_list').html('loading...');
$.post('some url',$('#filter').serialize(),function(data) {
$('#item_list').html(data);
});
return false;
}

$('.ajax_control').change(function() {
clearTimeout(ajaxTimeout);
ajaxTimeout = setTimeout(submit_filter,2000);
});

Basically, whenever a control is changed a timeout for ajax request is
reset to 2 seconds. A request is sent only when a user changes
something an hasn't made new changes last 2 seconds.

Since this is a frequent use case, it would be great if there would be
a $.post_delayed() function which would have additional 2 parameters:
an id, which would be used to identify related controls, and a time
interval to wait before submitting the request.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Rhino-based unittest framework

2009-03-27 Thread George V. Reilly

A year or so ago,I extracted the unit test framework that jQuery was
then using from your Subversion tree and used it for my own unit
tests.

I particularly liked the Rhino-based environment, which allowed me to
run JS tests at the command line, making them susceptible to
automation on the build/continuous-integration server.

We moved to jQuery 1.3.2 recently and I had to hack on the Rhino
browser environment code a little to account for things like
createDocumentFragment.

jQuery has moved to the Qunit framework, but I see no sign of the
Rhino framework in there anymore. Why did you drop it?
--
/George V. Reilly  geo...@reilly.org
http://www.georgevreilly.com/blog  http://blogs.cozi.com/tech

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Re: "feature request": retrieving :hover css properties

2009-03-27 Thread Gilles

Of course it would be a hack, I never said it was "valid" otherwise we
wouldn't have this discussion it would be in already lol...  It
doesn't mean the idea of the feature it would bring can't be discussed
or would be useless. You could even use the :hover state instead of
the onevent approach.

I don't think it would be useful in the core mostly because it would
be barely use and well it would validate the with CSS API probably,
but it would allow us to do some non-conventional interesting things,
that's all I meant :)


On Mar 27, 10:08 am, Daniel Friesen  wrote:
> No framework supports it because it's not possible without it being a
> hack. You can't select a :hover state because it's not a node. And .css
> is not meant to be used in that way either. .css works on a style tag,
> or queries for computed styles. It has absolutely nothing to do with
> modifying css rules which is what is required for :hover
>
> ~Daniel Friesen (Dantman, Nadir-Seen-Fire)
>
> Alexandre Plennevaux wrote:
> > ok submittedhttp://dev.jquery.com/ticket/4434 it's in the hands of
> > the jquery team to decide now.
>
> > thanks to you all for an interesting investigation !
>
> > On Fri, Mar 27, 2009 at 10:16 AM, Gilles  wrote:
>
> >> Catching up the CSS on :hover would sure be interesting to see and
> >> quite unique as I believe most javascript framework out there do not
> >> support it.You could do some interesting thing with it I guess, use
> >> the CSS property of hover to set the skin of some javascript button/
> >> widget, so you end up just editing CSS to have a nice jquery effect
> >> and basic styling if javascript off.
>
> >> I'll be suprise if the team didn't think about it yet tho, as it is
> >> often highlited as what javascript selector engine can't get.
>
> >> On Mar 27, 7:49 am, Alexandre Plennevaux 
> >> wrote:
>
> >>> do you guys think i should suggest that it be included in the jquery
> >>> core, allowing to do
>
> >>> var myColor = $('a:hover').css('background-color');
>
> >>> ?
> >>> i have no idea about the cost/benefit ratio, i just think that it
> >>> "feels" right to store styling in the stylesheet rather than in
> >>> metadata quirks.
>
> >>> On Fri, Mar 27, 2009 at 2:14 AM, Danny  wrote:
>
>  I honestly have never profiled it, so I don't know. It does not
>  involve any AJAX or other additional http access. It does n regular
>  expression comparisions, where n is the number of CSS rules in all
>  your stylesheets.
>
>  On Mar 26, 7:05 pm, Alexandre Plennevaux 
>  wrote:
>
> > ok, so if i understand this correctly, this method does not bring in a
> > heavy overhead?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Re: "feature request": retrieving :hover css properties

2009-03-27 Thread Daniel Friesen

No framework supports it because it's not possible without it being a 
hack. You can't select a :hover state because it's not a node. And .css 
is not meant to be used in that way either. .css works on a style tag, 
or queries for computed styles. It has absolutely nothing to do with 
modifying css rules which is what is required for :hover

~Daniel Friesen (Dantman, Nadir-Seen-Fire)

Alexandre Plennevaux wrote:
> ok submitted http://dev.jquery.com/ticket/4434  it's in the hands of
> the jquery team to decide now.
>
> thanks to you all for an interesting investigation !
>
> On Fri, Mar 27, 2009 at 10:16 AM, Gilles  wrote:
>   
>> Catching up the CSS on :hover would sure be interesting to see and
>> quite unique as I believe most javascript framework out there do not
>> support it.You could do some interesting thing with it I guess, use
>> the CSS property of hover to set the skin of some javascript button/
>> widget, so you end up just editing CSS to have a nice jquery effect
>> and basic styling if javascript off.
>>
>> I'll be suprise if the team didn't think about it yet tho, as it is
>> often highlited as what javascript selector engine can't get.
>>
>> On Mar 27, 7:49 am, Alexandre Plennevaux 
>> wrote:
>> 
>>> do you guys think i should suggest that it be included in the jquery
>>> core, allowing to do
>>>
>>> var myColor = $('a:hover').css('background-color');
>>>
>>> ?
>>> i have no idea about the cost/benefit ratio, i just think that it
>>> "feels" right to store styling in the stylesheet rather than in
>>> metadata quirks.
>>>
>>> On Fri, Mar 27, 2009 at 2:14 AM, Danny  wrote:
>>>
>>>   
 I honestly have never profiled it, so I don't know. It does not
 involve any AJAX or other additional http access. It does n regular
 expression comparisions, where n is the number of CSS rules in all
 your stylesheets.
 
 On Mar 26, 7:05 pm, Alexandre Plennevaux 
 wrote:
 
> ok, so if i understand this correctly, this method does not bring in a
> heavy overhead?
>   
>
> >
>   

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Re: "feature request": retrieving :hover css properties

2009-03-27 Thread Alexandre Plennevaux

ok submitted http://dev.jquery.com/ticket/4434  it's in the hands of
the jquery team to decide now.

thanks to you all for an interesting investigation !

On Fri, Mar 27, 2009 at 10:16 AM, Gilles  wrote:
>
> Catching up the CSS on :hover would sure be interesting to see and
> quite unique as I believe most javascript framework out there do not
> support it.You could do some interesting thing with it I guess, use
> the CSS property of hover to set the skin of some javascript button/
> widget, so you end up just editing CSS to have a nice jquery effect
> and basic styling if javascript off.
>
> I'll be suprise if the team didn't think about it yet tho, as it is
> often highlited as what javascript selector engine can't get.
>
> On Mar 27, 7:49 am, Alexandre Plennevaux 
> wrote:
>> do you guys think i should suggest that it be included in the jquery
>> core, allowing to do
>>
>> var myColor = $('a:hover').css('background-color');
>>
>> ?
>> i have no idea about the cost/benefit ratio, i just think that it
>> "feels" right to store styling in the stylesheet rather than in
>> metadata quirks.
>>
>> On Fri, Mar 27, 2009 at 2:14 AM, Danny  wrote:
>>
>> > I honestly have never profiled it, so I don't know. It does not
>> > involve any AJAX or other additional http access. It does n regular
>> > expression comparisions, where n is the number of CSS rules in all
>> > your stylesheets.
>>
>> > On Mar 26, 7:05 pm, Alexandre Plennevaux 
>> > wrote:
>> >> ok, so if i understand this correctly, this method does not bring in a
>> >> heavy overhead?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Re: "feature request": retrieving :hover css properties

2009-03-27 Thread Gilles

Catching up the CSS on :hover would sure be interesting to see and
quite unique as I believe most javascript framework out there do not
support it.You could do some interesting thing with it I guess, use
the CSS property of hover to set the skin of some javascript button/
widget, so you end up just editing CSS to have a nice jquery effect
and basic styling if javascript off.

I'll be suprise if the team didn't think about it yet tho, as it is
often highlited as what javascript selector engine can't get.

On Mar 27, 7:49 am, Alexandre Plennevaux 
wrote:
> do you guys think i should suggest that it be included in the jquery
> core, allowing to do
>
> var myColor = $('a:hover').css('background-color');
>
> ?
> i have no idea about the cost/benefit ratio, i just think that it
> "feels" right to store styling in the stylesheet rather than in
> metadata quirks.
>
> On Fri, Mar 27, 2009 at 2:14 AM, Danny  wrote:
>
> > I honestly have never profiled it, so I don't know. It does not
> > involve any AJAX or other additional http access. It does n regular
> > expression comparisions, where n is the number of CSS rules in all
> > your stylesheets.
>
> > On Mar 26, 7:05 pm, Alexandre Plennevaux 
> > wrote:
> >> ok, so if i understand this correctly, this method does not bring in a
> >> heavy overhead?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Re: Need help with an IE issue (of course!)

2009-03-27 Thread Gilles

Not sure wether it would help or not but here full plugin code.

http://codeserenity.com/jquery/scriptless/js/jquery.scriptless3.js

If anyone know how I could get rid off that "Object doesn't support
property" bug on IE I would really appreciate. Any advices and/or tips
on how to improve it would be welcome as well, still learning :)



On Mar 26, 12:23 pm, John Resig  wrote:
> I'm not seeing an issue off-hand - could you simplify the code that
> you're trying to execute? For example, does this error only occur if
> getScript is used?
>
> --John
>
> On Thu, Mar 26, 2009 at 7:15 AM, Gilles  wrote:
>
> > Hi,
>
> > I normally bebug my code myself, cos I believe it helps me improve
> > myself, but here I just can't figure it out.
>
> > basically I am writing a JQuery plugin, that JQuery plugin generate a
> > bit of code that I then eval later. The code is a casacde of getScript
> > with some initialization command being trigger in the middle (when all
> > the getScript are finished)
>
> > To make my life easy I thought I use $.globalEval(code) to make sure
> > it works accross all browsers. Like expected no issue with safari 3,
> > safari 4, FF2 or FF3 but as soon as i tried my test page on IE7
> > everything broke...
>
> > And of course I get the well know and very easy to debug error
> > 80020101.
>
> > 1. It's not because of comment (none used anywhere)
> > 2. I have tried:
>
> > eval(code)
> > eval(code,$)
> > window.eval(code)
> > execScript(code)
> > window.execScript(code)
> > window['code'] = code; window.eval(window['code'])
> > window['code'] = code; eval(window['code'])
> > window['code'] = code; window.execScript(window['code'])
> > window['code'] = code; execScript(window['code'])
> > and many other approach I fund during my search (window.eval || eval)
> > (code try {} catch {} etc
>
> > (debugging IE so tried any stupid way I could think off too which
> > would explain some of the non-valid example above, I was desperate
> > lol)
>
> > 3. I have checked and checked the code I am trying to eval and I just
> > don't get it, I am pretty sure it's not a JQuery bug of course, but as
> > I am trying to do this via JQuery it give me an excuse to come and ask
> > the JQuery community and team where the best javascript developers
> > are! (kissing asses sometimes help :p)
>
> > Here is the code I am trying to eval:
>
> > Unformatted (I tried sending it using return carriage, compressed,
> > with space none of them works)
>
> > $.getScript('js/ui.core.js',function(){
> >        $.getScript('js/ui.dialog.js',function(){
> >                $.getScript('js/ui.tabs.js',function(){
> >                        $.getScript('js/ui.datepicker.js',function(){
> >                                $.getScript('js/ui.resizable.js',function(){
> >                                        
> > $.getScript('js/ui.accordion.js',function(){
> >                                                $('#foo1').dialog({ 
> > bgiframe: true, height: 140, modal:
> > true });
> >                                                $('#foo2').tabs({}); 
> > $('#date1').datepicker({altField: '#alt',
> > altFormat: 'DD, d MM, yy'});
> >                                                $('#foo3').resizable({ 
> > maxHeight: 280, maxWidth: 440, minHeight:
> > 155, minWidth: 200 });
> >                                                $('#foo4').accordion({ 
> > icons: { 'header': 'ui-icon-plus',
> > 'headerSelected': 'ui-icon-minus' } });
> >                                        });
> >                                });
> >                        });
> >                });
> >        });
> > });
>
> > 4. One last thing that is weird, also nothing and nothing at all
> > change sometimes it return an object doesn't support this property
> > error instead
>
> > Here is the code building the code to eval:
>
> > // Start creating the code to be eval at the end ( we cascade
> > getScript)
> > for (i = 0; i < jsl; i++) code += '$.getScript(\''+file[i]+'.js
> > \',function(){';
>
> > // Add our init functions (we are inside the callback function of the
> > last getScript)
> > if (init.length > 0) code += init.join('; ')+';';
>
> > // Close all our getScripts
> > for (i = 0; i < jsl; i++) code += '});';
>
> > then just
>
> > $.globalEval(code);
>
> > to call it (used to test for ie, but got nothing that work with it, so
> > no real point until I can debug the issue.
>
> > If anyone can help please let me know I will really appreciate.
>
> > Thanks in advance.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---



[jquery-dev] Re: "feature request": retrieving :hover css properties

2009-03-27 Thread Alexandre Plennevaux

do you guys think i should suggest that it be included in the jquery
core, allowing to do

var myColor = $('a:hover').css('background-color');

?
i have no idea about the cost/benefit ratio, i just think that it
"feels" right to store styling in the stylesheet rather than in
metadata quirks.



On Fri, Mar 27, 2009 at 2:14 AM, Danny  wrote:
>
> I honestly have never profiled it, so I don't know. It does not
> involve any AJAX or other additional http access. It does n regular
> expression comparisions, where n is the number of CSS rules in all
> your stylesheets.
>
> On Mar 26, 7:05 pm, Alexandre Plennevaux 
> wrote:
>> ok, so if i understand this correctly, this method does not bring in a
>> heavy overhead?
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~--~~~~--~~--~--~---