Re: [jQuery] Tablesorter docs

2007-02-28 Thread Yehuda Katz

I know there used to be some demo pages. Christian?

On another note, I'm going to be working with Christian on documenting some
of tablesorter. Last I spoke with him, he was going to be starting to do
much more inline documentation of the plugin. It's really very powerful and
some cool features are coming down the pike as well.

-- Yehuda

On 2/28/07, David [EMAIL PROTECTED] wrote:


 Hi,

Are there any docs or howto's for the TableSorter plugin? The plugin
source is a little lite on for documentation and the page associated with it
only contains a change log. I'm sure there used to be a page with a demo and
instructions? Does anyone know where that is?

Regards,

David

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] :first selector perofmance question

2007-02-28 Thread Yehuda Katz

This is a smart optimization for :first. John, is this doable?

-- Yehuda

On 3/1/07, Brice Burgess [EMAIL PROTECTED] wrote:


I am searching for the fastest way to fetch the first visible input of a
page, and currently using:
$(':input:visible')[0]

I thought this could be improved with the :first selector, and indeed it
seems so (as it avoids memory assignments for all matched visible
inputs), so I narrowed it down to:
$(':input:visible:first')[0]

I wanted to investigate the behavior further, so ran a few small tests
against http://docs.jquery.com/DOM/Traversing/Selectors

The page was reset/refreshed for each test, and the profiling is being
done in firebug.

My average results are as follows:

$('*:first')[0]; == 25.014ms, 1168 calls
$('*')[0]; == 160.382ms, 1159 calls

$('div:first')[0]; == 2.979ms, 122 calls

This leads me to believe that despite the :first limit, all elements are
found, and then the first one returned.  Does any jQuery selector exist
that *stops* matching after the first match is found? This would avoid
the  n*x extra system calls?

~ Brice

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] nth-child selector

2007-02-28 Thread Yehuda Katz

Why do you want to ignore the first two items? A better solution might be to
use thead to store header info outside the table and then do $(table
tbody tr:nth-child(odd))

-- Yehuda

On 2/28/07, Karl Swedberg [EMAIL PROTECTED] wrote:


Hi Dan,
jQuery doesn't support the :nth-child(an + b), only :nth-child(n)

To select every odd item except the first two items, try this instead:

$('#search-results div:nth-child(odd):gt(0)')



--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Feb 28, 2007, at 7:38 AM, Dan Eastwell wrote:

Hello,

I'm trying to select every odd  item in a list, but not the first two
items.

I've tried using the nth-child selector, which is fine at picking out
the nth-child, but I can't get the 2n+2 child to be selected:

stripes(#search-results div:odd); // is ok
stripes(#search-results div:nth-child(2)); // works

but

stripes(#search-results div:nth-child(2n+2)); // doesn't.

Am I missing something about the CSS3 selector syntax?

Thanks,

Dan.

--
Daniel Eastwell

Portfolio and articles:
http://www.thoughtballoon.co.uk

Blog:
http://www.thoughtballoon.co.uk/blog

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] My basic navigation plugin

2007-02-27 Thread Yehuda Katz

So the basic idea is that you can create a table of contents based on a
series of links selected by a jQuery selector?

Could be useful...


-- Yehuda

On 2/27/07, Joel Birch [EMAIL PROTECTED] wrote:


Hi jQuerivites,

I'd like to offer up my humble plugin (humble is the key word here)
to get a sense of if something this basic is of any worth to the
community. I discussed an earlier version of the plugin briefly on a
previous thread (Sites Powered by jQuery) and there is an
implementation of it on my Preshil site (I don't want to post a link
here as I don't want to seem like I'm spamming it around) which is in
the Sites Using jQuery list at jquery.com

To summarise, it takes your jQuery object and creates an unordered
list of links to the elements within the object. If the elements do
not have an id (needed to provide the links with a href target), a
unique id is created for it, otherwise it uses the existing id. Get
something, do something. ;)

An options object can be passed as the only parameter. The options are:
- head : this is a string of html to appear above the list of
links, can be used as a heading for the list, for example.
- divClass : this is a space separated string of classes to be
applied on the div that wraps the entire list and head.
- aClass : this is a space separated string of classes to be
applied to each of the links created.

These options have defaults of course - you can see what they are in
the code. The whole thing can be styled with CSS as you see fit
(hence the extra class hooks in the options object) and enhanced
further with JavaScript. I attached scrolling to the links using the
aClass as a hook, for example.

I think the (possibly only one) redeeming feature of this plugin over
the far better and more elaborate navigation aids is that it is so
simple (at least how I have it styled on the Preshil site) that
anyone can understand the menu's purpose regardless of how tech-savy
they are. It's also very lightweight and, as far as CSS styling goes,
you only really need a background or border on the main div.

The code:

(function($){
$.fn.contentMenu = function(o){
o = $.extend({  head : h3Some handy links to help you
navigate
this page:/h3,
divClass : contentMenu,
aClass : inPage }, o || {});
$.cmCount = $.cmCount+1 || 0;
var $list = $(ul);
$('div class='+o.divClass+'/div').append(o.head).append
($list).insertBefore(this.eq(0));
return this.each(function(i){
this.id = this.id || menu+$.cmCount+-el+i;
$list.append('lia href=#'+this.id+'
class='+o.aClass+'Skip
to em'+this.innerHTML+'/em/a/li');
});
};
)(jQuery);

Example of calling the plugin:
$(#main h2).contentMenu({
head : h3Page navigation:/h3,
aClass:scrolls,
divClass:alert});

or just using the defaults:
$(#main h2).contentMenu();

I understand this is basic stuff but it's my first plugin and I'd
love to hear any feedback even if it's this plugin is not really
interesting/useful/well made enough. I guess my question is: whilst
many people could create something like this easily and quickly
enough, should there be plugins that cover such light tasks anyway?

Thanks and sorry for the long post.
Joel Birch.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2007-02-21 Thread Yehuda Katz

I've carefully read all of the responses to this thread (keep em coming),
and believe that my solution will work very well for almost all of the
concerns expressed here.

I'll announce more details about the mechanism and syntax sometime in the
next week or so, but I believe everyone will be very satisfied.

-- Yehuda

On 2/21/07, Peter De Berdt [EMAIL PROTECTED] wrote:


 I realize there is a group of people who'd like to just write everything
in Ruby (i.e. get to
 use javascript without having to know javascript), but I think that's a
red herring.

That's not the main issue, but without MinusMOR, your RJS files would
always look like
page  some_jquery_code;
page  some_jquery_code;
I don't mind writing JavaScript myself either, but in order for jQuery
for Rails to be easily integrated into existing applications, the
helpers are a must. I have my fair share of applications that combine
both helpers and sporadically some custom JS code, but I don't want to
refactor all my RJS and view code just for being able to integrate
jQuery instead of proto/script. If it could be plug-and-play (and not
plug-and-pray) I wouldn't doubt and just deploy new versions of my
AJAXed apps just for jQuery.

 Here are the main issues I've run into:
 + unobtrusively including js specific to a view

... and a Rails way of keeping the behavior in a separate file
(separate behavior from representation). What I would do now, is
either use a partial to render the JS in the header and put it in my
layout or just add JS files to the public/javascripts directory, but I
don't find it very Rails-like, it doesn't feel like the best solution.

 So, in whatever.rhtml, do something like:

  % javascript :file = 'path/to/plugin.js' %
  % javascript :text = %{ $('p').css('color','blue'); } %
  pWhatever.../p
  % javascript :text = %{ $('p').css('font-size', '2em'); }% %

 And get:

  html
head
  script type=text/javascript src=whatever.js/script
/head
body
  pWhatever.../p
/body
  /html

Looks like Luke Redpath's UJS4Rails way of doing things :-) It's not a
bad solution, but UJS4Rails has introduced unreliable behavior in some
of the apps I have been working on.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] ANNOUNCEMENT: jQuery Ext Partner to Deliver Integrated JavaScript UI, Features

2007-02-20 Thread Yehuda Katz

Well, there are fundamental tradeoffs that need to be made. If you want a
very small codebase, it's difficult to squeeze in all the speed
optimizations. And if you value speed above all else, you might produce a
fairly large, blazing library. We're looking at these issues to try and come
to a conclusion that will benefit the jQuery community.

-- Yehuda

On 2/20/07, Brian Miller [EMAIL PROTECTED] wrote:


Ideally, there should eventually be one selector base that uses the best
methods of both jQuery's selector engine and DomQuery.  That way, there's
no longer an issue of which one is used.

- Brian


 Hi Rajesh,

 We're investigating the possibility of supporting the use of DomQuery,
 Ext's selector engine, as an alternative (not a replacement) to jQuery's
 CSS Selector code.

 Rey...

 R. Rajesh Jeba Anbiah wrote:
 On Feb 20, 5:30 am, Rey Bango [EMAIL PROTECTED] wrote:
 Today, we're proud to announce that the jQuery Project and Jack
 Slocum's
 Ext Project, have partnered to integrate the amazingly lightweight and
 powerful jQuery framework with Ext's awesome UI library.
snip

I previously asked about DOM Query support [*]. And asking the same
 question:)

 [*] news:[EMAIL PROTECTED]
 ( http://groups.google.com/group/jquery-discuss/msg/
 c74f44b95ac863cb )

 --
   ?php echo 'Just another PHP saint'; ?
 Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] jQuery and Rails

2007-02-20 Thread Yehuda Katz

I'm in the process of building what will soon be the first release of jQuery
on Rails together with Steven Bristol, who was a winner of Rails Hackfest
(which won him a free ticket to RailsConf for his contributions to the Rails
core).

I had a few questions that I would love if you guys could answer:

1) Are you using Rails?
2) If you're not, would you if it was easier to use jQuery with Rails?
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 run into
5) If you've used jQuery with Rails before, what type of application (size,
scope, etc.) was it?

--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Google's Summer of Code

2007-02-16 Thread Yehuda Katz

I'm currently working on this with Steven Bristol, who was a winner of the
Rails Hackfest (and a free ticket to RailsConf). We hope to have a release
ready for RailsConf in May (before SoC starts).

-- Yehuda

On 2/16/07, Luke Lutman [EMAIL PROTECTED] wrote:


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/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Google's Summer of Code

2007-02-16 Thread Yehuda Katz

Yep. It is my fault. My initial attempt at jQoR failed, but I've made a LOT
of progress recently. You guys will be seeing something soon; an early
prototype is already running on a site Steven's developing. Keep the faith,
comrades.

-- Yehuda

On 2/16/07, Alex Cook [EMAIL PROTECTED] wrote:


I blame Yehuda :)

-ALEX

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Kenneth
Sent: Friday, February 16, 2007 9:50 AM
To: jQuery Discussion.
Subject: Re: [jQuery] Google's Summer of Code

Oh, err, http://trac.visualjquery.com/jQueryRails is not though :o

On 2/16/07, Kenneth  [EMAIL PROTECTED] wrote:
It's coming up for me:
I also work on other projects, including:
* jQuery on Rails, a relatively early-on project that aims to allow the
replacements of Prototype and Scriptaculous with jQuery and Interface
jQuery on Rails

On 2/16/07, Alex Cook  [EMAIL PROTECTED] wrote:
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] On
Behalf Of Luke Lutman
Subject: Re: [jQuery] Google's Summer of Code

John Resig wrote:
- Add jQuery support to a popular CMS/Framework

jQuery for Ruby On Rails would be fantastic :-)

Luke

-

Didn't Yehuda start this?I would link the page that's on
visualjquery.com but I'm getting a 404 error...

-ALEX

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Creating an empty jQuery object

2007-02-16 Thread Yehuda Katz

You know that you can create a DOM Element by doing $(div/div), right?
I think that might be a better way to achieve what you're trying to achieve,
but I'm not sure. :(

I think $([]) is currently the most elegant way to get an empty object, but
this is definitely something that should be pointed out front-and-center.

-- Yehuda

On 2/16/07, Danny Wachsstock [EMAIL PROTECTED] wrote:



I've been using jQuery for a few months now, trying to convert all my
hand-rolled javascript and came across a minor problem that I could not
find
documented anywhere:
I want to create DOM elements and add them into a jQuery object, as in;

var result = [empty jQuery object];
$.each(...
  var element = ...;
  result.add(element);
);

But how to create an empty jQuery? Scouring the source code, I eventually
hit upon $([]), but this is nowhere documented. Is there a better way?
Is there a good reason $() should return $(document) rather than an empty
jQuery?

Daniel Wachsstock
http://youngisrael-stl.org

--
View this message in context:
http://www.nabble.com/Creating-an-empty-jQuery-object-tf3240592.html#a9008167
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] # or javascript:;

2007-02-16 Thread Yehuda Katz

Yes yes yes!

Just a quick note: you can use return false perfectly fine in jQuery. In
fact, it'll work for all browsers, even if it doesn't normally work exactly
right. You can use preventDefault() as well, if you just want to stop the
default action but not stopPropagation (return false in jQuery blocks the
default action and prevents further propagation).

-- Yehuda

On 2/16/07, Tim Baxter [EMAIL PROTECTED] wrote:


No... you don't put the onclick handler on the link either. Keep your JS
out of your HTML.

If it's a link that's ONLY there for the JS to do something, insert the
link with the JS.
If it's a link that can degrade gracefully (the preferred scenario), then
put the link in, then override it's action.

Whether the link is a full link, an anchor link, or just a dummy # link,
return false (or, in jquery, preventDefault();) will prevent it from
scrolling or otherwise causing you trouble.

This is basic unobtrusive scripting.


On 2/16/07, Kenneth [EMAIL PROTECTED] wrote:

 I actually prefer javascript:; since using # usually scrolls the page to
 the top which can be really annoying. If it's not a real link I don't see
 what the problem is there.

 Now, if it's an actual link that you're wanting to apply an onclick
 function to, you should use the onclick=javascript:return myfunc();
 attribute, use the normal URL in the href=, and then return true/false
 from myfunc() depending on whether or not you want to link to be activated
 by the click.

 On 2/16/07, hcabbos [EMAIL PROTECTED]  wrote:
 
  What's the best way to apply a behavior to an anchor tag?
 
  a href=# class=someClassmy text/a
 
  -- or --
 
  a href=javascript:; class=someClassmy text/a
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 
 

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] # or javascript:;

2007-02-16 Thread Yehuda Katz

Kenneth: Again, if you use return false, you don't need preventDefault().

-- Yehuda

On 2/16/07, Kenneth [EMAIL PROTECTED] wrote:


Yes, good points everyone and I stand corrected.

I don't advocate inline JS, however I do produce mock-up/prototype/concept
pages pretty frequently (not meant for public use or distribution) where I
need to show functionally how an element will behave. In these cases, its
easiest for me to simply use href=javascript:; as it produces the intended
result yet has no side-effects, and it lets us click the links but doesn't
take us out of the prototype (and the only reason that's necessary is
because IE doesn't treat a's as links unless they have an href attribute
[no :hover, text-decoration, etc]).

I didn't think about it until now, but I suppose an easier method would be
to use jQuery to preventDefault() on all of the a's in my prototypes?


On 2/16/07, Yehuda Katz [EMAIL PROTECTED] wrote:

 Yes yes yes!

 Just a quick note: you can use return false perfectly fine in jQuery.
 In fact, it'll work for all browsers, even if it doesn't normally work
 exactly right. You can use preventDefault() as well, if you just want to
 stop the default action but not stopPropagation (return false in jQuery
 blocks the default action and prevents further propagation).

 -- Yehuda

 On 2/16/07, Tim Baxter  [EMAIL PROTECTED] wrote:
 
  No... you don't put the onclick handler on the link either. Keep your
  JS out of your HTML.
 
  If it's a link that's ONLY there for the JS to do something, insert
  the link with the JS.
  If it's a link that can degrade gracefully (the preferred scenario),
  then put the link in, then override it's action.
 
  Whether the link is a full link, an anchor link, or just a dummy #
  link, return false (or, in jquery, preventDefault();) will prevent it from
  scrolling or otherwise causing you trouble.
 
  This is basic unobtrusive scripting.
 
 
  On 2/16/07, Kenneth  [EMAIL PROTECTED] wrote:
  
   I actually prefer javascript:; since using # usually scrolls the
   page to the top which can be really annoying. If it's not a real link I
   don't see what the problem is there.
  
   Now, if it's an actual link that you're wanting to apply an onclick
   function to, you should use the onclick=javascript:return myfunc();
   attribute, use the normal URL in the href=, and then return true/false
   from myfunc() depending on whether or not you want to link to be activated
   by the click.
  
   On 2/16/07, hcabbos [EMAIL PROTECTED]  wrote:
   
What's the best way to apply a behavior to an anchor tag?
   
a href=# class=someClassmy text/a
   
-- or --
   
a href=javascript:; class=someClassmy text/a
   
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
   
   
  
   ___
   jQuery mailing list
   discuss@jquery.com
   http://jquery.com/discuss/
  
  
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 
 


 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Table striping, speed question

2007-02-15 Thread Yehuda Katz

nth-child is very fast. Probably faster than the each method.

-- Yehuda

On 2/15/07, Angelo Sozzi [EMAIL PROTECTED] wrote:



Just a minor (nice to know) question:
When stripping multiple tables or lists on a single page
$(.stripMe li:even).addClass('alt');
won't work as it itterates over all the li element regardless of the table
they are in. So I went for:
$('.stripMe').each(function(i) {$(li:odd, this).addClass('alt'); });
which seems a bit slow for the amount of list I used. Then I found the
zebra
tutorial with a new workaround:
   $('.stripMe li:nth-child(even)').addClass('alt');

Besides the fact that it is nicer code, does anyone know how
li:nth-child(even) works? Is it essentially the same as using .each(... or
what? and which one is faster?
   (yes, if necessary I'll check it out and post results but maybe someone
knows already)

Regards

--
View this message in context:
http://www.nabble.com/Table-striping%2C-speed-question-tf3235049.html#a8989876
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] How to get keyCode

2007-02-06 Thread Yehuda Katz

I wrote an event fixer plugin that's in svn that provides a whole lot of
help for keys (it makes thing like keyCode and keyChar work cross-browser,
and in keypress as well as keyup).

Check it out in the fix_events folder under plugins in jQuery's svn trunk.

-- Yehuda

On 2/6/07, Klaus Hartl [EMAIL PROTECTED] wrote:


Karl Swedberg schrieb:
 I just inserted the code into a test page, and it worked for me. A
 couple things you can try:

 1. Make sure you include jquery.js before your keydown script.
 2. wrap your script in a $(document).ready().

 So, the relevant snippet of the head might look like this (until you
 put the keydown script in a separate file, of course):

 script src=path/to/jquery.js type=text/javascript/script

 script type=text/javascript 

 $(document).ready(function() {
 $(#tbPageInfo).keydown(
   function(e){
 var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
 alert(key);
   }
 );
 });

 /script

 Hope that helps.

Just a little hint from me:

var key = e.charCode || e.keyCode || 0;

is more concise and avoids duplicate code.



-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Docs Wigdet

2007-02-01 Thread Yehuda Katz

If you guys really want something like this, it would be pretty trivial to
create. How interested is everyone?

-- Yehuda

On 2/1/07, Klaus Hartl [EMAIL PROTECTED] wrote:


Alexandre Plennevaux schrieb:
 In fact as a firefox search engine plugin it would be great

I think somebody has already created one. That's still far away from a
beautifully designed Mac Dashboard Widget...


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] [ANN] Downloadable Visual jQuery

2007-01-29 Thread Yehuda Katz

Hi All,

At long last, I have put together a downloadable Visual jQuery package.
Simply go to http://www.visualjquery.com and click Download. By default,
the package comes with the most recent HTML, but you can easily add other
versions by just saving any of the versioned HTMLs into the same directory.

I have also uploaded the docs for 1.1.1.

--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Download-able documentation

2007-01-28 Thread Yehuda Katz

I will be releasing a downloadable form of Visual jQuery today.

-- Yehuda

On 1/28/07, John Keyes [EMAIL PROTECTED] wrote:


Hi Ken,

You could download the recently mentioned api-browser[1] or
download the documentation site to your local disk using
a HTML spider like Free Download Manager[2] (Windows XP).

Hope that's of some help to you.

-John K

[1] http://jquery.bassistance.de/api-browser/
[2] http://www.freedownloadmanager.org/


On 1/28/07, Ken Saggy [EMAIL PROTECTED] wrote:
 Hi guys,
 I was thinking... why not create some sort of download-able
documentation
 format? either a ZIP of HTML's of maybe even a .chm (or .hlp) file?
(kind of
 like PHP or MySQL have)
 I personally work a lot on my laptop, ofter not accessible to an
internet
 connectionif there could be some way to have all of jQuery's
 documentation available for download it would be great. wouldn't you
agree?

 I'd like to hear what you have to say on the subject..

 Best regards,
 Ken.

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




--
me: http://www.keyes.ie/johnnyk
job: http://www.putplace.com

charities: http://www.oxfam.ie | http://www.bothar.org |
http://www.ipcc.ie

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread Yehuda Katz

I suspect that [EMAIL PROTECTED] would work, although again, I would not rely
on bad XHTML.

-- Yehuda

On 1/25/07, Aaron Heimlich [EMAIL PROTECTED] wrote:


On 1/25/07, jgrucza [EMAIL PROTECTED] wrote:

 Two different kinds of pages each have an element with the same ID.  I
 want
 my Javascript to only affect the element on one of those pages.  So I
 precede the ID with the class name I use for that page type, to target
 the
 right one.  Isn't this a reasonable use case?


Agreed; Just because element IDs have to be unique doesn't mean that the
element has to be in the same place on every page.

--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] simple selector with ID doesn't work anymore

2007-01-25 Thread Yehuda Katz

Why not just have a container (say... html) have the class of that page
type.

Then you can do $(html.this div#id)

-- Yehuda

On 1/25/07, Olaf Bosch [EMAIL PROTECTED] wrote:


jgrucza schrieb:
 Yeah I know that, but consider this situation:

 Two different kinds of pages each have an element with the same ID.  I
want
 my Javascript to only affect the element on one of those pages.  So I
 precede the ID with the class name I use for that page type, to target
the
 right one.  Isn't this a reasonable use case?

 Jennifer

Haha, Jennifer, you search a selector for

div id=thisID class=thisCLASS

right? ;)

--
Viele Grüße, Olaf

---
[EMAIL PROTECTED]
http://olaf-bosch.de
www.akitafreund.de
---

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Kelvin's Scroll Pane

2007-01-23 Thread Yehuda Katz

Cool! I hope my efforts were useful in your updates!

I noticed a slight glitch in IE with the OSX display, which could easily be
resolved by simply moving the dragger's z-index in front of the bar (and
perhaps some sort of png opacity fix).

-- Yehuda

On 1/22/07, Kelvin Luck [EMAIL PROTECTED] wrote:


OK - I've done some tweaks to the jScrollPane plugin...

There is now an optional parameter showArrows which controls whether
or not control arrows appear at the top and the bottom of the scroller:

http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html

I've also made it easier to do advanced skinning of the bar through CSS
- check out the examples here:

http://www.kelvinluck.com/assets/jquery/jScrollPane/examples.html

Feedback appreciated,

Kelvin :)

Kelvin Luck wrote:
 Hi,

 Nice enhancements Yehuda - I'll integrate some of these ideas into the
 main branch of the plugin tonight...

 I have a couple of issues. Like Marshall, I think that clicking and
 holding an arrow should continue scrolling down as an OS scrollbar does.
 See what happens when you click and hold the mouse on an empty bit of
 track in my example (in fact, I haven't tried Safari so it might not
 happen there so check in FF if you don't see what I'm describing). There
 is already the code in the plugin which deals with setting the interval
 and with speeding up the scroll as the mouse button is held down for
 longer (like a default OS scrollbar works).

 Also, the keyboard support seems kind of strange... How useful is
 keyboard support if you have to mouseover an element to initialise it...
 I think that if there is keyboard support it should let you tab to
 select a pane and then the keyboard support should be initialised (e.g.
 onfocus). Again, this is how the os scrollbars work.

 Anyway, I'll add in optional arrow buttons tonight and let the list know
 when my page is updated,

 Cheers,

 Kelvin :)

 Yehuda Katz wrote:
 Done.

 However, it does not seem like mousedown continues firing if you hold
it
 down. If you like, I can do a setInterval on mousedown that continues
 firing the action until mouseup (when I clear the interval). Does that
 sound reasonable?

 Tomorrow, I will work on IE support, and making the scroll pane work
 with less CSS.

 -- Yehuda

 On 1/21/07, *Marshall Salinger*  [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:

 The up and down arrows only scroll the pane after releasing the
 mouse button. I was expecting them to start scrolling the content
 while clicking and holding the mouse button down. Similar to how it
 scrolls when clicking in the middle of the scrollbar area.



 -Marshall



 -Original Message-
 *From:* [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]] *On Behalf Of *Yehuda Katz
 *Sent:* Sunday, January 21, 2007 7:47 PM
 *To:* jQuery Discussion.
 *Subject:* Re: [jQuery] Kelvin's Scroll Pane



 I'm not sure what you mean.

 -- Yehuda

 On 1/21/07, *Marshall Salinger*  [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:

 Yehuda ,



 These are great enhancements to the scrollbar plugin. Would it be
 possible to have it scroll on mousedown?



 Thanks,
 Marshall



 -Original Message-
 *From:* [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]] *On Behalf Of *Yehuda Katz
 *Sent:* Saturday, January 20, 2007 7:31 PM
 *To:* jQuery Discussion.
 *Subject:* Re: [jQuery] Kelvin's Scroll Pane



 And to see what the new scroll pane is capable of, I have updated
 the demo:

 http://www.visualjquery.com/scroll_pane/index.htm

 On 1/20/07, *Yehuda Katz*  [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:

 Hey Guys,

 I have been working on a project that could make use of Kelvin's
 scroll pane.

 I have made a few enhancements:
 * Keyboard support
 * Separate top/middle/bottom elements for the dragger
 * activated class for track when scrolling or key action is
possible

 This means that you can now have a pretty scrollbar that has a
 separate activated/deactivated state.

 Take a look at: http://www.visualjquery.com/scroll_pane/index.htm
 http://www.visualjquery.com/scroll_pane/index.htm

 It's not fully ready, so any feedback would be most appreciated.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Kelvin's Scroll Pane

2007-01-21 Thread Yehuda Katz

I'm not sure what you mean.

-- Yehuda

On 1/21/07, Marshall Salinger [EMAIL PROTECTED] wrote:


 Yehuda,



These are great enhancements to the scrollbar plugin. Would it be possible
to have it scroll on mousedown?



Thanks,
Marshall



-Original Message-
*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On
Behalf Of *Yehuda Katz
*Sent:* Saturday, January 20, 2007 7:31 PM
*To:* jQuery Discussion.
*Subject:* Re: [jQuery] Kelvin's Scroll Pane



And to see what the new scroll pane is capable of, I have updated the
demo:

http://www.visualjquery.com/scroll_pane/index.htm

On 1/20/07, *Yehuda Katz* [EMAIL PROTECTED] wrote:

Hey Guys,

I have been working on a project that could make use of Kelvin's scroll
pane.

I have made a few enhancements:
* Keyboard support
* Separate top/middle/bottom elements for the dragger
* activated class for track when scrolling or key action is possible

This means that you can now have a pretty scrollbar that has a separate
activated/deactivated state.

Take a look at: http://www.visualjquery.com/scroll_pane/index.htm

It's not fully ready, so any feedback would be most appreciated.

--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325




--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Kelvin's Scroll Pane

2007-01-21 Thread Yehuda Katz

Done.

However, it does not seem like mousedown continues firing if you hold it
down. If you like, I can do a setInterval on mousedown that continues firing
the action until mouseup (when I clear the interval). Does that sound
reasonable?

Tomorrow, I will work on IE support, and making the scroll pane work with
less CSS.

-- Yehuda

On 1/21/07, Marshall Salinger [EMAIL PROTECTED] wrote:


 The up and down arrows only scroll the pane after releasing the mouse
button. I was expecting them to start scrolling the content while clicking
and holding the mouse button down. Similar to how it scrolls when clicking
in the middle of the scrollbar area.



-Marshall



-Original Message-
*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On
Behalf Of *Yehuda Katz
*Sent:* Sunday, January 21, 2007 7:47 PM
*To:* jQuery Discussion.
*Subject:* Re: [jQuery] Kelvin's Scroll Pane



I'm not sure what you mean.

-- Yehuda

On 1/21/07, *Marshall Salinger* [EMAIL PROTECTED]  wrote:

Yehuda ,



These are great enhancements to the scrollbar plugin. Would it be possible
to have it scroll on mousedown?



Thanks,
Marshall



-Original Message-
*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On
Behalf Of *Yehuda Katz
*Sent:* Saturday, January 20, 2007 7:31 PM
*To:* jQuery Discussion.
*Subject:* Re: [jQuery] Kelvin's Scroll Pane



And to see what the new scroll pane is capable of, I have updated the
demo:

http://www.visualjquery.com/scroll_pane/index.htm

On 1/20/07, *Yehuda Katz*  [EMAIL PROTECTED] wrote:

Hey Guys,

I have been working on a project that could make use of Kelvin's scroll
pane.

I have made a few enhancements:
* Keyboard support
* Separate top/middle/bottom elements for the dragger
* activated class for track when scrolling or key action is possible

This means that you can now have a pretty scrollbar that has a separate
activated/deactivated state.

Take a look at: http://www.visualjquery.com/scroll_pane/index.htm

It's not fully ready, so any feedback would be most appreciated.

--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325




--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/




--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Kelvin's Scroll Pane

2007-01-20 Thread Yehuda Katz

Hey Guys,

I have been working on a project that could make use of Kelvin's scroll
pane.

I have made a few enhancements:
* Keyboard support
* Separate top/middle/bottom elements for the dragger
* activated class for track when scrolling or key action is possible

This means that you can now have a pretty scrollbar that has a separate
activated/deactivated state.

Take a look at: http://www.visualjquery.com/scroll_pane/index.htm

It's not fully ready, so any feedback would be most appreciated.

--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Kelvin's Scroll Pane

2007-01-20 Thread Yehuda Katz

And to see what the new scroll pane is capable of, I have updated the demo:

http://www.visualjquery.com/scroll_pane/index.htm

On 1/20/07, Yehuda Katz [EMAIL PROTECTED] wrote:


Hey Guys,

I have been working on a project that could make use of Kelvin's scroll
pane.

I have made a few enhancements:
* Keyboard support
* Separate top/middle/bottom elements for the dragger
* activated class for track when scrolling or key action is possible

This means that you can now have a pretty scrollbar that has a separate
activated/deactivated state.

Take a look at: http://www.visualjquery.com/scroll_pane/index.htm

It's not fully ready, so any feedback would be most appreciated.

--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Kelvin's Scroll Pane

2007-01-20 Thread Yehuda Katz

And yes, I know IE hates it at the moment,

-- Yehuda

On 1/20/07, Yehuda Katz [EMAIL PROTECTED] wrote:


And to see what the new scroll pane is capable of, I have updated the
demo:

http://www.visualjquery.com/scroll_pane/index.htm

On 1/20/07, Yehuda Katz [EMAIL PROTECTED] wrote:

 Hey Guys,

 I have been working on a project that could make use of Kelvin's scroll
 pane.

 I have made a few enhancements:
 * Keyboard support
 * Separate top/middle/bottom elements for the dragger
 * activated class for track when scrolling or key action is possible

 This means that you can now have a pretty scrollbar that has a separate
 activated/deactivated state.

 Take a look at: http://www.visualjquery.com/scroll_pane/index.htm

 It's not fully ready, so any feedback would be most appreciated.

 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325




--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Kelvin's Scroll Pane

2007-01-20 Thread Yehuda Katz

Now it's just two scroll panes ;)

-- Yehuda

On 1/20/07, Karl Swedberg [EMAIL PROTECTED] wrote:


Hey Yehuda,
It was looking really cool when there was only one scroll pane on the
page. Now it looks like it's just a couple DIVs with a set height and width
and overflow: auto.

Maybe something isn't firing? Looked at it in FF2 Mac.


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Jan 20, 2007, at 10:31 PM, Yehuda Katz wrote:

And to see what the new scroll pane is capable of, I have updated the
demo:

http://www.visualjquery.com/scroll_pane/index.htm

On 1/20/07, Yehuda Katz [EMAIL PROTECTED] wrote:

 Hey Guys,

 I have been working on a project that could make use of Kelvin's scroll
 pane.

 I have made a few enhancements:
 * Keyboard support
 * Separate top/middle/bottom elements for the dragger
 * activated class for track when scrolling or key action is possible

 This means that you can now have a pretty scrollbar that has a separate
 activated/deactivated state.

 Take a look at: http://www.visualjquery.com/scroll_pane/index.htm

 It's not fully ready, so any feedback would be most appreciated.

 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325




--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] PDFs of JQuery docs

2007-01-18 Thread Yehuda Katz

Dotan,

I have some solutions in Visual jQuery for dealing with line-breaks (I
assume you're using XSL). They won't perfectly match what you're doing, but
you can see the basic technique for splitting up lines and reformatting.

-- Yehuda

On 1/18/07, Dotan Dimet [EMAIL PROTECTED] wrote:


Thanks,

I've updated all my PDF files to have a cover page and title.

I ended up using the classic hat.gif -
http://jquery.com/images/new/hat.gif - because it was easiest to find on
the site.

For my updated script to work, you need to save that file in the same
directory as the build.xml and version.txt files.

My script also doesn't distinguish between documentation produced by
looking at all the plugin files and documentation generated by reading
the jquery-including-all-plugins file that the build generates. Maybe I
should drop the word all (which I use in both cases, because it sounds
better than a random assortment of).


What I'd really like to see in documentation is the selectors explanation:

http://docs.jquery.com/DOM/Traversing/Selectors

But I realize it's tricky sticking in parsable doc-comments.


I also need to improve how I format description blocks - I either insert
too many line breaks or not enough.


- Dotan.


Sam Collett wrote:

 On 18/01/07, Dotan Dimet [EMAIL PROTECTED] wrote:

 Sam, a cover page is a fine idea.

 There's a version.txt file in the source repository, but no image files
 - can you help me hunt down a suitable logo for the cover page?

 My script can deduce if it's building docs for JQuery or for JQuery +
 plugins by looking at its arguments, But I probably won't bother
 differentiating between with plugins and with all plugins - the
 latter is created by running the script from the command line on all
the
 .js files I can find in the plugins directory, and hopefully all these
 (things like blockUI, for example), will eventually make it into the
 build file.

 - Dotan


 There is the image that is used for the background of the jQuery home
 page, but it has a black background.
 http://jquery.com/files/design/images/jquery_logo.gif

 There is also a bunch of 'powered by' logos in this blog post:
 http://jquery.com/blog/2006/10/26/jquery-button-contest-many-prizes/

 In case John (or whoever designed the logo) reads this, perhaps the
 logo should be in SVN (in various formats, like PSD, GIF, JPG and
 PNG). If it was, documentation (like the PDF's generated by Dotan)
 could look better and be relevant to the version in question (the logo
 could change for each point release (1.2, 1.3 etc)).


 Sam Collett wrote:


 Some suggestions.

 How about a cover page showing the version number of jQuery (and maybe
 even the logo - if that is in SVN)? Also maybe the document title
 should be set ('jQuery 1.1 with all plugins

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/



 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] what's the difference between document.getElementById('id') and $('#id') ?

2007-01-16 Thread Yehuda Katz

There's a reasonable explanation of the jQuery object in the Visual jQuery
Magazine at http://www.visualjquery.com/magazine/issue1.01.pdf

On 1/16/07, PragueExpat [EMAIL PROTECTED] wrote:



Thanks for the explaination. The reason for my request was my curiosity of
what exactly makes up the JQuery Object. For example, I didn't understand
that [0] is a reference to the first DOM object.

I ran this to try to look at the Object (using 1.04):

---

html
head
script type=text/javascript src=jquery.js/script
/head
body
form
input id=test class=test type=text nametest
input id=test2 class=test type=text nametest
/form
script type=text/javascript
!--
$(document).ready(function(){
  var t = $(.test);
  var s;
  for (property in t)
   {
s = s + brbrhr /brbr +property.toString()+ :
+t[property].toString();
   }
   document.write(s.toString());
});
//--
/script
/body
/html

---

and learned quite a bit.  (Although the page never fully loads, not sure
why). Anyway, I would recommend looking at this page for anyone who wants
to
learn more.

(If there is a better way to look at the Object, please post here)

- Rich



malsup wrote:

 I second the request for a good understanding of what the JQuery object
 is.


 The jQuery object is just a JavaScript object (like Date or Array).
 It encapsulates zero or more DOM elements and lets you manipulate
 those elements using the jQuery API.

 var jq = $('.myClass');

 The statement above selects all elements that have a class of
 'myClass' and wraps them in an object - the jQuery object.  Once those
 elements are wrapped in a jQuery object you can use the jQuery API to
 do all kinds of things with them.  Like show them all:

 jq.show();

 or add a click event handler to all of them:

 jq.click(function() { alert ('I was clicked'); });

 or access each of the selected DOM elements:

 jq.each(function(i) {
 // 'this' is the DOM element inside the 'each' method
 this.innerHTML = 'my index is ' + i;
 });

 That's really the nuts and bolts of it.  jQuery lets you easily select
 elements in the DOM and do something with them.  It's selection
 capabilities are very powerful and very fast.  And it's API is quite
 extensive.

 You'll also find that most of the functions in the jQuery API return
 the jQuery object on which they operate.  This means they are
 chainable and this is great when you want to do more than one thing
 with the selected elements.  The examples above could be combined into
 a single statement like this:

 $('.myClass').show().click(function() {
 alert ('I was clicked');
 }).each(function(i) {
 this.innerHTML = 'my index is ' + i;
 });

 Mike

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/



--
View this message in context:
http://www.nabble.com/what%27s-the-difference-between-document.getElementById%28%27id%27%29-and-%24%28%27-id%27%29---tf3017662.html#a8391034
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Proper OOP paradigm using jquery - examples for $.extend() ?

2007-01-16 Thread Yehuda Katz

Austin,

I'm actually working on something just like that right now with some jQuery
guys.

IM me off-list at outlookeic (AIM) or [EMAIL PROTECTED] (GTalk).

-- Yehuda

On 1/16/07, Austin Schutz [EMAIL PROTECTED] wrote:


I'm a newb to the list, so hello to all the people who have posted
to the list and made the list archives so helpful the last month or two!

I'm trying to understand the use of OOP with jQuery. In creating
a fairly complex web application I have made extensive use of the class
attribute. Further, I've been successful in binding events to the classes,
setting styles, and that sort of thing.
What I have not had much luck with is the creation of class
attributes
or methods. I simply don't understand the technique, and this seems to be
the one spot where the (really great!) docs are a bit sparse.

For example, let's say I have a doctor's office, and want to track
patients. My html would look something like:

div id='patient' class='Patient'
input id=address type=textfield class=PatientData /
select id=sex class=PatientData
  option value=MMale/option
  option value=FFemale/option
/select
/div
div id='spouse' class='Patient'
input id=address type=textfield class=PatientData /
select id=sex class=PatientData
  option value=MMale/option
  option value=FFemale/option
/select
/div

And the DOM would look something like:

div
  input
  select
 option
 option
div
  input
  select
 option
 option

.. and now I can operate on those elements.

What I want to do is create have a jquery enabled Patient
javascript
class which has methods and attributes I can access, and have the patient
div be an instance of that class. That will make it possible to do
something
like $('#spouse').getHomeAddress().

Ideally it would be possible to use subclasses, and have the DOM
children be accessible as attributes, etc.

The docs suggest extend() can be used for this, but the
methodology
isn't clear to me. That is, I _know_ I can extend jquery, and understand
more or less how the plugins work, but I don't understand how to relate
_elements_ to subclassed jquery classes. I don't just want to crap a bunch
of methods and attributes into the jQuery class itself.

Uh, did that make any sense? :-)

Thanks,
Austin

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Safari Widget Pack

2007-01-14 Thread Yehuda Katz

Karl,

Thanks. I do plan to continue it. If you have any specific suggestions for
improvement I can get on them ASAP.

And yes; the idea was that creating a widget with this mini-library would be
ridiculously easy (I had to read all of the API to create this, and let me
tell you that it is *not* easy as it currently stands).

-- Yehuda

On 1/14/07, Karl Swedberg [EMAIL PROTECTED] wrote:


Hey Yehuda,I've been meaning to respond to this for a while. Just wanted
to say that I'm really impressed with the initial work you've put into this
and hope that you'll continue developing it. It shows a lot of promise, and
the tiny bit of code that would be needed, along with jquery.js and your
plugin, to create a widget is remarkable. Keep up the great work!


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Jan 11, 2007, at 5:11 AM, Yehuda Katz wrote:

I've begun work on a Safari widget pack, that allows you to work with
Safari widgets in a way more jQuery way.

For example:

  var y =
$(#scrollArea).makeScrollAreaWithBars({singlepressScrollPixels: 50}, {id:
scrollBar}, {id: horizBar})
.bind(mouseover, function() { y.focus(); }).bind(mouseout,
function() { y.blur(); })
  z = $(button).makeGlassButton();
  z[0].click(function() { y.horizontalScrollbar ().toggleAutohide();
});
  z[1].click(function() { y.verticalScrollbar().toggle(); })

The above code does the following:

Line 1: Converts a div with id scrollArea into an AppleScrollArea with
horizontal and vertical scrollBars (with attributes provided)
Line 2: binds a mouseover event to the newly created scrollArea widget and
then a mouseout event
Line 3: Converts all buttons on the page into glass buttons, and returns
an array of the new glass buttons
Line 4: Gets the first glassButton and binds a click handler which toggles
the autohide on the scrollArea's horizontal scrollbar
Line 5: Gets the second glassButon and binds a click handler which toggles
the vertical scrollbar

This would obviously be way more than 5 lines if you used the Apple API ;)

The files are in the plugins in svn under safari_widgets. There's still a
lot of work to do, but I wanted to get some feedback on the work I did. The
best way to look at it is to open the HTML file that's packed with the svn.
You'll need OSX 10.4.3 or higher.

Thanks!

--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Jquery SlideToggle Effect and SEO issue?

2007-01-12 Thread Yehuda Katz

As a side note, that technique could be used as a black-hat SEO trick so
it's possible google will account for it at some point.

-- Yehuda

On 1/12/07, jacmaes [EMAIL PROTECTED] wrote:



Thanks a million, Brandon. Boy, that was much easier than I thought. If
only
I had taken the time of reading the docs...


Sure ... just hide it in the DOM Ready event.

$(function() {
   $(h4).click(function() {
   $(this).next().slideToggle();
   }).next().css('display', 'none');
});

--
Brandon Aaron
--
View this message in context:
http://www.nabble.com/Jquery-SlideToggle-Effect-and-SEO-issue--tf2967098.html#a8302466
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Big problem with jquery and IE, Opera

2007-01-12 Thread Yehuda Katz

I believe that Symfony requires submit tags to have name=submit.

In IE, form element names become methods of the form, so the submit tag
would be form.submit.

That's all well and good, until you try to do form.submit() (since the
submit method has been overriden).

Is that possibly the issue?

-- Yehuda

On 1/12/07, James Thomas [EMAIL PROTECTED] wrote:



Difficult to determine why without an example of the failing code.

WaM wrote:

 Hi,

 It's my first day and I already have a problem for you. I make a
website,
 using Jquery librairies and Symfony Framework.

 Before today, I only test my website on Firefox. But today, I tried with
 Opera 8.54 and with IE 7. On my website, I have two big forms using
 Jquery. Both of them works perfectly with FF, but they don't work with
IE
 and Opera. I tried to post this subject with Opera, and I couldn't.
Really
 strange I found. So I'm posting this with Firefox lol.

 So, if someone could explain me why Jquery doesn't work in Opera and IE,
 I'll be very gratefull. Thanks for advance.

 With regards,
 WaM.


--
View this message in context:
http://www.nabble.com/Big-problem-with-jquery-and-IE%2C-Opera-tf2965480.html#a8301933
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Safari Widget Pack

2007-01-11 Thread Yehuda Katz

I've begun work on a Safari widget pack, that allows you to work with Safari
widgets in a way more jQuery way.

For example:

 var y =
$(#scrollArea).makeScrollAreaWithBars({singlepressScrollPixels: 50}, {id:
scrollBar}, {id: horizBar})
   .bind(mouseover, function() { y.focus(); }).bind(mouseout,
function() { y.blur(); })
 z = $(button).makeGlassButton();
 z[0].click(function() { y.horizontalScrollbar().toggleAutohide(); });
 z[1].click(function() { y.verticalScrollbar().toggle(); })

The above code does the following:

Line 1: Converts a div with id scrollArea into an AppleScrollArea with
horizontal and vertical scrollBars (with attributes provided)
Line 2: binds a mouseover event to the newly created scrollArea widget and
then a mouseout event
Line 3: Converts all buttons on the page into glass buttons, and returns an
array of the new glass buttons
Line 4: Gets the first glassButton and binds a click handler which toggles
the autohide on the scrollArea's horizontal scrollbar
Line 5: Gets the second glassButon and binds a click handler which toggles
the vertical scrollbar

This would obviously be way more than 5 lines if you used the Apple API ;)

The files are in the plugins in svn under safari_widgets. There's still a
lot of work to do, but I wanted to get some feedback on the work I did. The
best way to look at it is to open the HTML file that's packed with the svn.
You'll need OSX 10.4.3 or higher.

Thanks!

--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Select _other_ elements (with a specific class) in same tr

2007-01-11 Thread Yehuda Katz

I was just doing this not a half hour ago:

Assuming that this is the checkbox you clicked,

jQuery(this).parent().siblings().find(input:checkbox).not(this)

Worked great for me! I used the following code to achieve the effect I
believe you're searching for (radio button-like functionality made out of
checkboxes, so you can easily turn go back to none selected):

jQuery(document).ready(function() {
 jQuery(input:checkbox).click(function() {
   jQuery(this).parent().siblings().find(:checked).not(this).uncheck();
 })
})

jQuery.fn.uncheck = function() {
 this.each(function(){
   this.checked = false;
 })
}

On 1/11/07, jazzle [EMAIL PROTECTED] wrote:



That title may not make much sense, so here's the code:

  tr id=?= $player['id'] ?
   tdinput type=checkbox name=seventeen[apps][?= $player['id'] ?]
class=noneorone //td
   tdinput type=checkbox name=seventeen[subs][?= $player['id'] ?]
class=noneorone //td
  /tr

I want to be able to select _none or one_ of the checkboxes (note: not
using
radio-buttons).
So I would like to know how to address the _other_ checkboxes (with the
class noneorone) in the same tr.

Do I need some XPath mixed with CSS or what?


Thanks in advance for any help.
--
View this message in context:
http://www.nabble.com/Select-_other_-elements-%28with-a-specific-class%29-in-same-tr-tf2958743.html#a8277172
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] List of jQuery-Powered Sites

2007-01-09 Thread Yehuda Katz

http://www.pro-core.com uses jQuery.

The site that comes up when you go to that URL is a Flash *marketing* site.
We offer a project management tool for construction companies. The tool is
built in Rails (it's really, really complex), and we offer some cool
features like webcam integration (so that a contractor's clients can see
what's happening on site) and MS Project integration.

I use jQuery fairly extensively through the site, which also uses Prototype
in some places where I wasn't the guy who wrote the code (there's
Proto/Rails stuff everywhere ;)). There are around 5 full-time developers
who have been working on the project, and I've gotten most of them to at
least try using jQuery when JavaScript stuff comes us (although I've become
the unofficial UI/JS dude, so all of the new stuff is in jQuery).

We have an application-wide JavaScript file, which does all sorts of neat
stuff:
* Defines rules for forms
** inline documentation (marked with class=inline-documentation) appears
when a form
   element is focused
** Items marked show_with_checkbox appear when a sibling checkbox is
checked
** Items marked show_with_select appear when a sibling select box has the
correct value
** We built a select-mover widget, which consists of two multiple select
boxes that stuff can be
   moved between. You can also sort the contents of the boxes by company or
name.
* All tables with the class data_panel are sortable
** Throughout the site, there are markup-based facilities for getting the
sortable-ness to be turned off
   for a particular column.
** We built custom parsers for table sorter.
* We have a date-picker widget that was originally written in pure DOM but
that has gotten heavy jQuery
  tune-ups.
* The entire startup section of my app takes a context param, which can be
used to run the startup
  application-related stuff on a newly loaded Ajax section (this is a
function called by $(document).ready)
* We hide and show advanced filters via a simple jQuery one-liner.
* There's a lot more functionality in the site, but I can't find it all at
the moment.

-- Yehuda

On 1/9/07, Brandon Aaron [EMAIL PROTECTED] wrote:


Hey Rey,

Here are a few sites we've launched that use jQuery and another is
supposed to launch this week.

Ensemble Studioes: Age of Empires III (http://agecommunity.com/)
jQuery helped us quickly throw together an expandable nav and to very
easily address some cross browser issues.

Sewell (http://sewell.com/)
jQuery saved the day for me on this site. I was previously using
Prototype + Scriptaculous and the whole site felt extremely heavy and
sluggish. I spent a weekend porting the whole site over to jQuery and
that is when I realized the astounding benefits of jQuery. I
immediately cut the library in 1/3 and cut my own JavaScript in half
in a few places. I found that once I switched to jQuery my code became
much easier for myself and other team members to read and maintain.
You can find jQuery in use on every page of this site.

Hope Cottage (http://hopecottage.org/)
You can find jQuery behind the scenes helping us build the unique
navigation on the Home page and delivering an enhanced user experience
in the FAQs.

Dallas Symphony Orchestra (http://dallassymphony.com/)
jQuery's excellent AJAX support enabled us to quickly create an
AJAX'ified calendar widget and made creating the drop down navigation
a breeze.

--
Brandon Aaron

On 1/9/07, Rey Bango [EMAIL PROTECTED] wrote:
 Hi everyone,

 With the release jQuery v1.1 eminent, I'd like to begin compiling a list
 of jQuery powered sites for posting on the jQuery site. The sites *DO
 NOT* have to be jQuery v1.1 specific. Sites using prior versions of
 jQuery are perfectly fine for this list. Also, if you're using jQuery
 with another library (YUI, PT, Dojo, et al), that's fine as well. We
 want to know which sites are using jQuery.

 If you could, please provide a description of where jQuery is being used
 within the website.

 Please reply to this email and I'll begin compiling the list.

 Thanks,

 Rey

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Visual jQuery Redux

2007-01-08 Thread Yehuda Katz

You can actually go to http://www.visualjquery.com/1.0.2.html (actually, any
version from the 1.0.x series after 1.0.2 -- 1.0 and 1.0.1 seem to have
incompatible XML files for some reason)

-- Yehuda

On 1/8/07, Sam Collett [EMAIL PROTECTED] wrote:


On 08/01/07, Yehuda Katz [EMAIL PROTECTED] wrote:
 Hey guys,

 I've been listening to all of the feedback I've gotten about Visual
jQuery,
 and I've built a new version that I believe responds to many of those
 concerns:
 * a dramatically reduced title-bar (20px high)
 * a path in the titlebar indicating the current location in the API
tree
 * the text area takes up the full remaining area of the screen
 * if the text area is less than 350px wide, it expands a column,
pushing
 the remaining columns to the left
 * you can move columns off to the left to get more space for text (even
if
 it has not automatically expanded)
 * selecting an node automatically jumps up to the top of the screen
 (specifically useful for automatically getting to the top of text
areas)
 * the rendering is done differently, so the normal drawbacks of nesting
are
 no longer present

 Check it out at:

 http://www.visualjquery.com/new.html

  Note that there are still some bugs, so I won't get upset if you report
 them. Just tell me exactly what you did and what went wrong.

 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325


Looks good. It is important to have documentation for both versions.
It would be fine to keep 1.0 as it is now though (as long as it is
still available). So when 1.1 is out you could go to
visualquery.com/1.0/ to still access the old documentation.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Do something as soon as an element has loaded? (Before document ready)

2007-01-08 Thread Yehuda Katz

You could try creating a setInterval that constantly checks for the
existence of your element, but that's a pretty dirty hack.

-- Yehuda

On 1/8/07, Phillip B Oldham [EMAIL PROTECTED] wrote:


 Hi all

I need to fire an event/run a method once an element (in this case a div
with a list inside) has loaded, but before $(document).ready().

I'd like to be able to use simple jQuery objects... something like:

$('#mydiv').hasloaded(function(){
//do something here
});


$(document).ready(function(){
//do the rest of the window.onload events here
});

I've been looking through the source, and it seems to me that doing
$('#mydiv').ready(function(){}); will fire when the whole DOM has loaded,
which will probably be a little late for me.

Any idea on how I can do this?

Phill

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/







--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Visual jQuery Redux

2007-01-08 Thread Yehuda Katz

Both issues are resolved. The reason control was giving you that issue is
that there's a currently undocumented feature that allows you to press
ctrl-left-arrow or ctrl-right-arrow to scroll left or right. It's currently
undocumented because if you hit the buttons too quickly, you will get
rendering errors.

I will fix that when I get some time. For now, use with caution.

-- Yehda

On 1/8/07, Krzysztof FF [EMAIL PROTECTED] wrote:



New layout is great and much more efficient.

Two remarks:

- after going in one branch, e.g. DOM, deeper in hierarchy, e.g. showing
path 'DOM /Manipulation /clone()', and switching to another branch, e.g.
Effects, the path reads: 'Effects /Manipulation /clone()';

- pressing Ctrl, Shift or Alt causes error:

Line: 88
Error: 'console' is undefined


With regards,

Krzysztof


--
View this message in context:
http://www.nabble.com/Visual-jQuery-Redux-tf2937237.html#a8216211
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Visual jQuery Redux

2007-01-08 Thread Yehuda Katz

What would the back button do? I agree with you on the centered headlines.

On 1/8/07, Anders [EMAIL PROTECTED] wrote:


Looks nice. Two things:

* Working back button: Have you for example looked at the jQuery
history plugin, or the tabs plugin implementation?
* The centered headlines (Returns, Parameters etc) looks out of place
on my wide screen. Aligned to the left would work better.

/Anders

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] IE woes (was Exteranl Links)

2007-01-08 Thread Yehuda Katz

$([EMAIL PROTECTED], [EMAIL PROTECTED] ...).attr(_target, blank)

or

$([EMAIL PROTECTED], [EMAIL PROTECTED] ...).click(function() { window.open(
this.href) })

On 1/8/07, agent2026 [EMAIL PROTECTED] wrote:



Back from the holidays, and back to my problem :)

In short:

I want to go through all links on a page and, barring my array of
exceptions, make all external links open in new windows without using the
target attribute.  In addition, the exception urls must be able to just
contain the exception strings (using something like .match) and not have
to
be an exact match.  In other words any urls within those domains will be
exceptions.

The

http://www.nabble.com/Change-href-of-external-links-tf2718387.html#a7579373
previous thread  I started got a lot of help, but required an exact match
and started to go a bit over my head.  So I've started fresh:

$(function(){
var a = ($('a'));
var intLink = ['
mysite.com/','site1.com/','site2.com/','site3.com/'];  //
treat as internal
for(i=0;ia.length;i++){
for(n=0;nintLink.length;n++){
var nLink = intLink[n];
if(!a[i].href.match(nLink)){  // treat as external
//console.log(a[i].href);
$(a[i]).bind('click', function(){
window.open(this.href); return false;
});
}
};
};
});

I've put all domains to be treated as internal in the var intLink,
including
the current domain (the site itself).  Things look pretty good in Firefox
-
all the .binds appear to be successful - but the console doesn't always
log
all the links on the page that should be treated as external even thought
the .bind works, so that's a little worrying.

In IE6/7 I've got all kinds of weirdness happening, and seem to be getting
nowhere.  Appreciate it very much if anyone can have a look, or can think
of
a better way.

Adam
--
View this message in context:
http://www.nabble.com/IE-woes-%28was-Exteranl-Links%29-tf2940328.html#a8221227
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] select links not children of li

2007-01-08 Thread Yehuda Katz

You'd use a custom filter:

$(a).filter(function(elem){ return $(elem).parent(li).length == 0; })

On 1/8/07, spinnach [EMAIL PROTECTED] wrote:


..how to select all links on a page that are not inside a list (not
children of 'li')?..

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] select links not children of li

2007-01-08 Thread Yehuda Katz

.not(n) only works when n is a filter, like .not(.absolute) or
.not(:visible)... it can not be used to test arbitrary expressions.

-- Yehuda

On 1/8/07, Andy Matthews [EMAIL PROTECTED] wrote:


Why doesn't this work:

$('a').not('li a').click( function() {
$(this).remove();
return false;
});

On this code:
a href=this is a link/a
br /br /

lia href=a link inside an li tag/a/li
lia href=and another/a/li

br /br /
a href=and finally another link at the bottom/a

It correctly removes the bottom and top links, but it also removes the two
links found within LI tags, which from the way I read the API it should
not.



Andy Matthews
Senior Coldfusion Developer

Office:  877.707.5467 x747
Direct:  615.627.9747
Fax:  615.467.6249
[EMAIL PROTECTED]
www.dealerskins.com


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Jörn Zaefferer
Sent: Monday, January 08, 2007 3:59 PM
To: jQuery Discussion.
Subject: Re: [jQuery] select links not children of li

spinnach schrieb:
 ..how to select all links on a page that are not inside a list (not
 children of 'li')?..

Untested:
$(a).filter(function() { return !$(this).parents().is(ul ); })

Requires 1.1

--
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] select links not children of li

2007-01-08 Thread Yehuda Katz

You could do something like this:

$.fn.notFind = function(obj) {
 if(typeof obj == string) return $.map(this, function(i) { return
$(obj).index(i) == -1 ? i : null  })
 else if(obj.jquery) return $.map(obj, function(i) { return obj.index(i) ==
-1 ? i : null  })
}

then you could do $(a).notFind(li a)

-- Yehuda


On 1/8/07, Yehuda Katz [EMAIL PROTECTED] wrote:


.not(n) only works when n is a filter, like .not(.absolute) or
.not(:visible)... it can not be used to test arbitrary expressions.

-- Yehuda

On 1/8/07, Andy Matthews [EMAIL PROTECTED] wrote:

 Why doesn't this work:

 $('a').not('li a').click( function() {
 $(this).remove();
 return false;
 });

 On this code:
 a href=this is a link/a
 br /br /

 lia href=a link inside an li tag/a/li
 lia href=and another/a/li

 br /br /
 a href=and finally another link at the bottom/a

 It correctly removes the bottom and top links, but it also removes the
 two
 links found within LI tags, which from the way I read the API it should
 not.

 

 Andy Matthews
 Senior Coldfusion Developer

 Office:  877.707.5467 x747
 Direct:  615.627.9747
 Fax:  615.467.6249
 [EMAIL PROTECTED]
 www.dealerskins.com


 -Original Message-
 From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] On
 Behalf Of Jörn Zaefferer
 Sent: Monday, January 08, 2007 3:59 PM
 To: jQuery Discussion.
 Subject: Re: [jQuery] select links not children of li

 spinnach schrieb:
  ..how to select all links on a page that are not inside a list (not
  children of 'li')?..
 
 Untested:
 $(a).filter(function() { return !$(this).parents().is(ul ); })

 Requires 1.1

 --
 Jörn Zaefferer

 http://bassistance.de


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] select links not children of li

2007-01-08 Thread Yehuda Katz

Make that

$.fn.notFind = function(obj) {
 if(typeof obj == string) return $.map(this, function(i) { return
$(obj).index(i) == -1 ? i : null  })
 else if(obj.jquery) return $.map(this, function(i) { return obj.index(i)
== -1 ? i : null  })
}

On 1/8/07, Yehuda Katz [EMAIL PROTECTED] wrote:


You could do something like this:

$.fn.notFind = function(obj) {
  if(typeof obj == string) return $.map(this, function(i) { return
$(obj).index(i) == -1 ? i : null  })
  else if(obj.jquery) return $.map(obj, function(i) { return obj.index(i)
== -1 ? i : null  })
}

then you could do $(a).notFind(li a)

-- Yehuda


On 1/8/07, Yehuda Katz [EMAIL PROTECTED] wrote:

 .not(n) only works when n is a filter, like .not(.absolute) or
 .not(:visible)... it can not be used to test arbitrary expressions.

 -- Yehuda

 On 1/8/07, Andy Matthews [EMAIL PROTECTED] wrote:
 
  Why doesn't this work:
 
  $('a').not('li a').click( function() {
  $(this).remove();
  return false;
  });
 
  On this code:
  a href=this is a link/a
  br /br /
 
  lia href=a link inside an li tag/a/li
  lia href=and another/a/li
 
  br /br /
  a href=and finally another link at the bottom/a
 
  It correctly removes the bottom and top links, but it also removes the
  two
  links found within LI tags, which from the way I read the API it
  should not.
 
  
 
  Andy Matthews
  Senior Coldfusion Developer
 
  Office:  877.707.5467 x747
  Direct:  615.627.9747
  Fax:  615.467.6249
  [EMAIL PROTECTED]
  www.dealerskins.com
 
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]
  On
  Behalf Of Jörn Zaefferer
  Sent: Monday, January 08, 2007 3:59 PM
  To: jQuery Discussion.
  Subject: Re: [jQuery] select links not children of li
 
  spinnach schrieb:
   ..how to select all links on a page that are not inside a list (not
   children of 'li')?..
  
  Untested:
  $(a).filter(function() { return !$(this).parents().is(ul ); })
 
  Requires 1.1
 
  --
  Jörn Zaefferer
 
  http://bassistance.de
 
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 



 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325




--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] select links not children of li

2007-01-08 Thread Yehuda Katz

And John's better alternative:

$.fn.notFind = function(obj) {
 if ( obj.constructor == String ) obj = $(obj);
 return jQuery.set( jQuery.grep(this, function(i) { return obj.index(i) ==
-1 }) );
};

On 1/8/07, Yehuda Katz [EMAIL PROTECTED] wrote:


Make that

$.fn.notFind = function(obj) {
  if(typeof obj == string) return $.map(this, function(i) { return
$(obj).index(i) == -1 ? i : null  })
  else if(obj.jquery) return $.map(this, function(i) { return obj.index(i)
== -1 ? i : null  })
}

On 1/8/07, Yehuda Katz  [EMAIL PROTECTED] wrote:

 You could do something like this:

 $.fn.notFind = function(obj) {
   if(typeof obj == string) return $.map(this, function(i) { return
 $(obj).index(i) == -1 ? i : null  })
   else if(obj.jquery) return $.map(obj, function(i) { return obj.index(i)
 == -1 ? i : null  })
 }

 then you could do $(a).notFind(li a)

 -- Yehuda


 On 1/8/07, Yehuda Katz [EMAIL PROTECTED] wrote:
 
  .not(n) only works when n is a filter, like .not(.absolute) or
  .not(:visible)... it can not be used to test arbitrary expressions.
 
  -- Yehuda
 
  On 1/8/07, Andy Matthews [EMAIL PROTECTED] wrote:
  
   Why doesn't this work:
  
   $('a').not('li a').click( function() {
   $(this).remove();
   return false;
   });
  
   On this code:
   a href=this is a link/a
   br /br /
  
   lia href=a link inside an li tag/a/li
   lia href=and another/a/li
  
   br /br /
   a href=and finally another link at the bottom/a
  
   It correctly removes the bottom and top links, but it also removes
   the two
   links found within LI tags, which from the way I read the API it
   should not.
  
   
  
   Andy Matthews
   Senior Coldfusion Developer
  
   Office:  877.707.5467 x747
   Direct:  615.627.9747
   Fax:  615.467.6249
   [EMAIL PROTECTED]
   www.dealerskins.com
  
  
   -Original Message-
   From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]
   On
   Behalf Of Jörn Zaefferer
   Sent: Monday, January 08, 2007 3:59 PM
   To: jQuery Discussion.
   Subject: Re: [jQuery] select links not children of li
  
   spinnach schrieb:
..how to select all links on a page that are not inside a list
   (not
children of 'li')?..
   
   Untested:
   $(a).filter(function() { return !$(this).parents().is(ul ); })
  
   Requires 1.1
  
   --
   Jörn Zaefferer
  
   http://bassistance.de
  
  
   ___
   jQuery mailing list
   discuss@jquery.com
   http://jquery.com/discuss/
  
  
   ___
   jQuery mailing list
   discuss@jquery.com
   http://jquery.com/discuss/
  
 
 
 
  --
  Yehuda Katz
  Web Developer | Wycats Designs
  (ph)  718.877.1325
 



 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325




--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] select links not children of li

2007-01-08 Thread Yehuda Katz

Because li a is not a filter ;)

-- Yehuda

On 1/8/07, Andy Matthews [EMAIL PROTECTED] wrote:


 Okay...

So then why wouldn't THIS work:
$('a').filter('li a').click( function() {
$(this).remove();
return false;
});

* 

Andy Matthews
*Senior Coldfusion Developer

Office:  877.707.5467 x747
Direct:  615.627.9747
Fax:  615.467.6249
[EMAIL PROTECTED]
www.dealerskins.com


 --
*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On
Behalf Of *Yehuda Katz
*Sent:* Monday, January 08, 2007 4:29 PM
*To:* jQuery Discussion.
*Subject:* Re: [jQuery] select links not children of li

.not(n) only works when n is a filter, like .not(.absolute) or
.not(:visible)... it can not be used to test arbitrary expressions.

-- Yehuda

On 1/8/07, Andy Matthews [EMAIL PROTECTED] wrote:

 Why doesn't this work:

 $('a').not('li a').click( function() {
 $(this).remove();
 return false;
 });

 On this code:
 a href=this is a link/a
 br /br /

 lia href=a link inside an li tag/a/li
 lia href=and another/a/li

 br /br /
 a href=and finally another link at the bottom/a

 It correctly removes the bottom and top links, but it also removes the
 two
 links found within LI tags, which from the way I read the API it should
 not.

 

 Andy Matthews
 Senior Coldfusion Developer

 Office:  877.707.5467 x747
 Direct:  615.627.9747
 Fax:  615.467.6249
 [EMAIL PROTECTED]
 www.dealerskins.com


 -Original Message-
 From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] On
 Behalf Of Jörn Zaefferer
 Sent: Monday, January 08, 2007 3:59 PM
 To: jQuery Discussion.
 Subject: Re: [jQuery] select links not children of li

 spinnach schrieb:
  ..how to select all links on a page that are not inside a list (not
  children of 'li')?..
 
 Untested:
 $(a).filter(function() { return !$(this).parents().is(ul ); })

 Requires 1.1

 --
 Jörn Zaefferer

 http://bassistance.de


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/







--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Visual jQuery Redux

2007-01-07 Thread Yehuda Katz

Mozilla wasn't liking the XSL sheet this time around, so I'm doing the
transform through Oxygen. I'm going to be finding a better solution to
automate this thing better.

I'm also going to be releasing an offline version in the near future in
conjunction with jQuery 1.1.

Regarding the Methods plugin, I'm in favor of a new @plugin doc tag that
would allow plugins that extended core functionality to be placed inside the
main API, but that I could set off with a different color (red?) inside. I
would not use it extensively, because it could be confusing, but there are
certain situations where plugins are adequately official to be in the main
API.

-- Yehuda

On 1/7/07, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:


It's beautiful! Your site has always been my first stop for reading the
docs!

is it still xsl based? Did you have to do it offline because of xsl 2
stuff?

On 1/7/07, Yehuda Katz [EMAIL PROTECTED] wrote:
 Hey guys,

 I've been listening to all of the feedback I've gotten about Visual
jQuery,
 and I've built a new version that I believe responds to many of those
 concerns:
 * a dramatically reduced title-bar (20px high)
 * a path in the titlebar indicating the current location in the API
tree
 * the text area takes up the full remaining area of the screen
 * if the text area is less than 350px wide, it expands a column,
pushing
 the remaining columns to the left
 * you can move columns off to the left to get more space for text (even
if
 it has not automatically expanded)
 * selecting an node automatically jumps up to the top of the screen
 (specifically useful for automatically getting to the top of text
areas)
 * the rendering is done differently, so the normal drawbacks of nesting
are
 no longer present

 Check it out at:

 http://www.visualjquery.com/new.html

  Note that there are still some bugs, so I won't get upset if you report
 them. Just tell me exactly what you did and what went wrong.

 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Visual jQuery Redux

2007-01-07 Thread Yehuda Katz

You can IM me at outlookeic.

-- Yehuda

On 1/7/07, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:


I understand about browsers stuck at xsl 1, and when you try something
new... they break!
Do you have a handle on the incompatibility or do you need some xsl
help? I've written some mean xsl 2 code, that won't run on any
browser, but makes some pleasant xhtml.

PS
I read every line of the original xsl, and loved it!

On 1/7/07, Yehuda Katz [EMAIL PROTECTED] wrote:
 Mozilla wasn't liking the XSL sheet this time around, so I'm doing the
 transform through Oxygen. I'm going to be finding a better solution to
 automate this thing better.

 I'm also going to be releasing an offline version in the near future in
 conjunction with jQuery 1.1.

 Regarding the Methods plugin, I'm in favor of a new @plugin doc tag
that
 would allow plugins that extended core functionality to be placed inside
the
 main API, but that I could set off with a different color (red?) inside.
I
 would not use it extensively, because it could be confusing, but there
are
 certain situations where plugins are adequately official to be in the
main
 API.

 -- Yehuda


 On 1/7/07, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
  It's beautiful! Your site has always been my first stop for reading
the
 docs!
 
  is it still xsl based? Did you have to do it offline because of xsl 2
 stuff?
 
  On 1/7/07, Yehuda Katz  [EMAIL PROTECTED] wrote:
   Hey guys,
  
   I've been listening to all of the feedback I've gotten about Visual
 jQuery,
   and I've built a new version that I believe responds to many of
those
   concerns:
   * a dramatically reduced title-bar (20px high)
   * a path in the titlebar indicating the current location in the
API
 tree
   * the text area takes up the full remaining area of the screen
   * if the text area is less than 350px wide, it expands a column,
 pushing
   the remaining columns to the left
   * you can move columns off to the left to get more space for text
(even
 if
   it has not automatically expanded)
   * selecting an node automatically jumps up to the top of the screen
   (specifically useful for automatically getting to the top of text
 areas)
   * the rendering is done differently, so the normal drawbacks of
nesting
 are
   no longer present
  
   Check it out at:
  
   http://www.visualjquery.com/new.html
  
Note that there are still some bugs, so I won't get upset if you
report
   them. Just tell me exactly what you did and what went wrong.
  
   --
   Yehuda Katz
   Web Developer | Wycats Designs
   (ph)  718.877.1325
   ___
   jQuery mailing list
   discuss@jquery.com
   http://jquery.com/discuss/
  
  
  
 
 
  --
  Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 



 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] JQuery on Rails

2007-01-05 Thread Yehuda Katz

It's going to take a different approach than the built-in Rails one that
makes more of an effort to make use of the inherent power of JavaScript.

It's also going to make some thing easier (like sortable lists):

In the view, you'll do %= sortable_list :url = { ... }, ... %
In the controller, you'll do processes_sortable { options ... }
In the model, you'll do acts_as_sortable_list

And that's all folks.

-- Yehuda

On 1/5/07, Jon Baer [EMAIL PROTECTED] wrote:


Can I ask how the overall approach for this will be?  (ie, will it be a
rails plugin overriding all the helpers?) Or will there be additional
functionality?

Thanks.

- Jon

On Jan 5, 2007, at 5:14 PM, Francisco Brito wrote:

I'm looking forward to this. Seems like a very good opportunity for jQ
promotion especially since proto/culous enjoys the advantage of being
pre-packaged in rails.



On 1/5/07, Yehuda Katz [EMAIL PROTECTED] wrote:

 I'm going to have something with jQuery 1.1 mid-January.

 -- Yehuda

 On 1/5/07, Jon Baer  [EMAIL PROTECTED]  wrote:
 
  Hi,
 
  Just coming back from holidays and playing catch up ...
 
  I know there was some discussion a while ago and it seems this was
  setup:
 
  http://trac.visualjquery.com/jQueryRails
 
  But is there an update on it?  (Also is there any similar approach to
  CakePHP 1.2?)  Ive read there were generic adapters but can't tell
  from the code/svn log.
 
  Thanks.
 
  - Jon
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 



 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/





--
Francisco Brito

http://nullisnull.blogspot.com | http://www.flickr.com/photos/darkgoyle |
http://brito.mindsay.com___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Selectors..

2007-01-04 Thread Yehuda Katz

This is a very interesting request. I second the motion.

On 1/4/07, spinnach [EMAIL PROTECTED] wrote:


..that's basically the same as
$('[EMAIL PROTECTED],[EMAIL PROTECTED]'), but the docs say using
:text is faster.. but it would be nice to have the ability to select
elements in such manner ( eg. $('[EMAIL PROTECTED]|bar]') or
$('[EMAIL PROTECTED]|bar]') )
i had a need for such things a few times..

Mike Alsup wrote:
  do jquery selectors support something like 'select every
[EMAIL PROTECTED]
 OR password]', eg: $('[EMAIL PROTECTED]|password]) ? .. i know i can
select
 them like $('[EMAIL PROTECTED],[EMAIL PROTECTED]'), but the other
method
 could be faster, if supported, i think :)..

 I think you can do $(':text,:password');

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] A couple of simple questions.

2007-01-04 Thread Yehuda Katz

I'm pretty sure $([EMAIL PROTECTED]) would work fine.

-- Yehuda

On 1/4/07, Christopher Jordan [EMAIL PROTECTED] wrote:


 Klaus Hartl wrote:

Christopher Jordan schrieb:

 Hi folks,

How can I tell what class (or classes) an element has? For instance I've
got an elements like:

div class=classA classB/div
div class=classA classC/div

How can I select all elements that have classA and ClassB but not classC?

 $('div.classA, div.classB').not('.classC')

In case you want only elements that are of classA and classB use this:

$('div.classA.classB')

 I had tried something like this, but didn't get the syntax quite right. I
wasn't caring about the div part of it and just said:
$(.classA .classB)... with a space.

  I'd also like to know how to select all items of a certain class and
attribute. For instance:

div class=classA Status=On/div
div class=classA Status=Off/div
div class=classA Status=Off/div
div class=classA Status=On/div
div class=classA Status=Off/div
div class=classA Status=Off/div

I want jQuery to match all the elements that are of classA and that have
the Status attribute set to On. How would I do that?

$('div.classA').filter('[EMAIL PROTECTED]On]')

 Ah! I looked at contains... didn't even see filter. My eyes must have
just passed over it in scanning the API.

Thanks heaps, Klaus! I really appreciate it! :o)

Cheers,
Chris

--
http://www.cjordan.info


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Selectors..

2007-01-04 Thread Yehuda Katz

Allowing Regex is a non-trivial problem. These solutions, which target
specific use-cases, are much more likely.

-- Yehuda

On 1/4/07, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:


wasn't there some chat about allowing a regex in the selection? or was
it a plugin?

I think it's a very good idea!

On 1/4/07, Yehuda Katz [EMAIL PROTECTED] wrote:
 This is a very interesting request. I second the motion.


 On 1/4/07, spinnach [EMAIL PROTECTED] wrote:
  ..that's basically the same as
  $('[EMAIL PROTECTED],[EMAIL PROTECTED]'), but the
 docs say using
  :text is faster.. but it would be nice to have the ability to select
  elements in such manner ( eg. $('[EMAIL PROTECTED]|bar]') or
  $('[EMAIL PROTECTED]|bar]') )
  i had a need for such things a few times..
 
  Mike Alsup wrote:
do jquery selectors support something like 'select every
 [EMAIL PROTECTED]
   OR password]', eg: $('[EMAIL PROTECTED]|password]) ? .. i know i can
 select
   them like
 $('[EMAIL PROTECTED],[EMAIL PROTECTED]'), but the other
 method
   could be faster, if supported, i think :)..
  
   I think you can do $(':text,:password');
  
   ___
   jQuery mailing list
   discuss@jquery.com
   http://jquery.com/discuss/
  
 
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 



 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Selectors..

2007-01-04 Thread Yehuda Katz

Yep. That's one workaround. I personally like the idea of [EMAIL PROTECTED]|z] 
though.

-- Yehuda

On 1/4/07, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:


what happened to filter with a function param??? that sounded like a
work-around for the regex.


On 1/4/07, Yehuda Katz [EMAIL PROTECTED] wrote:
 Allowing Regex is a non-trivial problem. These solutions, which target
 specific use-cases, are much more likely.

 -- Yehuda



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] JQuery on Rails

2007-01-04 Thread Yehuda Katz

I'm going to have something with jQuery 1.1 mid-January.

-- Yehuda

On 1/5/07, Jon Baer [EMAIL PROTECTED] wrote:


Hi,

Just coming back from holidays and playing catch up ...

I know there was some discussion a while ago and it seems this was
setup:

http://trac.visualjquery.com/jQueryRails

But is there an update on it?  (Also is there any similar approach to
CakePHP 1.2?)  Ive read there were generic adapters but can't tell
from the code/svn log.

Thanks.

- Jon

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] break in $.each

2007-01-04 Thread Yehuda Katz

Aaron: That's correct and it can be extremely useful in DOM manipulation if
you need to build unique strings based on the object (say, ids).

-- Yehuda

On 1/4/07, Aaron Heimlich [EMAIL PROTECTED] wrote:


I just took a look at the code for $.each and noticed that is passes two
arguments to the callback, the name/index of the current item and the item
itself (in that order).

Test page: http://aheimlich.freepgs.com/tests/jquery/each-test/

On 1/4/07, Michael Geary [EMAIL PROTECTED] wrote:

   Andreas, if I remember correctly, the following should work:
  
   $.each(object, function() {
  
return false;
   });

  That isn't supported. The necessary code was removed due to
  unsolved problems. Actually the stuff that Michael just
  posted would help a lot to solve it, though I'm not sure if
  it is even possible, due to the Function.apply usage.

 The code I posted does solve this problem completely - simply use
 objectEach
 instead of $.each, and change your callback function to take explicit
 parameters instead of using this.

 Using this in an object iterator doesn't make much sense anyway. You
 need
 two arguments (name and value) regardless, and the code is much more
 understandable when they are both named parameters.

 $.each should be regarded as a jQuery internal function only - there's
 no
 reason to use it when it's so easy to write your own, more
 straightforward
 iterator.

 -Mike


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Group

2007-01-03 Thread Yehuda Katz

And good news: I just updated Visual jQuery with the latest plugins in svn
and jQuery 1.0.4.

-- Yehuda

On 1/3/07, Andreas Wahlin [EMAIL PROTECTED] wrote:


you've probably heard about it but just in case, visual jquery is
really helpful
http://www.visualjquery.com

ANdreas



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Recent updates to the form plugin

2007-01-03 Thread Yehuda Katz

Mike,

Thanks for clearInputs. Did you resolve the bug in resetForm?

-- Yehuda

On 1/3/07, Mike Alsup [EMAIL PROTECTED] wrote:


The latest version of the form plugin has some new features that you
may not be aware of.

New Functions:
resetForm, clearForm and clearInputs

// invokes the form's native 'reset' method
$('#myForm').resetForm();

// clears all (appropriate) fields in the form
$('#myForm').clearForm();

// clears matched fields
$('.myStuff').clearInputs();


New Options for ajaxSubmit and ajaxForm:
resetForm, clearForm

// resets form after successful server response
$('#myForm').ajaxForm({ resetForm: true });

// clears form after successful server response
$('#myForm').ajaxForm({ clearForm: true });


As always, the latest form plugin can be found at:

http://jquery.com/dev/svn/trunk/plugins/form/form.js?format=txt

Full documentation can be found in the source file.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] find mouse cooridate?

2007-01-02 Thread Yehuda Katz

I think pageX would be the appropriate method, not clientX. Are you looking
for the mouse position relative to the page or relative to the element in
question?

-- Yehuda

On 1/2/07, xmrcivicboix [EMAIL PROTECTED] wrote:



hi guys,

I'm trying to find the mouse coordinate whenever I right click but it I
just
can't get passed this point. Here is my code:

begin: function(){
var selectors = $([EMAIL PROTECTED]);

$.each(selectors, function(i) {
$(selectors[i]).bind(contextmenu, function() {

eip.mouse(window.event); // THIS IS WHERE
I'M STUCK
});

return true;
});
},

mouse: function(evt){
alert(
clientX value:  + evt.clientX + \n +
clientY value:  + evt.clientY + \n
);
},
--
View this message in context:
http://www.nabble.com/find-mouse-cooridate--tf2908997.html#a8127350
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Please wait.. tutorial

2007-01-02 Thread Yehuda Katz

Yep. The first response to the thread linked to it:
http://www.malsup.com/jquery/block/

It occurs to me that it would be cool if you could constrain the UI blocking
to a specific element. Mike?

-- Yehuda

On 1/2/07, Christopher Jordan [EMAIL PROTECTED] wrote:


 I can't remember who (sorry), but someone created a simple disable UI
plug-in. It allows for a message like (please wait). You should be able to
search the archives for it. It wasn't but a week or so ago that the thread
was posted.

Cheers,
Chris

Dan Atkinson wrote:

This looks really cool!

I wonder if anyone has something like this which temporarily ghosts specific
elements for a period of time at all, instead of entire pages?

Cheers,

Dan Atkinson


AHeimlich wrote:

 http://www.malsup.com/jquery/block/ might interest you.

Happy New Year!

--Aaron

On 12/31/06, Mungbeans [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Does anyone know where there is a good tutorial on coding a Please
wait..
sign to appear in the middle of the page whenever ajax commands are being
processed?

I've tried, but so far haven't had much success.
--
View this message in context:
http://www.nabble.com/Please-wait..--tutorial-tf2903421.html#a8111968
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
[EMAIL PROTECTED]://jquery.com/discuss/

   --
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]://aheimlich.freepgs.com

___
jQuery mailing list
[EMAIL PROTECTED]://jquery.com/discuss/



--
http://www.cjordan.info


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] find mouse cooridate?

2007-01-02 Thread Yehuda Katz

There's a browser issue here. IE supports window.event, while FF requires
event. jQuery works around this by accepting an e parameter to event
handlers, which will always return the event object.

begin: function(){
  var selectors = $([EMAIL PROTECTED]);

  $.each(selectors, function(i) {
  $(selectors[i]).bind(contextmenu, function(e) {

  eip.mouse(e); // THIS IS WHERE I'M STUCK
  });

  return true;
  });
  },

mouse: function(evt){
  alert(
  clientX value:  + evt.clientX + \n +
  clientY value:  + evt.clientY + \n
  );
  },


On 1/2/07, bmsterling [EMAIL PROTECTED] wrote:



I use event not window.event and works fine.
--
View this message in context:
http://www.nabble.com/find-mouse-cooridate--tf2908997.html#a8127498
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jquery expression language docs - are they in SVN?

2007-01-02 Thread Yehuda Katz

you could theoretically document each expression like a property. We might
need to tweak our XSLs, but I think it could work.

On 1/2/07, Jörn Zaefferer [EMAIL PROTECTED] wrote:


Dotan Dimet schrieb:
 Anyone willing to add this?

The problem is the format. How do you document the quite complex
expressions?

The API docs so far are all based around methods, each with a name,
paramters, return types, description and examples.

Any ideas how to effectively document the expressions are appreciated.

--
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] googlemaps plugin

2007-01-02 Thread Yehuda Katz

There is no forEach in IE. Either do a regular loop or use $.each.

-- Yehuda

On 12/28/06, Vincent Majer [EMAIL PROTECTED] wrote:


Hi,

I'm working on the plugin for jquery :
http://olbertz.de/jquery/googlemap.html

it's really great with firefox.. but it doesn't work in IE...

I've made some tests and it seems that the problem comes from this
foreach  :

 locations.forEach(function(element, index, array) {
 var marker = new GMarker(new GLatLng(element.latitude,
element.longitude), {title: element.name});
 map.addOverlay(marker);
 GEvent.addListener(marker, 'click', function() {
 marker.openInfoWindowHtml('Name: b'+element.name+'/bbr
/Latitude: b'+element.latitude+'/bbr /Longitude:
b'+element.longitude+'/b');
 });
 link = 'a href=#
onclick=moveMapTo('+index+')'+element.name+'/abr /';
 $('p#location_list').append(link);
 });


locations.forEach seems to cause problems with IE...
Is there a workaround ?

thanks in advance




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] A question on itteration

2007-01-02 Thread Yehuda Katz

Just so you know, CSS supports [x=y] notation, but jQuery uses [EMAIL 
PROTECTED] so we
can use plain [] for contains

-- Yehuda

On 1/2/07, Christopher Jordan [EMAIL PROTECTED] wrote:


 Yeah I knew it was the attribute selection that was XPath. Thanks for the
link, too! :o)

BTW, Karl. Your solution worked great!

Cheers,
Chris

Felix Geisendörfer wrote:

The attribute selection is XPath style, which is part of jQuery's
'supported, but different' CSS selectors:

http://jquery.com/docs/Base/Expression/CSS/#Supportedbutdifferent

-- Felix Geisendörfer aka the_undefined
--
http://www.thinkingphp.org
http://www.fg-webdesign.de


Christopher Jordan wrote:

Thanks Karl. That's XPath notation, right? I've got to pick some of that
up. I know next to nothing about it. There seems to be a problem with the
example I gave in my original post, so I'm going to give your solution a
shot. I'll let you know how it goes. Thanks!


Cheers,
Chris

Karl Swedberg wrote:

Hi Christopher,
 I think you can get away with using an attribute selector on the td:

 $('[EMAIL PROTECTED]').each(function() {
  //do whatever it is you're going to do...
});


 --Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



 On Jan 2, 2007, at 3:30 PM, Christopher Jordan wrote:

 Hi folks,

I've got a page with a table and various tds that look something like
this:

td
id= SomeUniqueID
class = someClass
originalColor = someColor
state = Enabled
status= off
preferred = Yes
dateValue = someDateValue
/td

In some cases the status is set to on and in others it's left as off.
I'd like to be able to get the dateValue that is associated with each td
that has a status of on.

Is there a better way to do that than this:

$(td).attr(status).each(function(){
if(this.status == on){
   //do whatever it is i'm going to do...
}
});

I'm thinkin' this might be it, but thought I'd check with the group to see
if maybe there was a more super-cool way to accomplish this. :o)

Thanks,
Chris

--
http://www.cjordan.info

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


 --

___
jQuery mailing list
[EMAIL PROTECTED]://jquery.com/discuss/


--
http://www.cjordan.info

--

___
jQuery mailing list
[EMAIL PROTECTED]://jquery.com/discuss/

 --

___
jQuery mailing list
[EMAIL PROTECTED]://jquery.com/discuss/


--
http://www.cjordan.info


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Stopping animation..

2007-01-02 Thread Yehuda Katz

Not currently. What syntax would you think would be appropriate?

-- Yehuda

On 1/2/07, spinnach [EMAIL PROTECTED] wrote:


 no, i mean stopping an animation that's already started..

Michael E. Carluen wrote:

 Do you mean pause? If so you can pause an execution by using:



setTimeout(function() {

$(#div).fadeTo('slow',0.0);

}, 5000 );








  --

*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED][EMAIL PROTECTED]]
*On Behalf Of *spinnach
*Sent:* Tuesday, January 02, 2007 1:52 PM
*To:* jQuery Discussion.
*Subject:* [jQuery] Stopping animation..



Is there any way to stop an animation or fade? How to stop
$('#div').fadeTo(500,0) on click or something?

--

___
jQuery mailing list
[EMAIL PROTECTED]://jquery.com/discuss/



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] disable div oncontextmenu?

2007-01-02 Thread Yehuda Katz

Eh. Good point. You should probably be using .bind anyway, even for stuff
like click, to keep your apps future-proof.

-- Yehuda

On 1/2/07, John Resig [EMAIL PROTECTED] wrote:


 no luck. IE7 says this object does not support this method or property.

I think he meant:
$([EMAIL PROTECTED]).bind(contextmenu, function() { return false; });

There's no contextmenu event method, which is what causes the error
that you saw.

--John

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Please wait.. tutorial

2007-01-02 Thread Yehuda Katz

Mike,

It almost certainly would require dimensions.js. That said, I wouldn't mind.
I suspect that dimensions.js will become a pretty universally used plugin in
the near future. It adds some nice cross-browser stuff that's really
frequently used, and it's pretty small.

At this point, I would say that any new jQuery user include dimensions.jsand
forms.js by default. They both extend jQuery in really useful and needed
ways.

-- Yehuda

On 1/2/07, Mike Alsup [EMAIL PROTECTED] wrote:


 It occurs to me that it would be cool if you could constrain the UI
blocking
 to a specific element. Mike?

I'll look into it, but it may add a dependency on the dimensions plugin.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Having an issue accessing a node.

2006-12-31 Thread Yehuda Katz

HTML 4.01, section 12.2.3:

The id http://www.w3.org/TR/html401/struct/global.html#adef-id and
namehttp://www.w3.org/TR/html401/struct/links.html#adef-name-Aattributes
share the same name
space. This means that they cannot both define an anchor with the same name
in the same document. It is permissible to use both attributes to specify an
element's unique identifier for the following elements:
Ahttp://www.w3.org/TR/html401/struct/links.html#edef-A,
APPLET http://www.w3.org/TR/html401/struct/objects.html#edef-APPLET,
FORMhttp://www.w3.org/TR/html401/interact/forms.html#edef-FORM,
FRAME http://www.w3.org/TR/html401/present/frames.html#edef-FRAME,
IFRAMEhttp://www.w3.org/TR/html401/present/frames.html#edef-IFRAME,
IMG http://www.w3.org/TR/html401/struct/objects.html#edef-IMG, and
MAPhttp://www.w3.org/TR/html401/struct/objects.html#edef-MAP.
When both attributes are used on a single element, their values must be
identical. (emphasis mine).

-- Yehuda
On 12/31/06, Michael Geary [EMAIL PROTECTED] wrote:


 ...since the spec requires name and ID to be
 identical, it's technically illegal to have a name with [
 and an ID as well (since IDs cannot contain [).

Um, where does it say the name and id have to be the same?

-Mike


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Sortable Reorder?

2006-12-31 Thread Yehuda Katz

Do you mean without any server-side script? If so, you might try using the
cookie plugin to store the data and pull it back out on page-load.

-- Yehuda

On 12/31/06, Philip Pryce [EMAIL PROTECTED] wrote:



When i save my sortables as serialized data, is there a way of restoring
it
using the a sortable (sort?)  function i jQuery?
Say a list like:
left = '1|3|2';
right = '3|1|2';
then when the page loads it sorts it into that order automagically?
Thanks in Advanced.
--
View this message in context:
http://www.nabble.com/Sortable-Reorder--tf2901782.html#a8107178
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Having an issue accessing a node.

2006-12-31 Thread Yehuda Katz

I'm not sure I read it that way:

The following example illustrates that
idhttp://www.w3.org/TR/html4/struct/global.html#adef-idand
name http://www.w3.org/TR/html4/struct/links.html#adef-name-A must be the
same when both appear in an element's start tag:

PA name=a1 id=a1 href=#a1.../A


The language is pretty unambiguous. Am I missing something obvious?

-- Yehuda

On 12/31/06, Klaus Hartl [EMAIL PROTECTED] wrote:


Yehuda Katz schrieb:
 HTML 4.01, section 12.2.3:

Yes, but this refers to anchors only. Obviously following construct
makes no sense:

h2 id=the-anchor.../h2
p
 ... a name=the-anchorAn anchor/a ...
/p


Now there are two anchors in the document with the same namespace. Which
one should the browser focus when clicking on a link pointing to
#the-anchor.

That is what is meant here. See the illegal example. Id and name
attribute must only be the same, if you declare them both for an anchor,
for example for backwards compatibility if you're serving XHTML as
text/html, compare:
http://www.w3.org/TR/xhtml1/guidelines.html#C_8

The name attribute is deprecated for anchors anyway.

It is perfectly valid to use different names and ids for form elements.


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Sortable Reorder?

2006-12-31 Thread Yehuda Katz

Do each of the nodes have an ID? Or are you basing it on their initial
order?

-- Yehuda

On 12/31/06, Philip Pryce [EMAIL PROTECTED] wrote:


i've already found a way to remember the serialized code for the lists,
just how to restore the serialized numbers back into lists?
thanks.

On 31/12/06, Yehuda Katz [EMAIL PROTECTED] wrote:

 Do you mean without any server-side script? If so, you might try using
 the cookie plugin to store the data and pull it back out on page-load.

 -- Yehuda

 On 12/31/06, Philip Pryce [EMAIL PROTECTED] wrote:
 
 
  When i save my sortables as serialized data, is there a way of
  restoring it
  using the a sortable (sort?)  function i jQuery?
  Say a list like:
  left = '1|3|2';
  right = '3|1|2';
  then when the page loads it sorts it into that order automagically?
  Thanks in Advanced.
  --
  View this message in context: 
http://www.nabble.com/Sortable-Reorder--tf2901782.html#a8107178
 
  Sent from the JQuery mailing list archive at Nabble.com.
 
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 



 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/





--
~Philip Pryce
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Sortable Reorder?

2006-12-31 Thread Yehuda Katz

so say you get 1|3|2 and your nodes have id li_1 etc.

something like the following should work:

var sortedList = 1|3|2.split(|)
var expr = #li_ + sortedList.join(, #li_)
jQuery(expr).appendTo(#container)

-- Yehuda

On 12/31/06, Philip Pryce [EMAIL PROTECTED] wrote:


slight typo,
Each node has an id, and i have it on a list, i just need the li's to be
reordered once the page is loaded again to this order.

On 31/12/06, Philip Pryce [EMAIL PROTECTED] wrote:

 each node has and id, and i have it listed, i just need to reorder them
 once the page loads again.

 On 31/12/06, Yehuda Katz  [EMAIL PROTECTED] wrote:
 
  Do each of the nodes have an ID? Or are you basing it on their initial
  order?
 
  -- Yehuda
 
  On 12/31/06, Philip Pryce  [EMAIL PROTECTED] wrote:
  
   i've already found a way to remember the serialized code for the
   lists, just how to restore the serialized numbers back into lists?
   thanks.
  
   On 31/12/06, Yehuda Katz [EMAIL PROTECTED] wrote:
   
Do you mean without any server-side script? If so, you might try
using the cookie plugin to store the data and pull it back out on 
page-load.
   
-- Yehuda
   
On 12/31/06, Philip Pryce [EMAIL PROTECTED] wrote:


 When i save my sortables as serialized data, is there a way of
 restoring it
 using the a sortable (sort?)  function i jQuery?
 Say a list like:
 left = '1|3|2';
 right = '3|1|2';
 then when the page loads it sorts it into that order
 automagically?
 Thanks in Advanced.
 --
 View this message in context: 
http://www.nabble.com/Sortable-Reorder--tf2901782.html#a8107178

 Sent from the JQuery mailing list archive at Nabble.com.


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/

   
   
   
--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
   
   
   
  
  
   --
   ~Philip Pryce
   ___
   jQuery mailing list
   discuss@jquery.com
   http://jquery.com/discuss/
  
  
  
 
 
  --
  Yehuda Katz
  Web Developer | Wycats Designs
  (ph)  718.877.1325
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 
 
 


 --
 ~Philip Pryce




--
~Philip Pryce
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] animate not pixel perfect?

2006-12-31 Thread Yehuda Katz

My guess is that it has to do with:

http://jquery.com/dev/bugs/bug/260/

-- Yehuda

On 12/31/06, Will Olbrys [EMAIL PROTECTED] wrote:



I'm having a problem with the .animate method.

I'm using it to slide some div's left and right. One part of the project
does not have alot of text but has some background images and some images,
the other is very textheavy. One of these effects is loaded asynchronously
and the other is loaded on page load, but they both experience the same
problem.

It runs fine, but about 3 out of 5 times it doesnt end up at the right
position. Such as when I slide the text left and then slide it back right
again it may be off by two pixels, it may be off by 15-30 pixels. I've
hypothesized that this is somehow related to my cpu performance, because
it
seems to be farther off when my browser freezes briefly (as though it is
doing some serious number crunching). This happens much more frequently in
Firefox 2 than in IE 7 (which runs much more smoothly).

Here is an example of the calls:

newPos = (articlesWidth*articleCursor*-1);
inMotion = true;
articlePreview.animate({left: newPos}, 600, function(){inMotion =
false;});

It also happens less severely when I took the calculation of newPos out of
the animate method.

Any thoughts?

Thank you,

Will
--
View this message in context:
http://www.nabble.com/animate-not-pixel-perfect--tf2902307.html#a8108720
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Sortable Reorder?

2006-12-31 Thread Yehuda Katz

No problem :-D

-- Yehuda

On 12/31/06, Philip Pryce [EMAIL PROTECTED] wrote:


Dude, you've saved my life, thanks soo much, it worked with out too much
editting.

On 31/12/06, Yehuda Katz [EMAIL PROTECTED]  wrote:

 so say you get 1|3|2 and your nodes have id li_1 etc.

 something like the following should work:

 var sortedList = 1|3|2.split(|)
 var expr = #li_ + sortedList.join(, #li_)
 jQuery(expr).appendTo(#container)

 -- Yehuda

 On 12/31/06, Philip Pryce  [EMAIL PROTECTED] wrote:
 
  slight typo,
  Each node has an id, and i have it on a list, i just need the li's
  to be reordered once the page is loaded again to this order.
 
  On 31/12/06, Philip Pryce [EMAIL PROTECTED] wrote:
  
   each node has and id, and i have it listed, i just need to reorder
   them once the page loads again.
  
   On 31/12/06, Yehuda Katz  [EMAIL PROTECTED] wrote:
   
Do each of the nodes have an ID? Or are you basing it on their
initial order?
   
-- Yehuda
   
On 12/31/06, Philip Pryce  [EMAIL PROTECTED] wrote:

 i've already found a way to remember the serialized code for the
 lists, just how to restore the serialized numbers back into lists?
 thanks.

 On 31/12/06, Yehuda Katz [EMAIL PROTECTED] wrote:
 
  Do you mean without any server-side script? If so, you might
  try using the cookie plugin to store the data and pull it back out 
on
  page-load.
 
  -- Yehuda
 
  On 12/31/06, Philip Pryce [EMAIL PROTECTED]
  wrote:
  
  
   When i save my sortables as serialized data, is there a way
   of restoring it
   using the a sortable (sort?)  function i jQuery?
   Say a list like:
   left = '1|3|2';
   right = '3|1|2';
   then when the page loads it sorts it into that order
   automagically?
   Thanks in Advanced.
   --
   View this message in context: 
http://www.nabble.com/Sortable-Reorder--tf2901782.html#a8107178
  
   Sent from the JQuery mailing list archive at Nabble.com.
  
  
   ___
   jQuery mailing list
   discuss@jquery.com
   http://jquery.com/discuss/
  
 
 
 
  --
  Yehuda Katz
  Web Developer | Wycats Designs
  (ph)  718.877.1325
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 
 
 


 --
 ~Philip Pryce
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/



   
   
--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
   
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
   
   
   
  
  
   --
   ~Philip Pryce
  
 
 
 
  --
  ~Philip Pryce
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 
 
 


 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/





--
~Philip Pryce

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] animate not pixel perfect?

2006-12-31 Thread Yehuda Katz

Yep :(

On 12/31/06, Will Olbrys [EMAIL PROTECTED] wrote:



Thanks for the response. Reading that bug ticket... does it mean the bug
has
yet to be fixed in 1.1?

Will


wycats wrote:

 My guess is that it has to do with:

 http://jquery.com/dev/bugs/bug/260/

 -- Yehuda

 On 12/31/06, Will Olbrys [EMAIL PROTECTED] wrote:


 I'm having a problem with the .animate method.

 I'm using it to slide some div's left and right. One part of the
project
 does not have alot of text but has some background images and some
 images,
 the other is very textheavy. One of these effects is loaded
 asynchronously
 and the other is loaded on page load, but they both experience the same
 problem.

 It runs fine, but about 3 out of 5 times it doesnt end up at the right
 position. Such as when I slide the text left and then slide it back
right
 again it may be off by two pixels, it may be off by 15-30 pixels. I've
 hypothesized that this is somehow related to my cpu performance,
because
 it
 seems to be farther off when my browser freezes briefly (as though it
is
 doing some serious number crunching). This happens much more frequently
 in
 Firefox 2 than in IE 7 (which runs much more smoothly).

 Here is an example of the calls:

 newPos = (articlesWidth*articleCursor*-1);
 inMotion = true;
 articlePreview.animate({left: newPos}, 600, function(){inMotion =
 false;});

 It also happens less severely when I took the calculation of newPos out
 of
 the animate method.

 Any thoughts?

 Thank you,

 Will
 --
 View this message in context:

http://www.nabble.com/animate-not-pixel-perfect--tf2902307.html#a8108720
 Sent from the JQuery mailing list archive at Nabble.com.


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/



--
View this message in context:
http://www.nabble.com/animate-not-pixel-perfect--tf2902307.html#a8110515
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Thanks -- Jquery for a great tool in 2006

2006-12-31 Thread Yehuda Katz

Hear hear!

On 12/31/06, Scottus [EMAIL PROTECTED] wrote:


  Jquery is the first Javascript library that I found useful so I
actually use it.

Great job everyone who helped.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] .not($(obj))

2006-12-31 Thread Yehuda Katz

What about something like: $([EMAIL PROTECTED]).parents(li)

The first expression will return ol's with any kids attribute, and then grab
all parent nodes that are lis.

Does that help?

-- Yehuda

On 1/1/07, Oliver Boermans [EMAIL PROTECTED] wrote:


On 31/12/06, Blair Mitchelmore [EMAIL PROTECTED] wrote:
 I'm not sure but I think that .not(obj) is currently implemented to
 exclude singular DOM elements, meaning arrays of elements and jQuery
 element sets wouldn't do anything. That could maybe be an API change for
 jQuery 1.1?

 -blair

Sounds like a good idea - I guess the next step is to submit a bug?

In the meantime - perhaps there is a different way to solve the
problem I am tackling. If it's messy enough perhaps the need for added
.not() functionality will be clarified.

I am aiming to select every li whose immediate children ol elements
ALL have a particular attribute set (previously with javascript).

Example HTML:
...
ol
li !-- This li should NOT be selected --
ol !-- As this li lacks attribute 'kids' --
li.../li
/ol
ol kids=4
li.../li
li.../li
li.../li
li.../li
/ol
ol kids=2
li.../li
li.../li
/ol
/li
li !-- This li should be selected --
ol kids=3 !-- As this li AND... --
li.../li
li.../li
li.../li
/ol
ol kids=1 !-- this li both have attribute 'kids' --
li.../li
/ol
/li
/ol
...

Another way of expressing what I'm trying to do:

$(li).not([EMAIL PROTECTED]'undefined']])...

Obviously this doesn't work on a number of levels.

It occured to me that I could, earlier in the process, set kids to 0
on every ol. Allowing for something more like

$(li).not([EMAIL PROTECTED]'0']])...

But this didn't solve my fundamental problem - how do I check
attributes of ALL the children of the li?

Am I asking the right question?
My mind is a soup of confused double negatives ;/

Happy New Year!
Ollie

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Having an issue accessing a node.

2006-12-30 Thread Yehuda Katz

What's interesting is that you can use traditional DOM methods to easily
access nodes by name. According to the spec, name and id share a namespace,
and form[ident] (same as form.ident) returns an element in the form with
the id or name name. So you might be able to optimize your code a bit.
That said, since the spec requires name and ID to be identical, it's
technically illegal to have a name with [ and an ID as well (since IDs
cannot contain [).

Weird, huh?

-- Yehuda

On 12/30/06, Blair McKenzie [EMAIL PROTECTED] wrote:


$([EMAIL PROTECTED]'blog[headline]']) will work. A lot slower than selecting
by id though.

Blair.

On 12/30/06, Aaron Heimlich  [EMAIL PROTECTED] wrote:

 On 12/30/06, Jason Yeckel [EMAIL PROTECTED] wrote:
 
  Blast but it groups them in to an array and is so nice sometimes lol
  *shrugs*
 

 [] is perfectly acceptable in the name attribute[1][2] (in fact, PHP
 will even use them to create arrays of form variables[3]). It is not,
 however, acceptable in the id attribute, and using them can lead to the
 kinds of issues you are having.

 [1] http://www.w3.org/TR/html4/interact/forms.html#adef-name-INPUT
 [2] http://www.w3.org/TR/html4/types.html#type-cdata
 [3] http://www.php.net/manual/en/faq.html.php#faq.html.arrays

 --
 Aaron Heimlich
 Web Developer
 [EMAIL PROTECTED]
 http://aheimlich.freepgs.com
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $('a')[0].click() not working?

2006-12-29 Thread Yehuda Katz

The issue is that you can't trigger a link's default action via a click.
I've worked around it with the following code:

   jQuery(table.data_panel tr).each(function(){
 if(jQuery(a, this).length == 1) jQuery(this).click(function(e) {
   var link = jQuery(this).find(a)[0];
   if(!jQuery(e.target).is(:input)  !jQuery(e.target).is(option)
 !link.onclick) {
 window.open(link.href, link.target || _self);
 return false;
   } else if(!jQuery(e.target).is(:input) 
!jQuery(e.target).is(option)
 link.onclick) {
 jQuery(link).click();
 return false;
   }
 });
   });

That code is a bit more complex, because it tests for other situations, but
the meat of it, which is:

var link = jQuery( a, this)
if(!link.onclick) window.open(link.href, link.target || _self)
else jQuery(link).click()

is what you need. That will open the link with the current target (defaults
to self) if there's no existing click binding, otherwise it'll fire the
click event.

-- Yehuda

On 12/29/06, Jonathan Sharp [EMAIL PROTECTED] wrote:


I'm embarassed to post this, but is the click() method not supported for
links to trigger them?

I have a div that has a link inside of it that I want to trigger as if
someone clicked that link when they click the div.

div id=foo
a href=http://jquery.com;MyLink/a
/div

$('#foo').bind('click', function(){
 // Works in IE, not Firefox
 $(' a', this)[0].click();
 // I've also tried
 $(' a', this).trigger('click');
});

Does the click method just not work like I am expecting it to?

-js

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQBrowser²

2006-12-29 Thread Yehuda Katz

Rocking good stuff. I may actually have a use for this :)

-- Yehuda

On 12/29/06, Nate Cavanaugh [EMAIL PROTECTED] wrote:



My very first plugin, but of course, I only compiled it from two other
scripts, so much kudos to the original authors. Just consider this an
improvement on their work :)

http://www.alterform.com/resources/jqbrowser-2
--
View this message in context:
http://www.nabble.com/jQBrowser-tf2897313.html#a8094768
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Matching a link's href value to another link on the page

2006-12-28 Thread Yehuda Katz

Try $(#navigation [EMAIL PROTECTED] + $(#matchThis).attr(href) + ])

On 12/28/06, Chaim [EMAIL PROTECTED] wrote:


Hi Everyone,
Here's what I'd like to able to do (simplified), although I can't seem
to figure out how to do it.

If the link in matchThis has the same href as the link in
navigation, how can I select the link with the matching href in
navigation? 

for the code:
div id=navigation
a href=about.htmlI want this link, because the href matches/a
a href=bla.htmlI don't want this Link/a
a href=gla.htmlI don't want this Link/a
a href=zla.htmlI don't want this Link/a
/div
div id=matchThisa href=about.htmlLink to match to/a/div


Thanks,
Chaim

--


Always Thinking.

The Berndt Group
www.berndtgroup.net

3618 Falls Road, Suite 300
Baltimore, Maryland. 21211

email: [EMAIL PROTECTED]
phone: 410-889-5854 ex. 23
fax: 410-889-5904



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Clearing all form field values

2006-12-28 Thread Yehuda Katz

$(form :input:not([EMAIL PROTECTED]):not(button)).val()

I personally prefer reset() because there's rarely a case where you're
setting default values that you don't intend to be the default value ;)

-- Yehuda

On 12/28/06, Mike Alsup [EMAIL PROTECTED] wrote:


 That could also be written as: $(form :input).val();

I wouldn't recommend that because :input will grab all inputs
*including* type==submit and type==button.  Clearing those is probably
not what you'd want to do.

I think maybe the form plugin needs to provide clearForm and resetForm
methods and perhaps options to perform these functions automatically
upon successful submit.

Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Clearing all form field values

2006-12-28 Thread Yehuda Katz

You could try putting a form within a form. I'm not sure how valid it is,
but it definitely solves certain problems.

-- Yehuda

On 12/28/06, Andy Matthews [EMAIL PROTECTED] wrote:


 The problem for me (in this case) is that the few fields that need to be
transmitted via AJAX (and then reset) are part of a larger form that I do
NOT want to get reset.

I might just have to do each field manually.

!//--
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--//-

-Original Message-
*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of *Dave Methvin
*Sent:* Thursday, December 28, 2006 11:56 AM
*To:* 'jQuery Discussion.'
*Subject:* Re: [jQuery] Clearing all form field values

 $(form :input:not([EMAIL PROTECTED]):not(button)).val()

That will clobber the values on radio buttons and checkboxes. Here's
another vote for form.reset().


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Should one announce something like that?

2006-12-28 Thread Yehuda Katz

What about:

$('div.comment,h3.change').each(function() {
   if
($(this).html().match(/phenter|whore|sex|fuck|nude|xxx|urlcutter|pharm/)) {
   $(this).remove()
   }
});

Much more fun ;)

-- Yehuda

On 12/28/06, John Resig [EMAIL PROTECTED] wrote:


That's just a tracking script that I'm testing out, along with Google
Analytics. Don't worry about it.

--John

On 12/28/06, Jonathan Sharp [EMAIL PROTECTED] wrote:
 On 12/28/06, Jonathan Sharp [EMAIL PROTECTED] wrote:
  Oh, also what is quantserve.com? It's near the bottom by google...
 
  -js

 I ment to say, there's a script reference in the source near the bottom
 which sets some cookies and junk.

 -js

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Duplicating Events in a New Object

2006-12-28 Thread Yehuda Katz

element.onclick should be a pointer to the click function, if it exists.

Is that what you need?

-- Yehuda

On 12/28/06, Michael Haggerty [EMAIL PROTECTED] wrote:


I need to know how to copy all of the events from one object to another.
Really getting stuck on this one.

What I am trying to do is write a script that replaces an A tag with a
bunch
of clustered divs, and want to take the events from A tag (an onclick and
some custom ones generated by jquery) and attach them to the new div.

I am finding it's easy to get the names of the events, but I have no clue
how to copy the methods themselves.

Help!

Thank you,
Michael Haggerty
Managing Partner
Trellon, LLC
http://www.trellon.com
(p) 301-577-6162
(c) 240-643-6561
(f) 413-691-9114
(aim) haggerty321
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
 Behalf Of bmsterling
 Sent: Thursday, December 28, 2006 10:44 PM
 To: discuss@jquery.com
 Subject: Re: [jQuery] My First Plugin - Custom Select Box


 Damn David, have you been looking at my computer!!!  I was working on
 something like this because I get a lot of designs from my designers
with
 a
 fancy select menu and I figured I create something with jquery to do
what
 you did.  Oh well, your's looks better then what I was doing.

 Nice job!
 --
 View this message in context: http://www.nabble.com/My-First-Plugin---
 Custom-Select-Box-tf2893253.html#a8083589
 Sent from the JQuery mailing list archive at Nabble.com.


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] My First Plugin - Custom Select Box

2006-12-28 Thread Yehuda Katz

My ideal custom select would:
* Be stylable in terms of borders and padding (based on the styles on the
select box itself)
* Delegate events on the custom select to the actual select (to allow for
$(select).click( // ))
* Position as you would expect a normal select box to position (minus weird
off-pixel problems)
* Be able to float

In other words, I would want the existence of the custom select to be
basically invisible from an implementer. How well does your custom select do
this?

-- Yehuda

On 12/28/06, blemming [EMAIL PROTECTED] wrote:



Here is my first attempt at a plug-in.  It is definitely in the early
stage
of development, but I thought I'd put it out here for you guys to rip
apart
(and hopefully provide a suggestions or two)

Here it is =   http://brilliantretail.com/cases/select/ Custom Select
Plugin

Let me know what you think.

Thanks, David
--
View this message in context:
http://www.nabble.com/My-First-Plugin---Custom-Select-Box-tf2893253.html#a8083502
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] My First Plugin - Custom Select Box

2006-12-28 Thread Yehuda Katz

Nah,

I was asking a question about your plugin ;)

On 12/29/06, blemming [EMAIL PROTECTED] wrote:



well, I guess my plugin must not be that goodmy post got warpped into
a
completely different topic :(


blemming wrote:

 Here is my first attempt at a plug-in.  It is definitely in the early
 stage of development, but I thought I'd put it out here for you guys to
 rip apart (and hopefully provide a suggestions or two)

 Here it is =   http://brilliantretail.com/cases/select/ Custom Select
 Plugin

 Let me know what you think.

 Thanks, David


--
View this message in context:
http://www.nabble.com/My-First-Plugin---Custom-Select-Box-tf2893253.html#a8083979
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] My First Plugin - Custom Select Box

2006-12-28 Thread Yehuda Katz

Ah,

My ideal situation would be to have a select box that gets converted via JS
for graceful degradation.

-- Yehuda

On 12/29/06, blemming [EMAIL PROTECTED] wrote:



* Be stylable in terms of borders and padding (based on the styles on the
select box itself)

There is no select box present in my plugin. If you notice it is based on
a
grouping of nested divs and the padding and borders can be controled via
css

* Delegate events on the custom select to the actual select (to allow for
$(select).click( // ))

Since there is no select box present I'm not sure how to delegate the
events
to $(select) but I would love to know how to do it

* Position as you would expect a normal select box to position (minus
weird
off-pixel problems)

it does

* Be able to float

Yep, the container div can be styled to float.


wycats wrote:

 My ideal custom select would:
  * Be stylable in terms of borders and padding (based on the styles on
the
 select box itself)
  * Delegate events on the custom select to the actual select (to allow
for
 $(select).click( // ))
  * Position as you would expect a normal select box to position (minus
 weird
 off-pixel problems)
  * Be able to float

 In other words, I would want the existence of the custom select to be
 basically invisible from an implementer. How well does your custom
select
 do
 this?

 -- Yehuda

 On 12/28/06, blemming [EMAIL PROTECTED] wrote:


 Here is my first attempt at a plug-in.  It is definitely in the early
 stage
 of development, but I thought I'd put it out here for you guys to rip
 apart
 (and hopefully provide a suggestions or two)

 Here it is =   http://brilliantretail.com/cases/select/ Custom Select
 Plugin

 Let me know what you think.

 Thanks, David
 --
 View this message in context:

http://www.nabble.com/My-First-Plugin---Custom-Select-Box-tf2893253.html#a8083502
 Sent from the JQuery mailing list archive at Nabble.com.


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/



--
View this message in context:
http://www.nabble.com/My-First-Plugin---Custom-Select-Box-tf2893253.html#a8084033
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] tableSorter bug colspan in tfoot

2006-12-27 Thread Yehuda Katz

I'm not sure if this will help, but you're supposed to use th, not td, in
tfoot.

-- Yehuda

On 12/27/06, Rafael Santos [EMAIL PROTECTED] wrote:


hey, i'd like to know if i'm doing something wrong. Check this:

table
thead
tr
  td1/td
  td2/td
/tr
/thead
tbody
tr
  td1/td
  td2/td
/tr
/tbody
tfoot
  tr
 td colspan=2products found: #que.recordCount#/td
   /tr
/tfoot
/table

When i try to sort it, firebug tells me:

tbl.sorter.js (line 292) : o has no properties
  return o.innerHTML;

I realise that if i remove the colspan it works fine...
So i shouldnt this attribute?




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] tableSorter prevent a td to active the sorting

2006-12-27 Thread Yehuda Katz

What do you mean specifically? The most recent tablesorter includes a patch
I wrote that allows you to pass a jQuery object, DOM node, or DOM node array
to disableHeaders.

-- Yehuda

On 12/27/06, Rafael Santos [EMAIL PROTECTED] wrote:


hey, How could I disable one or more td on the head when i click on it??



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] tableSorter prevent a td to active the sorting

2006-12-27 Thread Yehuda Katz

Like I said, use the disableHeader param. Pass it:
* A numerical index with the col #
* An id
* A DOM node
* A jQuery object containing DOM nodes
* An array containing DOM nodes

-- Yehuda

On 12/27/06, Rafael Santos [EMAIL PROTECTED] wrote:


totally wrong question ive made , sorry..

I was wondering how how could i set the parameter sortColumn for two or
more column, i have 4 columns the last one souldnt be sortable, u know...
thx

2006/12/27, Yehuda Katz [EMAIL PROTECTED]:

 What do you mean specifically? The most recent tablesorter includes a
 patch I wrote that allows you to pass a jQuery object, DOM node, or DOM node
 array to disableHeaders.

 -- Yehuda

 On 12/27/06, Rafael Santos [EMAIL PROTECTED] wrote:
 
  hey, How could I disable one or more td on the head when i click on
  it??
 
 
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 
 
 


 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] msie closures syntax

2006-12-27 Thread Yehuda Katz

Another possible improvement would be to genericize the work I did on the
speed test.

Specifically, to avoid browser lockup, I did the following:
* I pass a list of DOM Elements to a function
* That function executes something on the first item, and when it's done,
passes the same list with the first item chopped off back to the same
function via setTimeout

Browsers lock up when they run JavaScript continuously. Using this method,
you can create small (few millisecond) breathing space between iterations,
which results in an avoidance of lockup or non-responsive errors. The only
drawback is that you need to create manual recursive methods to handle it.

I wonder if your method above could be expanded to support something like
$.runSequentially(list, function() { // some code to run sequentially });

-- Yehuda

On 12/27/06, Choan C. Gálvez [EMAIL PROTECTED] wrote:


On 12/27/06, Michael Geary [EMAIL PROTECTED] wrote:
 Not only not related to jQuery, but not related to closures either. :-)

 The problem is that setTimeout doesn't accept the additional arguments
you
 are passing it.

 Is there any reason you can't do this:

 setTimeout( function() { doStuff( stuff, 1, 2 ); }, 100 );

 That would work in any browser.

I was intrigued by the syntax used by Moe, as I had never seen it.

It's documented at
http://developer.mozilla.org/en/docs/DOM:window.setTimeout, stating:

Note that passing additional parameters to the function in the first
syntax does not work in Internet Explorer.

Anyway, as I see possible uses for it, I've coded a helper:

function setTimeoutH(f, t) {
var params = [].slice.call(arguments, 2);
var f2 = function() {
f.apply(null, params);
}
return window.setTimeout(f2, t);
}

Hope it helps someone.



  i hope someone on this list can help me here, even tho
  my question is not directly related to jquery (duck).
 
  i have trouble getting my closures to work in ie:
 
 
  --snip
 
  //
  // A) this doesn't work in ie (ff  opera grok it)
  //
  setTimeout(  function( a,b,c ) { doStuff( a,b,c ) }, 100,
  stuff, 1, 2  );
 
 
  //
  // B) this works in IE
  //
  var fref = iehelper( stuff, 1, 2 );
  setTimeout( fref, 100 );
 
  function iehelper( a,b,c ) {
  return ( function() {
  doStuff( a,b,c );
  });
  }
 
  --snap
 
 
  anyone know how to feed that to ie without
  the nasty helper function?
--
Choan
http://choangalvez.nom.es/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Run a list of functions sequentially

2006-12-27 Thread Yehuda Katz

I finally got around to building a run sequentially plugin:

jQuery.sequence = {
 setTimeoutH: function(f, t) {
   var params = (arguments.length == 3  arguments[2].constructor ==
Array) ? arguments[2] : jQuery.merge([], arguments).slice(2);
   window.setTimeout(function() { f.apply(f, params) }, t);
 },

 run: function() {
   if(arguments[0]) arguments[0]();
   if(arguments[1]) jQuery.sequence.setTimeoutH(arguments.callee, 1,
jQuery.merge([], arguments).slice(1));
 },

 runArray: function(array, fn, whenDone) {
   if(array[0]) fn.call(array[0], array);
   if(array[1]) jQuery.sequence.setTimeoutH(arguments.callee, 1,
jQuery.merge([], array).slice(1), fn, whenDone);
   else if(whenDone) whenDone();
 }
}

jQuery.fn.sequence = function(fn, whenDone) {
 jQuery.sequence.runArray(this, fn, whenDone);
 return this;
}

You can do a few things:

$(expr).sequence(function() { console.log(this.id) }); which will run
through each item in the jQuery object and print its id to the console.
$(expr).sequence(function() { console.log(this.id) }, function() {
console.log(Done) }); which will do the same as above and when completely
done, print Done
$.sequence.run(function() { // first function }, function() { // second
function }); which will run the first function and then the second one
without locking up the browser
$.sequence.runArray([1,2,3], function() { console.log(this) }); which will
print 1, then 2, then 3
$.sequence.runArray([1,2,3], function() { console.log(this) }, function() {
console.log(Done) }); which will do the same as above and when completely
done, print Done

The trick here, of course, is that you get looping behavior that shouldn't
lock up the browser.


--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Create text submit buttons?

2006-12-27 Thread Yehuda Katz

If you're still around, feel free to IM me at outlookeic.

-- Yehuda

On 12/27/06, Phil Oye [EMAIL PROTECTED] wrote:


Ok, now I'm perplexed.

Originally, the submit button was in a fieldset. But even when I take
it out, and make it a direct child of the form itself, I get an error
that reads:

 this.parentNode.submit is not a function.


or


 form.submit is not a function.


When I click the text link, depending on which of the many methods
I'm using.

Here's a simplified form itself:

 form action= method=post
   labelComment/label
   textarea name=comment rows=12 cols=24 /textarea
   input id=submit name=action[comment] type=submit
 value=Button text /
 /form


The action attribute is blank (I'm using the Symphony 21 CMS and this
is how the form works) so could that be causing the problem? Either
way, the form works fine without the javascript.

p.


On 28 Dec 2006, at 2:03 PM, John Resig wrote:

 Yeah, it does sound like that's the case - here's an alternate
 solution that does not assume that the form is the parent:

 $(a href='' class='button'ButtonText/a)
  .click(function() { $(this).parents(form)[0].submit(); return
 false; })
  .insertAfter('input:submit');

 --John

 On 12/27/06, Yehuda Katz [EMAIL PROTECTED] wrote:
 John's solution and mine assume that your link is a direct child
 of the
 form. Is it?

 -- Yehuda


 On 12/27/06, Phil Oye  [EMAIL PROTECTED] wrote:
 None of the proposed solutions are working for me. Now I'm wondering
 if it is a markup problem, or something.

 Bander's solution:
 I'll bet it'll work with $(this).prev().click().

 Nothing happens.
 Presumably, because it attempts to go the original href (#), not
 the newly created onclick event?


 Mike's solution:
 $(':submit').each(function() {
 var form = this.form;
 var b = $('a href=# class=buttonButton Text/a);
 $(this).after(b).hide();
 b.click(function() {
 form.submit();
 return false;
 });
 });

 In FireBug, I get:
 form.submit is not a function.
 (Also, there was a typo in the close quote on line 3)


 Yehuda's solution:
 $('[EMAIL PROTECTED]').after(a href='#'
 class='button'ButtonText/a).next().click(function()
 { this.parentNode.submit(); })

 assuming the button and link are directly under the form.

 In FireBug, I get this error:
 this.parentNode.submit is not a function.


 John's solution:
 $(a href='' class='button'ButtonText/a)
   .click(function() { this.parentNode.submit(); return false; })
   .insertAfter('input:submit');

 I get the same error:
 this.parentNode.submit is not a function
 It then refreshes the page.


 Any ideas? Markup problem?

 Thanks,
 p.


 On 28 Dec 2006, at 11:40 AM, John Resig wrote:

 Or, a similar, but different, way:

 $(a href='' class='button'ButtonText/a)
   .click(function() { this.parentNode.submit(); return false; })
   .insertAfter('input:submit');

 --John

 On 12/27/06, Yehuda Katz [EMAIL PROTECTED] wrote:
 $('[EMAIL PROTECTED]').after(a href='#'

 class='button'ButtonText/a).next().click(function() {
 this.parentNode.submit(); })

 assuming the button and link are directly under the form.

 -- Yehuda

 On 12/27/06, Mike Alsup  [EMAIL PROTECTED] wrote:
 Can you give me a pointer to fix this?

 $(':submit').each(function() {
 var form = this.form;
 var b = $('a href=# class=buttonButton Text/a);
 $(this).after(b).hide();
 b.click(function() {
 form.submit();
 return false;
 });
 });

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Trigger on-click event in first table cell

2006-12-26 Thread Yehuda Katz

$(#photographTable td:first span).click() would probably work as well, and
be faster too :)

On 12/26/06, Mungbeans [EMAIL PROTECTED] wrote:



I discovered that this:

$(#photographTable tr:eq(0) td:first-child span).click();

does work.  My problem was that I had to include it into the callback
function
attached to the ajax call that created the table.

--
View this message in context:
http://www.nabble.com/Trigger-on-click-event-in-first-table-cell-tf2884409.html#a8059175
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Trigger on-click event in first table cell

2006-12-26 Thread Yehuda Katz

That's way more complex than need be.

By definition, the first table cell of the first row is also the first cell
in the table, so $(#photographTable td:first) should be perfectly fine.
And there's no need to run an each, as click will run fine on the jQuery
object returned by the query.

$(#photographTable td:first).click(function() { // code }); should work
great.

-- Yehuda

On 12/27/06, Joan Piedra [EMAIL PROTECTED] wrote:


I think it should be something like this

$('#photographTable tr:first-child td:first-child').each(function() {
  $(this).click(function() {
//your code here
alert('woo ha!');
  });
});


On 12/26/06, Mungbeans [EMAIL PROTECTED]  wrote:


 I have this table:

 table id=photographTable
 tr
 td
 span class=small button
 onclick=showPhotograph(' http://localhost:11000/my.JPG', 1044,
 746);return
 false;Show/spantd..etc../td
 /tr
 trtd...etc/td/tr
 /table

 How do I trigger the on-click event in the first cell, first row?
 --
 View this message in context: 
http://www.nabble.com/Trigger-on-click-event-in-first-table-cell-tf2884409.html#a8058842

 Sent from the JQuery mailing list archive at Nabble.com.


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




--
Joan Piedra || Frontend webdeveloper
http://joanpiedra.com/
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] plugins page

2006-12-24 Thread Yehuda Katz

It's reverted.

-- Yehuda

On 12/24/06, Morbus Iff [EMAIL PROTECTED] wrote:


 Someone hacked it and put their website address on it. Why do people
have to be
 such jerks? So that they wouldn't get the publicity, I replaced their
site with
 a under maintenance message.

jQuery.com uses a wiki, but modifications aren't
revertable? Kinda questions the use of the term wiki.

--
Morbus Iff ( is this a cut out bath-poster Morbus, or what? )
Technical: http://www.oreillynet.com/pub/au/779
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Dev tools showdown

2006-12-23 Thread Yehuda Katz

What about Firebug lite?

On 6/26/06, Frosty Goodness [EMAIL PROTECTED] wrote:


I have the unpleasant distinction of working on a web app that only
works in IE. I can't even log into the system to test bugs becuase it pukes
at the login prompt.

Firebug, I hardly knew ye.

On 6/26/06, París Prieto, José Ignacio [EMAIL PROTECTED] wrote:

  Hi,
 I use JSEclipse for js editing (i usually do j2ee programming and prefer
 an all-in-one editor). It features code-completion and documentation.

 Firebug for js debugging, I was using Venkman's javascript debugger
 before, but this seems to be faster and simpler.

 Jose I.

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Speed Tests

2006-12-19 Thread Yehuda Katz

In the vein of the discussion we've been having on this list (and, of
course, heavily inspired by the first speed test), I've created a more
extensive speed test that tests a bunch of similar cases.

A word of warning: your browser will not be available for a good 30 seconds
or so while the test is running, but it will not lock up.

The first thing my code does is test how long it takes to run a $(.class)
query, and bases the number of attempts for each test on the speed of that
query (not a perfect system, but it should prevent crazy long loads on slow
computers.

Check the test out at:

http://yehuda.jquery.com/jq_test.html

--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Optimizing DOM Traversal

2006-12-17 Thread Yehuda Katz

It was a typo. My apologies.

A more robust solution might be to use filter:

$(.class  .otherClass tr#id td#id) into $(#id).filter(.class 
.otherClass tr#id td)

On 12/17/06, Klaus Hartl [EMAIL PROTECTED] wrote:


Felix Geisendörfer schrieb:
 Quick question:
 $(.class  .otherClass tr#id td#id) into $(#id).id(.class 
 .otherClass tr#id td)
 Does this work? Or should the function be 'is' not 'id'?

 $(.class  .otherClass tr#id td#id) into $(#id).is(.class 
 .otherClass tr#id td)

 I'm just wondering because I thought the 'id' function is used to set
 the 'id' attribute of an element.

I think that's a typo. Still it's not the same, because is() returns a
boolean.


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Optimizing DOM Traversal

2006-12-17 Thread Yehuda Katz

On 12/17/06, Karl Swedberg [EMAIL PROTECTED] wrote:


thanks, everyone, for the suggestions and questions.

regarding Yehuda's suggestion:

$(.class  .otherClass tr#id td#id) into $(#id).filter(.class 
.otherClass tr#id td)


a small clarification: If #id is an ancestor of .class, we'd probably want
to use .find() instead of .filter() . . .
  $('#id').find('.class  .otherClass tr#id td')



$('#id').find('.class  .otherClass tr#id td') would be equally optimized as
$(#id .class  .otherClass #tr#id td), so that wasn't the situation I was
talking about ;)

-- Yehuda

Also, a hat tip to Aaron Heimlich, who blogged about this issue, unbeknownst

to me at the time, before I did.
http://aheimlich.freepgs.com/javascript/jquery-selector-speed/

--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Dec 17, 2006, at 8:53 AM, Yehuda Katz wrote:

It was a typo. My apologies.

A more robust solution might be to use filter:

$(.class  .otherClass tr#id td#id) into $(#id).filter(.class 
.otherClass tr#id td)

On 12/17/06, Klaus Hartl [EMAIL PROTECTED] wrote:

 Felix Geisendörfer schrieb:
  Quick question:
  $(.class  .otherClass tr#id td#id) into $(#id).id(.class 
  .otherClass tr#id td)
  Does this work? Or should the function be 'is' not 'id'?
 
  $(.class  .otherClass tr#id td#id) into $(#id).is(.class 
  .otherClass tr#id td)
 
  I'm just wondering because I thought the 'id' function is used to set
  the 'id' attribute of an element.

 I think that's a typo. Still it's not the same, because is() returns a
 boolean.


 -- Klaus

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


  1   2   3   >