Re: [jQuery] Sorting items in jQuery pseudo-array

2007-03-26 Thread Luke Lutman
I'd guess it's because arguments isn't really an array (it has a length property, but none of Array's methods). Something like this might do the trick: jQuery.fn.sort = function() { for(var i = 0, args = []; i arguments.length; i++) args.push(i); return this.pushStack(

[jQuery] Function.call() and xss?

2007-03-23 Thread Luke Lutman
I got an email today that one of my plugins might be a cross-site scripting/security risk because the plugin uses the Function.call() method, like so: $.fn.plugin = function(elem, options, callback) { callback.call(elem, options); }; Has anyone heard of or dealt with this problem? If it

Re: [jQuery] Function.call() and xss?

2007-03-23 Thread Luke Lutman
relating to this, or is it just FUD? I mean, there's tons of ways to do XSS stuff - triggering a function call seems hardly worthy of additional attention. Plus, if you're in a situation where XSS may be a factor, this is probably the least of your worries. --John On 3/23/07, Luke

Re: [jQuery] jquery.de

2007-03-20 Thread Luke Lutman
Why not see if you can get involved with the 'official' effort? John Resig mentioned at SXSW that part of what's taking time is getting things translated, and finding people who speak the language (German in this case) to help organize and maintain the non-english versions. Maybe you could

Re: [jQuery] Find first parent element with certain style

2007-03-19 Thread Luke Lutman
Daemach2 wrote: Try doing console.log($(this).css(backgroundColor)) in the second function to see what those background colors are showing up as. Watch out for Safari, it sometimes returns 'rgba(0,0,0,0)' instead of 'transparent' ... Luke -- zinc Roe Design www.zincroe.com (647) 477-6016

Re: [jQuery] Find first parent element with certain style

2007-03-19 Thread Luke Lutman
Yansky wrote: I'm having a bit of trouble figuring out how to do this. What I'd like to do is find the first parent element that has a background color that is not transparent. This is what I've tried so far, but with no success: $('.elemToFade:first').parents([EMAIL PROTECTED] !=

Re: [jQuery] jQuery at SXSW?

2007-03-11 Thread Luke Lutman
to seeing everyone! --John On 3/10/07, Luke Lutman [EMAIL PROTECTED] wrote: Are there any other jQuery folks at SXSW this weekend? Apparently John Resig was at the Web Vector graphics panel this afternoon, but I missed him. Anyone interested in grabbing a beer in Austin to toast jQuery

[jQuery] jQuery at SXSW?

2007-03-10 Thread Luke Lutman
Are there any other jQuery folks at SXSW this weekend? Apparently John Resig was at the Web Vector graphics panel this afternoon, but I missed him. Anyone interested in grabbing a beer in Austin to toast jQuery? :-) Maybe during the lunch break on Sunday... Rawk! Luke

Re: [jQuery] jquery flash sIFR fla file

2007-03-05 Thread Luke Lutman
I should've replied earlier ... I've sent Sam a Flash 7 version of the fla. The filters are just to make the text look better (adding an invisible drop shadow gets rid of the colour artifacts produced by 'anti-alias for readability' in Flash 8). Everything should work fine without the

Re: [jQuery] jQuery and Rails

2007-02-21 Thread Luke Lutman
Yehuda Katz wrote: 1) Are you using Rails? Yes :-) 3) Would you prefer an approach that generated JS by writing Ruby helpers that generated jQuery code, or an approach that made is easier to link up existing jQuery code into Rails? 4) If you've used jQuery with Rails, what issues have you

Re: [jQuery] jQuery and Rails

2007-02-21 Thread Luke Lutman
Klaus Hartl wrote: Luke, have you tried to use the AssetPackager plugin? It is not totally automatic as you have to define the scripts to be packed in one yml, but thats okay for me. I think merging whatever JavaScript there is into a file is not always good for files that are only

Re: [jQuery] jQuery.flash plugin and ExternalInterface

2007-02-16 Thread Luke Lutman
I don't think you need window[] or document[], try: $('#flash_id')[0].callback(); Luke spinnach wrote: Hi, i'm using the jQuery flash plugin to embed a flash movie to a webpage, and the ExternalInterface to communicate between flash and javascript.. in firefox everything's working as

Re: [jQuery] Google's Summer of Code

2007-02-16 Thread Luke Lutman
John Resig wrote: - Add jQuery support to a popular CMS/Framework jQuery for Ruby On Rails would be fantastic :-) Luke ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/

Re: [jQuery] jQuery.flash plugin and ExternalInterface

2007-02-16 Thread Luke Lutman
If it's an object vs. embed issue, you could overwrite jQuery.fn.flash.transform with a function that returns an object tag for IE. Getting object to work is a bit tricky, but this A List Apart article (http://alistapart.com/articles/flashembedcagematch) describes the known issues. Luke

Re: [jQuery] jQuery Design Decisions? Comparison to MooTools?

2007-02-13 Thread Luke Lutman
Matt Kruse wrote: 1) There seems to be a lot of emphasis on using selectors and pseudo-selectors to access everything. It makes code short and simple, but is it really the most efficient? Reusing selectors helps performance. You can reuse a selection by storing selected elements in a

[jQuery] Bug: jQuery/Packer/ActiveX

2007-02-08 Thread Luke Lutman
# Background Inserting an ActiveX control (i.e. flash movie, quicktime movie) with an external javascript (i.e. jQuery) should avoid the ugly grey box and having to click to activate. See: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/activating_activex.asp

Re: [jQuery] Embedding Flash -- Troubles with jQuery.ready() SWFObject?

2007-02-06 Thread Luke Lutman
.. for some reason in seems that if I cache the element ($('#'+i)[0]) it will never detect the new method.. so I perform the getElementByID() function per loop cycle. Luke Lutman wrote: Since you're not doing anything fancy, why not just pass the config as flashvars and save yourself a world

Re: [jQuery] Embedding Flash -- Troubles with jQuery.ready() SWFObject?

2007-02-06 Thread Luke Lutman
Sorry, forgot to mention you'd also need a bit of javascript to go with that: jQuery.fn.doWhatever = function(foo,bar) { ... } Luke Luke Lutman wrote: It is now time to let the fanciness commence ;) But of course ;-) Why not fight fancyness with fancyness? In your flash movie, try

Re: [jQuery] image preloading

2007-02-06 Thread Luke Lutman
Ok, did a quick test in FF and Safari :-) - The function doesn't wait, it makes all the requests at once (more or less). - The variable gets overwritten. - It doesn't interrupt the download. One thing I did find was that if I do: var img = new Image(); img.onload = function(){ var that =

Re: [jQuery] Embedding Flash -- Troubles with jQuery.ready() SWFObject?

2007-02-06 Thread Luke Lutman
Ahh, I missed that it was an open-source player. I'll shut up now ;-) Luke Brice Burgess wrote: Luke Lutman wrote: In your flash movie, try this actionscript on the first frame: getURL(javascript:$('#FP').doWhatever('abc',123);); Correct me if I am wrong.. but I *think* you're

[jQuery] New Plugin: Pseudo (:before and :after in IE)

2007-02-06 Thread Luke Lutman
Hi Everyone, I was frustrated today with IE not supporting the :before and :after CSS2 selectors, so I've written a plugin that (more or less) enables them :-) http://jquery.lukelutman.com/plugins/pseudo/ Luke P.S. Fun fact: the plugin hacks IE with it's own proprietary junk, like so: * {

Re: [jQuery] Embedding Flash -- Troubles with jQuery.ready() SWFObject?

2007-02-05 Thread Luke Lutman
I've run into this before too... Calling a method (i.e. setConfig(), setVariable()) of the flash player (in Firefox it's an NPObject, in IE it's an ActiveX object) before the swf has loaded will throw an error. The ready event fires before your swf has loaded, which throws an error. The load

Re: [jQuery] image preloading

2007-02-05 Thread Luke Lutman
Here's what I use: $(window).bind('load', function(){ var preload = [ '/images/assets/file/1.gif', '/images/assets/file/2.gif', '/images/assets/file/3.gif' ]; $(document.createElement('img')).bind('load', function(){ if(preload[0]) this.src =

Re: [jQuery] image preloading

2007-02-05 Thread Luke Lutman
at once could take up 870 connections! It might not make much difference, but it doesn't hurt, either ;-) But I do like the technique! Does that actually load , wait and repeat? and you don't have to re-trigger? Yep, you got it :-) Luke On 2/5/07, *Luke Lutman* [EMAIL PROTECTED] mailto

Re: [jQuery] image preloading

2007-02-05 Thread Luke Lutman
Ⓙⓐⓚⓔ wrote: I love the brevity of your solution!! $(document.createElement('img')).bind('load', function(){ if(preload[0]) this.src = preload.shift(); }).trigger('load'); Thanks ;-) It works because the onload handler gets reused -- it fires after the image finishes loading, which

Re: [jQuery] Fontsize in SIFR

2007-01-29 Thread Luke Lutman
Unfortunately not. sIFR measures the element that's being replaced, then scales the font to fit, so unless the html font and the flash font are very similar, the sizes will be different (and difficult to predict). I've been working on a text-replacement plugin that takes the opposite approach

Re: [jQuery] Equal Height DT/DDs

2007-01-26 Thread Luke Lutman
There's actually already a text-resize plugin for jQuery, called jQEm: http://davecardwell.co.uk/geekery/javascript/jquery/jqem/ I've got a stripped down version of the above that I use: http://jquery.lukelutman.com/plugins/emchange/jquery.emchange.js Have fun :-) Luke Will Mo wrote: Thank

Re: [jQuery] SWFObject Embed

2007-01-10 Thread Luke Lutman
Here's the link to my plugin: http://jquery.lukelutman.com/plugins/flash Luke Sam Sherlock wrote: have you tried Luke Lutmans flash plugin? Its inspired by sIFR, swfObject UFO. using the flash plugin in place of swfObject. On 10/01/07, * xmrcivicboix* [EMAIL PROTECTED]

Re: [jQuery] SWFObject Embed

2007-01-10 Thread Luke Lutman
? Luke Lutman wrote: Here's the link to my plugin: http://jquery.lukelutman.com/plugins/flash Luke Sam Sherlock wrote: have you tried Luke Lutmans flash plugin? Its inspired by sIFR, swfObject UFO. using the flash plugin in place of swfObject. On 10/01/07, * xmrcivicboix

Re: [jQuery] .css() px vs. em

2007-01-06 Thread Luke Lutman
I've run into the same problem with IE :-( I did more or less what Dave suggested (untested, of course!): var $tmp = $('#some-element') .append('div style=position: absolute; width: ' + $('#some-element').css('font-size') + '; /') .find(':last-child') var fontSizeInPx = $tmp.width();

Re: [jQuery] .css() px vs. em

2007-01-06 Thread Luke Lutman
Luke Lutman wrote: I've run into the same problem with IE :-( I did more or less what Dave suggested (untested, of course!): var $tmp = $('#some-element') .append('div style=position: absolute; width: ' + $('#some-element').css('font-size') + '; /') .find(':last-child') var

Re: [jQuery] Jquery Flash Plugin the FlashBlock Extension

2006-12-15 Thread Luke Lutman
Agreed, Klaus ... but Sam's not trying to get around it ;-) He just wants alternate content to show when flash is blocked, rather than the big ugly 'click to play the flash movie' placeholder that FlashBlock stuffs in. FWIW, I think FlashBlock is pretty silly... Luke Klaus Hartl wrote: Sam

Re: [jQuery] buildStyleString

2006-12-15 Thread Luke Lutman
I had to do something similar recently. What I did was overload the css and curCSS functions in jQuery to accept an array (of css property names), and return an object whose toString method builds the inline css string. For example: $('#single').css('font-size'); - 12px

Re: [jQuery] Flash plugin and ExternalInterface

2006-12-14 Thread Luke Lutman
I haven't used ExternalInterface before, but I have used: getURL(javascript:myfunction(123,'abc');); To call a javascript function from flash. This works like a charm if passing numbers and strings (or JSON strings) to the function will suffice, and is backwards compatible (as far as Flash 6,

Re: [jQuery] Jquery Flash Plugin the FlashBlock Extension

2006-12-14 Thread Luke Lutman
Hi Sam, I had a look, and FlashBlock blocked UFO and SWFObject movies, and sIFR showed the alternate content, so I'm guessing that by 'works with flashblock', you mean that the alternate content is show when flashblock is on, correct? From what I can tell, Flashblock looks for two things

Re: [jQuery] Efforts to Convert Folks to jQuery

2006-12-08 Thread Luke Lutman
Dave Methvin wrote: You start with 10 lines of jQuery that would have been 20 lines of tedious DOM Javascript. By the time you are done it's down to two or three lines and it couldn't get any shorter unless it read your mind. I think that should be the first paragraph on the homepage!

[jQuery] How to get $.css values in px in Opera?

2006-12-07 Thread Luke Lutman
Hi jQuerians, I ran into a bit of an odd problem this morning: $.css returns values in whatever units they were set with in the stylesheet (Safari and Firefox both return values in px regardless of how they were defined). For example: p style=font-size: 12px; letter-spacing: 1emTesting,

Re: [jQuery] How to get $.css values in px in Opera?

2006-12-07 Thread Luke Lutman
Ok, I did a little bit of digging, and it looks like this is actually a bug. In the curCSS function, on line 452 (r627), there's a check for elem.currentStyle : } else if(elem.currentStyle) { // stuff only ie should see } Apparently, this property exists in Opera, but contains the bogus values.

[jQuery] Packer and ActiveX ...

2006-11-16 Thread Luke Lutman
code comes from an 'external' javascript file anymore. Using JSMin (http://www.crockford.com/javascript/jsmin.html) instead of Packer solves the problem ... but it's extra work. Does anyone have suggestions on how to preserve the 'externalness' of the packed version of jQuery? Thanks, Luke

Re: [jQuery] Extend a Plug-In

2006-11-14 Thread Luke Lutman
Jörn Zaefferer wrote: As far as I know, that is yet an unresearched topic. So far there is a nice guide and tons of example code for writing plugins, but not for extending them. So far someone extends his local copy for his own needs and trie to contribute them back to the original.

Re: [jQuery] Extend a Plug-In

2006-11-14 Thread Luke Lutman
Jörn Zaefferer wrote: Good example. But I think the same effect can be achieved by simply using the standard settings/options mechanism. You can just define a certain function as default and override it via options. Yep, that would work nicely, as long as the default settings/options were

Re: [jQuery] Media plugins

2006-11-11 Thread Luke Lutman
the sifr example since the class is added to the #hdr from within the each call that might not be crucial anyway - just perplexing - would like to know more to further my understanding though. thx -S On 11/11/06, *Luke Lutman* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Can you

Re: [jQuery] Media plugins

2006-11-10 Thread Luke Lutman
Hey Sam, Thanks for all the kind words :-) I've (been lucky?) never to need to communicate between flash and javascript, so I'm a bit out of the loop on how that whole process works. If it's simply needing access to the embed / element after it's inserted into the dom, it should be pretty

Re: [jQuery] Media plugins

2006-11-10 Thread Luke Lutman
either. Its a pain!!! For flash8 theres extendedinterface though - which looks great! would be interesting to see what you make of the above -S On 10/11/06, *Luke Lutman* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hey Sam, Thanks for all the kind words

Re: [jQuery] new jQuery API draft

2006-11-10 Thread Luke Lutman
I'm loving the full index :-) A couple of suggestions come to mind ... having all of the parameter types and names in the left-hand column makes the list much harder to scan. Maybe it's just a styling issue -- like making the parameter types and names less prominent (smaller, faded out) --

Re: [jQuery] Media plugins

2006-11-10 Thread Luke Lutman
Can you post the code (or a link to it)? What error does it throw? ... Also, my text-replacement example (http://jquery.lukelutman.com/plugins/flash/example-text-replacement.html) isn't fully cooked yet -- it's functional, but I'm planning to develop it as a proper plugin (soon, hopefully!).

Re: [jQuery] Media plugins

2006-11-09 Thread Luke Lutman
Dang! You beat me to the punch, Mike. I've been working on (more or less) the same thing, and was just finishing up my documentation and examples last night when you posted yours... too bad we didn't find out sooner. Here's my version: http://jquery.lukelutman.com/plugins/flash/ I've

Re: [jQuery] does jQuery has support for parameter handling ?

2006-11-09 Thread Luke Lutman
escape() and unescape() have always worked for me :-) i.e. escape('The quick brown fox') - The%20quick%20brown%20fox unescape('The%20quick%20brown%20fox') - The quick brown fox Luke Truppe Steven wrote: Mark Gibson schrieb: Javascript has the functions: decodeURI(s) and

Re: [jQuery] jquery incompatible with adsense?

2006-11-07 Thread Luke Lutman
: http://markdbd.com/proyectos/jquery_test/ Regards, On 11/6/06, *Luke Lutman* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I had a similar problem, Mark. Upgrading to the latest revision of jQuery (522 at the time) solved the problem :-) Luke Mark D.B.D

Re: [jQuery] jquery incompatible with adsense?

2006-11-06 Thread Luke Lutman
I had a similar problem, Mark. Upgrading to the latest revision of jQuery (522 at the time) solved the problem :-) Luke Mark D.B.D wrote: Hi all, When I finished my little project with jquery I decided to add my adsense code. After this I saw there is something that makes jquery

Re: [jQuery] 1.0 to 1.0.3 upgrade issues

2006-11-02 Thread Luke Lutman
I noticed the same problem when trying to wrap new 'embed' and 'object' elements, but didn't have time to write it up. I only get the errors in Firefox (v2) -- Safari 2 and Opera 9 are fine. // this works $(function(){ $(document.createElement('div')); }); // error: f.apply is not a

Re: [jQuery] Function to enumerate the querystring?

2006-11-01 Thread Luke Lutman
= parseFloat(val); // ingnore empty values if(val) r[key] = val; }); return r; }; Then call it like this: q = $.query($(this).attr('href')); Luke Chris W. Parker wrote: On Tuesday, October 31, 2006 10:46 AM Luke Lutman

Re: [jQuery] Function to enumerate the querystring?

2006-11-01 Thread Luke Lutman
Klaus Hartl wrote: That won't work for two reasons: $(this).attr('href') most likely returns a complete url, thus there is no leading ?. Oops! Yes, of course. Secondly if you have a parameter like number=0, it won't be put into the hash because after parseFloat val == 0 which evaluates to

Re: [jQuery] Access to flash object

2006-10-31 Thread Luke Lutman
You make a good point about mobile devices, etc. Klaus -- point taken. I'm still not convinced about using object / though -- for me it's got a number of cons: * It's messy -- you need different code for different browsers. All the browsers support object /, but IE wants a different object /

Re: [jQuery] method/plugin for getting query string vars?

2006-10-21 Thread Luke Lutman
does it get invoked, like in Luke's example. Thanks, -Steve Jörn Zaefferer wrote: Luke Lutman schrieb: I was thinking of something a little fancier ;-) jQuery.query = function() { var r = {}; var q = location.search; q = q.replace(/^\?/,''); // remove

Re: [jQuery] method/plugin for getting query string vars?

2006-10-21 Thread Luke Lutman
Good points about the zip code, and running $.query() all the time, Mike. Maybe the two approaches can be combined? Run the code to munge the query string the first time $.query() is called. Cache two sets of results -- a 'raw' set and a 'type cast' set -- in a closure, and return one of the

[jQuery] method/plugin for getting query string vars?

2006-10-20 Thread Luke Lutman
Is there a jQuery method or plugin for parsing the browser's query string into an object? I looked through the api and did a bit of searching around, but no luck ... Thanks, Luke -- zinc Roe Design www.zincroe.com (647) 477-6016 ___ jQuery mailing

Re: [jQuery] Highlighting jQuery

2006-10-17 Thread Luke Lutman
Looks interesting, but the example pages crash Safari (2.0.4, OSX 10.4) :-( Luke Andrea Ercolino wrote: Hola. I just released Chili, a free syntax highlighter script, written in jQuery, and based on the Dan Webb's Code Highlighter, which I found a couple of weeks ago thanks to a link on

Re: [jQuery] Append body

2006-10-11 Thread Luke Lutman
Are you running your code before the dom is ready? Try this: $(document).ready(function(){ $(body).append('div id=ajaxBusy class=ajaxBusy.../div'); }); Luke -- zinc Roe Design www.zincroe.com (647) 477-6016 sdkester wrote: Thank you for the suggestion. I tried that and get an

Re: [jQuery] Best way for storing user preferences?

2006-10-11 Thread Luke Lutman
I'd go for something like option 4, but instead of the custom attribute/DTD stuff, just give it a classname. i.e.: div class=closed/div Luke Raffael Luthiger wrote: Hi, I've seen searching lately for a good way of storing preferences which a jQuery script needs later on. The specific

[jQuery] Remove elements with a particular first-child from matches?

2006-10-04 Thread Luke Lutman
with the XPath parent axis selectors? Shouldn't they be matching something? Is there a better way to do this than the last method? I'd rather not iterate over unnecessary elements. Thanks, Luke Lutman P.S. This is my first post to the list, so please be gentle

Re: [jQuery] Remove elements with a particular first-child from matches?

2006-10-04 Thread Luke Lutman
Hey John, Thanks for the reply, it's much appreciated. I played around with using $(span:first-child).parent(div), but it selects the opposite of what I need (divs *with* a span:first-child rather than divs *without* a span:first-child). Is there a way to remove the above from a larger set of