[jQuery] Re: Interface Autocompleter - Odd display

2007-04-11 Thread Ariel Jakobovits

code?

- Original Message 
From: vsanghvi [EMAIL PROTECTED]
To: jQuery (English) jquery-en@googlegroups.com
Sent: Tuesday, April 10, 2007 10:23:57 PM
Subject: [jQuery] Re: Interface Autocompleter - Odd display


I wish there was a way of editing my past posts...

So i got frustrated w/ this earlier, and decided to try it later. So i
came back, and thought, what happens if there are no other ul/ul
objects... Well, if there aren't any, it seems the autocompleter works
just fine. Once I add one in, it appears, the results have to show up
in every ul.

I didn't necessarily need the ul so I just changed them to ol, but
there's gotta be a way to fix this...

Viraj

On Apr 10, 1:19 pm, vsanghvi [EMAIL PROTECTED] wrote:
 For some reason, the result data is also being written to other
 unordered lists on my page along w/ the actual results box. Anyone
 know why this might be?

 On Apr 10, 11:55 am, vsanghvi [EMAIL PROTECTED] wrote:

  I looked around the group for something similar but couldn't find any
  issue that's similar. I'm using the Interface autocompleter, and it
  works properly and all, for some reason, the hovering effect takes
  place elsewhere on the page, and I can't figure out how to properly
  place it on the results box.

  So what happens, is that the results box shows up normally, but for
  some reason, there are two other copies of the results in the upper
  right hand and lower left hand corners of the screen. The actual
  hovering even takes place in the upper right hand part of the screen.
  I've put this on a flat page, and it works fine, but it might have
  something to do with the fact that its on a relatively positioned
  object... I'm not sure, and I couldn't hack the css in the
  iautocomplete.js script to get it to work, because I'm really not sure
  why I'm getting that effect.

  I uploaded it to the web:http://www.misfacio.com/~viraj/test/index.php
  There might be other errors because I was working on this locally and
  some references don't point where they should...

  Thanks in advance for any help!






[jQuery] Re: Interface Autocompleter - Odd display

2007-04-11 Thread vsanghvi

Lines 472-474 of iautocomplete.js:

jQuery('body', document).append('div id=autocompleteHelper
style=position: absolute; top: 0; left: 0; z-index: 30001; display:
none;ul style=margin: 0;padding: 0; list-style: none; z-index:
30002;nbsp;/ul/div');
jQuery.iAuto.helper = jQuery('#autocompleteHelper');
jQuery.iAuto.content = jQuery('ul', jQuery.iAuto.helper);

If an id was added to the ul like (autocompleteList), and then
'#autocompleteList' replaced 'ul' on line 474, then I'm pretty sure
the results would be added to the id, instead of the ul as it is now.
The only issue with my thinking is that the results should be added to
the ul *within* the #autocompleteHelper div, but for some reason,
that's not happening, at least for me. I might try this tomorrow when
I have time.

On Apr 11, 12:59 am, Ariel Jakobovits [EMAIL PROTECTED] wrote:
 code?

 - Original Message 
 From: vsanghvi [EMAIL PROTECTED]
 To: jQuery (English) jquery-en@googlegroups.com
 Sent: Tuesday, April 10, 2007 10:23:57 PM
 Subject: [jQuery] Re: Interface Autocompleter - Odd display

 I wish there was a way of editing my past posts...

 So i got frustrated w/ this earlier, and decided to try it later. So i
 came back, and thought, what happens if there are no other ul/ul
 objects... Well, if there aren't any, it seems the autocompleter works
 just fine. Once I add one in, it appears, the results have to show up
 in every ul.

 I didn't necessarily need the ul so I just changed them to ol, but
 there's gotta be a way to fix this...

 Viraj

 On Apr 10, 1:19 pm, vsanghvi [EMAIL PROTECTED] wrote:
  For some reason, the result data is also being written to other
  unordered lists on my page along w/ the actual results box. Anyone
  know why this might be?

  On Apr 10, 11:55 am, vsanghvi [EMAIL PROTECTED] wrote:

   I looked around the group for something similar but couldn't find any
   issue that's similar. I'm using the Interface autocompleter, and it
   works properly and all, for some reason, the hovering effect takes
   place elsewhere on the page, and I can't figure out how to properly
   place it on the results box.

   So what happens, is that the results box shows up normally, but for
   some reason, there are two other copies of the results in the upper
   right hand and lower left hand corners of the screen. The actual
   hovering even takes place in the upper right hand part of the screen.
   I've put this on a flat page, and it works fine, but it might have
   something to do with the fact that its on a relatively positioned
   object... I'm not sure, and I couldn't hack the css in the
   iautocomplete.js script to get it to work, because I'm really not sure
   why I'm getting that effect.

   I uploaded it to the web:http://www.misfacio.com/~viraj/test/index.php
   There might be other errors because I was working on this locally and
   some references don't point where they should...

   Thanks in advance for any help!



[jQuery] Re: How to load picture after picture

2007-04-11 Thread wyo

On Apr 10, 11:58 pm, Jonathan Sharp [EMAIL PROTECTED] wrote:
 Another approach would be to print out the images like:
 echo img align=\center\ src=\$f\ style=\display: none;\
 class=\photo\brbr;

Doesn't this load all the pictures right away? Since I expect soon a
few hundreds pictures I don't want to load all.

And what about if the hiding (display:none) was done afterwards with
Javascript? So a user with Javascript disabled would still see the
pictures (of course all).

O. Wyss



[jQuery] Re: $.ajaxSetup and timeout

2007-04-11 Thread emi polak

That solved the problem in a beautiful way! I guess it's better to rely on
plain javascript for quick solutions, where jquery documentation isn't rich
in examples and explanations yet :)
The jHeartbeat plugin you pointed me at looks interesting too, THANK YOU
Jörn!

On 4/10/07, Jörn Zaefferer [EMAIL PROTECTED] wrote:



emi polak schrieb:
 Hello,
 I want to load some html content that changes over time, so I need to
 poll the server for changes from time to time. Could anyone point me
 to an example of how to do this? The documentation I found contains no
 example... I tried the following:

 $.ajaxSetup( {
timeout: 5000
  } );
 $(document).ready( function() {
 $(#podcast_items).load(podcast_items_updater.php);
 });

 But the load does not fire again after those 5 seconds. I also tried
 including the ajaxSetup in the ready() block, and I also tried the
 deprecated (according to the manual) ajaxTimeout, but none of these
 seem to work.
The purpose of ajaxSetup is only setting global defaults for all ajax
request. The timeout option is used to cancel request after some time,
the documentation for $.ajax and $.ajaxTimeout should contain some more
information about that.

What you need is something like this:

function request() {
$(#podcast_items).load(podcast_items_updater.php);
}
setInterval(request, 5000);

If that doesn't yet do what you need: Have a look at the jHeartbeat
plugin.

--
Jörn Zaefferer

http://bassistance.de




[jQuery] Variable in selector

2007-04-11 Thread Oddish

I'm trying to hide an image, and I have the id of that image in a
variable (imgToShow). Here's what I'm trying:

$(#+imgToShow).show();

This is not working. What am I doing wrong?



[jQuery] Re: Why pack jquery ?

2007-04-11 Thread ylodi



On Apr 11, 5:14 am, Aaron Heimlich [EMAIL PROTECTED] wrote:

 Also, certain versions of IE6 have major issues with gzip-ed content (can't
 remember whether it's all gzip-ed content or just JS).


ISA (Microsoft Internet Security and Acceleration Server) 2004 has a
problem with gzip compressed files since SP2.



[jQuery] Re: Variable in selector

2007-04-11 Thread clodelio . delfino

try this:

$(function() {
$('#' + imgToShow + '').hide();
})

-Original Message-
From: andreas [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 11, 2007 3:19 PM
To: jquery-en
Cc: andreas
Subject: [jQuery] Variable in selector



I'm trying to hide an image, and I have the id of that image in a
variable (imgToShow). Here's what I'm trying:

$(#+imgToShow).show();

This is not working. What am I doing wrong?





[jQuery] åäö doesn't work with load()

2007-04-11 Thread badtant

hi!

i'm trying to use the ajax function load to load an extrernal html-
file into a div.

when i run the page i just get questionmarks where there is åäö.
anyone who knows whats wrong and what i can do about it? my pages is
ISO-8859-1.

here's the main-file that runs the ajax-script when you hover the
links:
http://www2.hemsida.net/badtant/test/test.html

and here's the file that is loaded:
http://www2.hemsida.net/badtant/test/ajax.html



[jQuery] move listbox elements : looking for somthing similar

2007-04-11 Thread amircx


im looking somthing similar
to this:
http://javascript.internet.com/forms/form-swapper-2.html

with ajax and forms plugin support, anyone has somthing like that?


-- 
View this message in context: 
http://www.nabble.com/%22move-listbox-elements%22-%3A-looking-for-somthing-similar-tf3557927s15494.html#a9935037
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: Is this a bug ?

2007-04-11 Thread Yansky

I had a play around with it and the only thing I could figure out is
that the first td tag is being stripped during the function you
mentioned - $(a).html(ah);

The only thing I can think of is that perhaps it is something to do
with the way IE handles whitespace - 
http://www.w3schools.com/dom/dom_mozilla_vs_ie.asp

I've put a copy of your test page up with firebug for IE so you can
see what I mean about the first td tag - 
http://lazydragon.dreamhosters.com/test.html

On Apr 11, 9:02 am, Fabien Meghazi [EMAIL PROTECTED] wrote:
 This page works as expected under FF but not under IE :

 http://www.amigrave.com/upload/posts/jquery/wheresthebeef.htm

 I wonder if it's a jquery bug, an IE bug with tables or a bug between
 my chair and my keyboard?

 Relevant part is line 38 :  $(a).html(ah);

 PS: I extracted the relevant code in order to make this test case, so
 it's normal if the code seems pointless.

 --
 Fabien Meghazi

 Website:http://www.amigrave.com
 Email: [EMAIL PROTECTED]
 IM: [EMAIL PROTECTED]



[jQuery] asp:Multiview and $(document).ready

2007-04-11 Thread Mariusz Cieśla

Hi,

I've got one problem regarding jQuery which is to get it working with
asp:MultiView control. As you probably know (or not), asp:MultiView is
a special control which takes care of tabbed views. My company uses a
lot of these and the problem is like that:

I have a JavaScript function for showing help-boxes to the user, which
looks like this:

$(function()
{
  $(#helpbox).hide();

  $(#helplink).click(function() {
  if (#helpbox).css('display') == 'none')
 $(#helpbox).fadeIn();
  else
 $(#helpbox).fadeOut();
  });

  $(.close).click(function() {
  if (#helpbox).css('display') == 'block')
 $(#helpbox).fadeOut();
  });
});

It works when document loads, but when I go to the other view in
MultiView and then back, the $(document).ready event isn't fired and
though -- everything dies miserably...

Any help?

Cheers,
M.



[jQuery] Re: åäö doesn't work with load ()

2007-04-11 Thread badtant

my whole site is in ISO-8859-1 and it's to much work right now to
convert to UTF-8. i think that this is something that should work
automaticly.

/N

On Apr 11, 11:04 am, Mariusz Cieśla [EMAIL PROTECTED] wrote:
 Can't you just try to use UTF-8 for the pages? Conversion isn't hard
 and still it solves most problems with special characters. ; )

 Cheers,
 M.



[jQuery] Re: Variable in selector

2007-04-11 Thread Oddish

That unfortunately hides the whole page. It goes completely blank in
both FF and IE7. :-(

On Apr 11, 9:44 am, [EMAIL PROTECTED] wrote:
 [BDY.TXT]try this:

 $(function() {
 $('#' + imgToShow + '').hide();

 })
 -Original Message-
 From: andreas [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, April 11, 2007 3:19 PM
 To: jquery-en

 Cc: andreas
 Subject: [jQuery] Variable in selector

 I'm trying to hide an image, and I have the id of that image in a
 variable (imgToShow). Here's what I'm trying:

 $(#+imgToShow).show();

 This is not working. What am I doing wrong?



[jQuery] Re: Variable in selector

2007-04-11 Thread Oddish

Don't worry about this. My original code does work, but there was a
css rule the interfeared. Thanks for the help!

On Apr 11, 12:12 pm, Oddish [EMAIL PROTECTED] wrote:
 That unfortunately hides the whole page. It goes completely blank in
 both FF and IE7. :-(

 On Apr 11, 9:44 am, [EMAIL PROTECTED] wrote:

  [BDY.TXT]try this:

  $(function() {
  $('#' + imgToShow + '').hide();

  })
  -Original Message-
  From: andreas [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, April 11, 2007 3:19 PM
  To: jquery-en

  Cc: andreas
  Subject: [jQuery] Variable in selector

  I'm trying to hide an image, and I have the id of that image in a
  variable (imgToShow). Here's what I'm trying:

  $(#+imgToShow).show();

  This is not working. What am I doing wrong?



[jQuery] Re: åäö doesn't work with load ()

2007-04-11 Thread Dmitrii 'Mamut' Dimandt
Internet Explorer works reliably only with utf-8
Even if your entire site is ISO-..., you can still use utf-8 for all
your ajax-related stuff, i think

badtant wrote:
 my whole site is in ISO-8859-1 and it's to much work right now to
 convert to UTF-8. i think that this is something that should work
 automaticly.

 /N

 On Apr 11, 11:04 am, Mariusz Cieśla [EMAIL PROTECTED] wrote:
   
 Can't you just try to use UTF-8 for the pages? Conversion isn't hard
 and still it solves most problems with special characters. ; )

 Cheers,
 M.
 


   



[jQuery] Re: Best Method to (re)bind event handlers

2007-04-11 Thread Olaf Gleba



Am 11.04.2007 um 06:39 schrieb Yansky:


There might be some info in this tutorial that could help you:
http://www.learningjquery.com/2006/09/sacrificial-lambda


Thx to all who responded to my inital post. Your comments helped a lot.

As i use anonymous function as a wrapper yet, i'll try the lambda  
approach. Seems to fit my needs.


greets
Olaf

--
Olaf Gleba : creatics media.systems
tel. +49 (0)212 38 32 94 30 : fax. +49 (0)212 38 32 94 31
[EMAIL PROTECTED] : http://www.creatics.de
http://www.creatics.de/keys/ogleba.asc






[jQuery] Re: What does this do - transport.setRequestHeader(connection, close)

2007-04-11 Thread Priest, James \(NIH/NIEHS\) [C]

 -Original Message-
 From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED] 
 
 I like this approach. Could you create an enhancement ticket 
 for this?
 
 Done!
 
 Ticket #1118 (new feature)
 
 http://dev.jquery.com/ticket/1118


Catching up on my email and just wanted to follow up on this thread -
thanks for the replies and the enhancement request.  It sound's like I'm
not going to break anything by removing that code - and hopefully the
next jQuery release will include the enhancement.

Thanks!
Jim


[jQuery] Re: Is this a bug ?

2007-04-11 Thread Fabien Meghazi



I had a play around with it and the only thing I could figure out is
that the first td tag is being stripped during the function you
mentioned - $(a).html(ah);

The only thing I can think of is that perhaps it is something to do
with the way IE handles whitespace -
I've put a copy of your test page up with firebug for IE so you can
see what I mean about the first td tag - 
http://lazydragon.dreamhosters.com/test.html


Wow !! That's strange!!! I'm not sure that it's due to whitespaces
because I tried the same test case without whitespaces in the nodes to
clone and the problem was still present. I tried to trim(), I tried to
remove all whitespaces, same problem.

The funny thing is when you play with variable ah before it's
html()ed to the element

I tried :

ah = br/' + ah;

then you get : brtd (the td is here but we can't see it)

try:

ah = nobr/ + ah;

then you get :

nobrimg ... (the td dispaeared)

And while playing with this you can observe weird stuff in FF too
(td disapearing in FF)


And when you html() the code inline there's no problem ! (even with
whitespaces) So maybe the problem is in jQuery afterall.
Eg:
console.log($(a).html('\t\t  \t  tdHello/td\t\t  ').html());


Maybe I should fill a bug so jquery devs can take a look at this.


[jQuery] Problems with $.get and parsing the results

2007-04-11 Thread Yansky

I'm having some trouble figuring out why this isn't working:

$(links).each(function(i){
$.get(i, function(data){
var trimmedToList = $(data.slice(data.indexOf('\div
id=media'),data.indexOf('\div class=description'))).html();
$('#media').append(trimmedToList);
});
});

It's supposed to retrieve the page of each link in the links array,
then parse it using slice() to return only the bit of the page I want,
then append the new content to the '#media' div.

I checked it in firebug and the variable trimmedToList is showing as
undefined. The strange thing is, if I type the code in manually into
firebug one function at a time, it works.

I thought this could be a timing issue, so I tried putting in the
opacity pause trick:

$(links).each(function(i){
$.get(i, function(data){
$('body').animate({opacity: 1.0}, 9000)
var trimmedToList = $(data.slice(data.indexOf('\div
id=media'),data.indexOf('\div class=description'))).html();
$('#media').append(trimmedToList);
});
});

but it still didn't seem to work. I just can't figure out why $
(data.slice(data.indexOf('\div id=media'),data.indexOf('\div
class=description'))).html(); isn't being assigned to the
trimmedToList variable. :(



[jQuery] Re: Is this a bug ?

2007-04-11 Thread Scott Sauyet


Fabien Meghazi wrote:

Maybe I should fill a bug so jquery devs can take a look at this.


It is a bizarre one.  My little brain can't see anything to cause this; 
maybe some of the experts can.  Perhaps more demos are in order, but I'm 
not sure what more to even try.


Good luck,

  -- Scott



[jQuery] Re: Problems with $.get and parsing the results

2007-04-11 Thread Scott Sauyet


Yansky wrote:

I'm having some trouble figuring out why this isn't working:

$(links).each(function(i){
$.get(i, function(data){
var trimmedToList = $(data.slice(data.indexOf('\div
id=media'),data.indexOf('\div class=description'))).html();
$('#media').append(trimmedToList);
});
});


The i in this

$(something).each(function(i) {//...
});

is the (zero-bassed) numerical index of the item in the list.

You are passing that as the first parameter of the  $.get function, 
which is expecting a URL.  Perhaps you need to pass something like 
this.href instead?


Cheers,

  -- Scott



[jQuery] Re: Trying to figure out how to use this custom validation...

2007-04-11 Thread Aaron Heimlich

You should have it the way it was. parseInt tries to convert what's left
after stripping all of the ($), (.), and (,), into an integer. If it fails,
it will return NaN (Not a Number).

On 4/10/07, Rick Faircloth [EMAIL PROTECTED] wrote:



Well, it looks like I'm making progress...

I needed to change

if ( isNaN ( parseInt ( value.replace ( /[\$\,\.]/,  

to

if ( isNaN ( value.replace ( /[\$\,\.]/,  )))

because I don't want to parse what's left.  If there's anything
besides digits, dollar signs, commas, and periods in the input,
I want an error to be thrown.

However, the problem I have now is the variations on the input
that should pass validation...

Here are some examples:

$255900 passes as a valid entry.
$255,900does not pass and I want it to.
$255,900.   does not pass and I want it to.
$255,900.00 does not pass and I want it to.

But why?

The statement if ( isNaN ( value.replace (/[\$\,\.]/,  )))
is stating that if all dollar signs, commas, and periods are taken out
of the input entry, and the input is not a number... right?

Rick



-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Jörn Zaefferer
Sent: Tuesday, April 10, 2007 5:41 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Trying to figure out how to use this custom
validation...


Dan G. Switzer, II schrieb:
 Rick,


 Here's the addMethod line:

  $.validator.addMethod(superCoolValidator, superCoolValidator,
 Your input is not super cool!);

  rules: {

  //Principal: {required: true,
   //digits: true},
  Interest: {required: true,
  number: true},
  Years: {required: true,
   number: true}
  },


 I haven't messed with the custom validators in Jörn's code, but looking
 through the code, you'll need to assign a rule for the validator:

   rules: {

   Principal: {required: true,
superCoolValidator: true,
digits: true},
   Interest: {required: true,
   number: true},
   Years: {required: true,
number: true}
   },

Good job Dan, didn't notice that.

Rick: When you specify rules via plugin options, metadata is ignored. I
thought I documented that somewhere... Gonna fix that.

--
Jörn Zaefferer

http://bassistance.de







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


[jQuery] Re: Is this a bug ?

2007-04-11 Thread Fabien Meghazi


Now I'm thinking ... Is there still some people using Internet Explorer ? ;-)

On 4/11/07, Scott Sauyet [EMAIL PROTECTED] wrote:


Fabien Meghazi wrote:
 Maybe I should fill a bug so jquery devs can take a look at this.

It is a bizarre one.  My little brain can't see anything to cause this;
maybe some of the experts can.  Perhaps more demos are in order, but I'm
not sure what more to even try.

Good luck,

   -- Scott





--
Fabien Meghazi

Website: http://www.amigrave.com
Email: [EMAIL PROTECTED]
IM: [EMAIL PROTECTED]


[jQuery] jQuery tutorial on IBM DeveloperWorks

2007-04-11 Thread Jesse Skinner


I wrote a jQuery tutorial for IBM DeveloperWorks which went live today:

http://www.ibm.com/developerworks/library/x-ajaxjquery.html

Cheers,

Jesse Skinner
www.thefutureoftheweb.com


[jQuery] Re: jQuery tutorial on IBM DeveloperWorks

2007-04-11 Thread Brandon Aaron


Very cool. Thanks for sharing.

In your code examples for creating HTML you can write it a couple of
other way as well (which you probably already know and just wanted to
show the html method ... but I'll show anyways).

You have:
$('p/p')
   .html('Hey World!')
   .css('background', 'yellow')
   .appendTo(body);

You could do it like this:
$('p')
   .html('Hey World!')
   .css('background', 'yellow')
   .appendTo(body);

You could also do it like this:
$('pHey World!/p')
   .css('background', 'yellow')
   .appendTo(body);


Great tutorial.

--
Brandon Aaron


On 4/11/07, Jesse Skinner [EMAIL PROTECTED] wrote:


I wrote a jQuery tutorial for IBM DeveloperWorks which went live today:

http://www.ibm.com/developerworks/library/x-ajaxjquery.html

Cheers,

Jesse Skinner
www.thefutureoftheweb.com



[jQuery] How do you write custom callback functions in jQuery?

2007-04-11 Thread real

I'm pretty sure this is possible, but I couldn't seem to put my finger
on how to do it properly. What I'm looking to do is create either
functions or jQuery methods with a custom callback functionality, that
would work in the same way as the built-in callbacks for fadeIn,
slideDown, etc.

For example:

$.fn.testFunc = function(param, callback){
//do something that delays, like a fadeIn (just using the fadeIn as an
example, but since the fadeIn already has callback functionality, it's
not an ideal choice, but I hope you get my point)
callback();
}

So that this could be called like so, and the callback would execute
after the rest of the code was finished

$(obj).testFunc(param, function(){
//do some more stuff
}

I've tried tinkering with the $.fn.queue method but I was unable to
get it to work for me.

Any ideas?

Thanks.



[jQuery] Re: new plugin - columnManager

2007-04-11 Thread Fabien Meghazi



Well, for example...I've a table that is showing a lot of userdata
(phone numbers, locations, birth dates and some other stuff). Some of
the users don't want to see all the informations for whatever reasons,
so I let them decide what they'll get to see. I'm using it with the
popup window shown in the second table on the demo page.


Roman,

Along with saveState, an option to specify a custom function callback
to be called when the user toggled a column would be handy if we want
to customize the way columns preferences should be managed (eg:
session or db) so we can have total control of columns preferences
management.

Good job!

--
Fabien Meghazi

Website: http://www.amigrave.com
Email: [EMAIL PROTECTED]
IM: [EMAIL PROTECTED]


[jQuery] Re: Trying to figure out how to use this custom validation...

2007-04-11 Thread Rick Faircloth
Actually, I didn’t want what’s left after stripping all of the ($), (.), and
(,).
I wanted an error to be thrown.
 
However, that approach was taken when I was attempting to use ColdFusion
to do the parsing.  I wasn’t able to get that working for now, so I decided
to go
with client-side validation only using the functions of Javascript and
Jorn’s Validation
plug-in.
 
I decided it would be preferable to require digits only since ColdFusion and
Javascript
won’t validate a dollar amount in the same manner.
 
Rick
 
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Aaron Heimlich
Sent: Wednesday, April 11, 2007 10:01 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Trying to figure out how to use this custom
validation...
 
You should have it the way it was. parseInt tries to convert what's left
after stripping all of the ($), (.), and (,), into an integer. If it fails,
it will return NaN (Not a Number).
On 4/10/07, Rick Faircloth [EMAIL PROTECTED] wrote:

Well, it looks like I'm making progress...

I needed to change

if ( isNaN ( parseInt ( value.replace ( /[\$\,\.]/,  

to

if ( isNaN ( value.replace ( /[\$\,\.]/,  ))) 

because I don't want to parse what's left.  If there's anything
besides digits, dollar signs, commas, and periods in the input,
I want an error to be thrown.

However, the problem I have now is the variations on the input 
that should pass validation...

Here are some examples:

$255900 passes as a valid entry.
$255,900does not pass and I want it to.
$255,900.   does not pass and I want it to.
$255,900.00  does not pass and I want it to.

But why?

The statement if ( isNaN ( value.replace (/[\$\,\.]/,  )))
is stating that if all dollar signs, commas, and periods are taken out
of the input entry, and the input is not a number... right? 

Rick



-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery-en@googlegroups.com ] On
Behalf Of Jörn Zaefferer
Sent: Tuesday, April 10, 2007 5:41 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Trying to figure out how to use this custom 
validation...


Dan G. Switzer, II schrieb:
 Rick,


 Here's the addMethod line:

  $.validator.addMethod(superCoolValidator, superCoolValidator, 
 Your input is not super cool!);

  rules: {

  //Principal: {required: true,
   //digits: true},
  Interest: {required: true, 
  number: true},
  Years: {required: true,
   number: true}
  },


 I haven't messed with the custom validators in Jörn's code, but looking 
 through the code, you'll need to assign a rule for the validator:

   rules: {

   Principal: {required: true,
superCoolValidator: true,
digits: true},
   Interest: {required: true,
   number: true},
   Years: {required: true,
number: true}
   }, 

Good job Dan, didn't notice that.

Rick: When you specify rules via plugin options, metadata is ignored. I
thought I documented that somewhere... Gonna fix that.

--
Jörn Zaefferer

http://bassistance.de






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


[jQuery] Re: åäö doesn't work with load()

2007-04-11 Thread Ⓙⓐⓚⓔ

I see no content type in either header! You are at the mercy of the browser
to guess what to do with the high ascii characters.


head http://www2.hemsida.net/badtant/test/ajax.html

200 OK
Connection: close
Date: Wed, 11 Apr 2007 17:50:32 GMT
Accept-Ranges: bytes
ETag: ad6874f127cc71:9b2
Server: Microsoft-IIS/5.0
Content-Length: 76
Content-Type: text/html
Last-Modified: Wed, 11 Apr 2007 08:20:48 GMT
Client-Date: Wed, 11 Apr 2007 17:36:29 GMT
Client-Peer: 212.37.5.72:80
Client-Response-Num: 1
X-Powered-By: ASP.NET


head http://www2.hemsida.net/badtant/test/test.html

200 OK
Connection: close
Date: Wed, 11 Apr 2007 17:51:22 GMT
Accept-Ranges: bytes
ETag: f636a94f127cc71:9b2
Server: Microsoft-IIS/5.0
Content-Length: 1509
Content-Type: text/html
Last-Modified: Wed, 11 Apr 2007 08:20:49 GMT
Client-Date: Wed, 11 Apr 2007 17:37:19 GMT
Client-Peer: 212.37.5.72:80
Client-Response-Num: 1
X-Powered-By: ASP.NET


On 4/11/07, badtant [EMAIL PROTECTED] wrote:



hi!

i'm trying to use the ajax function load to load an extrernal html-
file into a div.

when i run the page i just get questionmarks where there is åäö.
anyone who knows whats wrong and what i can do about it? my pages is
ISO-8859-1.

here's the main-file that runs the ajax-script when you hover the
links:
http://www2.hemsida.net/badtant/test/test.html

and here's the file that is loaded:
http://www2.hemsida.net/badtant/test/ajax.html





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ


[jQuery] Re: new plugin - columnManager

2007-04-11 Thread Roman Weich


Fabien Meghazi schrieb:

Along with saveState, an option to specify a custom function callback
to be called when the user toggled a column would be handy if we want
to customize the way columns preferences should be managed (eg:
session or db) so we can have total control of columns preferences
management.

Good job!


Thanks Fabien,

that's a good idea, i've added an option for this.

Cheers,
/rw


[jQuery] Re: How do you write custom callback functions in jQuery?

2007-04-11 Thread real

Not quite, I don't necessarily want a delay in a set amount of time, I
was looking to execute the second function after the first one has
completed. For animations and AJAX calls, jQuery already handles that,
but I wanted to integrate a callback functionality in my own custom
methods.

Thanks for the help though! =)

On Apr 11, 2:27 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
 Jörn Zaefferer schrieb:

  $.fn.delayHide(time, callbackArgument) {
  var self = this;
  setTimeout(function() {
  callbackArgument.call(self);
  }, time);
  }
  $(input).delay(3000, function() {
  this.hide();
  });

  That should delay hiding an element by three seconds, using a callback.
  Does that example help?

 I think you wanted to write this:

 jQuery.fn.delay = function(time, callback) {
  var self = this;
  setTimeout(function() {
  callback.call(self);
  }, time);

 };

 Nice! Where do useful micro plugins go?

 -- Klaus



[jQuery] Determine if a table cell is visible or not?

2007-04-11 Thread Matt Kruse

I'd like to find out if a table cell is actually visible or not. Is
there a method in any plugin that will do this work for me?

The complexity is that any element in the cell's parent chain may be
display:none, in which case it would be hidden. But the cell's
corresponding col or colgroup tag may also be display:none which
would cause it to be hidden as well, and those tags are not parents of
the cell itself. Checking the cell's current 'display' value will of
course get me nowhere.

I've begun writing logic to handle this case, but it would be great if
someone has already done it!

Matt Kruse



[jQuery] Re: combing classes ?

2007-04-11 Thread real

Yes, I'm pretty sure you can.

On Apr 11, 2:36 pm, Frans H. [EMAIL PROTECTED] wrote:
 Jquery is really amazing! I am so glad I was introduced to it.

 Is there a way to combine features from multiple plugins ? I'd  love a
 sortable, scrollable table with key navigation :)

 I'd really love to use all that jquery coolness you guys have created!



[jQuery] Re: Determine if a table cell is visible or not?

2007-04-11 Thread real

This should work for you:

if ( $('td').is(':visible') ) { // the rest of your code }

On Apr 11, 2:32 pm, Matt Kruse [EMAIL PROTECTED] wrote:
 I'd like to find out if a table cell is actually visible or not. Is
 there a method in any plugin that will do this work for me?

 The complexity is that any element in the cell's parent chain may be
 display:none, in which case it would be hidden. But the cell's
 corresponding col or colgroup tag may also be display:none which
 would cause it to be hidden as well, and those tags are not parents of
 the cell itself. Checking the cell's current 'display' value will of
 course get me nowhere.

 I've begun writing logic to handle this case, but it would be great if
 someone has already done it!

 Matt Kruse



[jQuery] Re: Trying to figure out how to use this custom validation...

2007-04-11 Thread Aaron Heimlich

Validate however you want, but NEVER rely on JavaScript to do all of your
validation because you cannot rely on it always being available[1]. Always
validate on the server (no malicious hacker can bypass that), and use
JavaScript to enhance the user experience of filling out your forms (and
decrease server load).

If there's anything besides digits, dollar signs, commas, and periods in the

input,
I want an error to be thrown.



This should give you what you're after:

function superCoolValidator(value, element, params) {
   if(/[^0-9\$\.,]/g.test(value)) {
   // value contains something that is neither a digit, ($), (.), or
(,)
   return false;
   } else {
   return true;
   }
}

If you want to restrict input to only digits, then Jorn's Validator already
has a rule that you can use: digits

P.S. I hate to be petty, but superCoolValidator was my name, not Dan's

[1]
http://www.456bereastreet.com/archive/200612/you_cannot_rely_on_javascript_being_available_period/

On 4/11/07, Rick Faircloth [EMAIL PROTECTED] wrote:


 Actually, I didn't want what's left after stripping all of the ($), (.),
and (,).

I wanted an error to be thrown.



However, that approach was taken when I was attempting to use ColdFusion

to do the parsing.� I wasn't able to get that working for now, so I
decided to go

with client-side validation only using the functions of Javascript and
Jorn's Validation

plug-in.



I decided it would be preferable to require digits only since ColdFusion
and Javascript

won't validate a dollar amount in the same manner.



Rick



*From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On
Behalf Of *Aaron Heimlich
*Sent:* Wednesday, April 11, 2007 10:01 AM
*To:* jquery-en@googlegroups.com
*Subject:* [jQuery] Re: Trying to figure out how to use this custom
validation...



You should have it the way it was. parseInt tries to convert what's left
after stripping all of the ($), (.), and (,), into an integer. If it fails,
it will return NaN (Not a Number).

On 4/10/07, *Rick Faircloth* [EMAIL PROTECTED] wrote:


Well, it looks like I'm making progress...

I needed to change

if ( isNaN ( parseInt ( value.replace ( /[\$\,\.]/,  

to

if ( isNaN ( value.replace ( /[\$\,\.]/,  )))

because I don't want to parse what's left.  If there's anything
besides digits, dollar signs, commas, and periods in the input,
I want an error to be thrown.

However, the problem I have now is the variations on the input
that should pass validation...

Here are some examples:

$255900 passes as a valid entry.
$255,900does not pass and I want it to.
$255,900.   does not pass and I want it to.
$255,900.00  does not pass and I want it to.

But why?

The statement if ( isNaN ( value.replace (/[\$\,\.]/,  )))
is stating that if all dollar signs, commas, and periods are taken out
of the input entry, and the input is not a number... right?

Rick



-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery-en@googlegroups.com ] On
Behalf Of J�rn Zaefferer
Sent: Tuesday, April 10, 2007 5:41 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Trying to figure out how to use this custom
validation...


Dan G. Switzer, II schrieb:
 Rick,


 Here's the addMethod line:

  $.validator.addMethod(superCoolValidator, superCoolValidator,
 Your input is not super cool!);

  rules: {

  //Principal: {required: true,
   //digits: true},
  Interest: {required: true,
  number: true},
  Years: {required: true,
   number: true}
  },


 I haven't messed with the custom validators in J�rn's code, but looking
 through the code, you'll need to assign a rule for the validator:

   rules: {

   Principal: {required: true,
superCoolValidator: true,
digits: true},
   Interest: {required: true,
   number: true},
   Years: {required: true,
number: true}
   },

Good job Dan, didn't notice that.

Rick: When you specify rules via plugin options, metadata is ignored. I
thought I documented that somewhere... Gonna fix that.

--
J�rn Zaefferer

http://bassistance.de





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





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


[jQuery] Re: Determine if a table cell is visible or not?

2007-04-11 Thread Klaus Hartl


real schrieb:

This should work for you:

if ( $('td').is(':visible') ) { // the rest of your code }


That won't work (for any element) if display: none has been declared 
for an ancestor element. Or in this special case the col which the td 
belongs to (which is not exactly an ancestor).


This is a known issue, but solving it is too expensive (it would require 
to traverse up and check visibility for each element until a hidden one 
is found), thus it was never added to jQuery.




-- Klaus


[jQuery] Re: Determine if a table cell is visible or not?

2007-04-11 Thread real

Oh... oops sorry about that! lol

On Apr 11, 2:48 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
 real schrieb:

  This should work for you:

  if ( $('td').is(':visible') ) { // the rest of your code }

 That won't work (for any element) if display: none has been declared
 for an ancestor element. Or in this special case the col which the td
 belongs to (which is not exactly an ancestor).

 This is a known issue, but solving it is too expensive (it would require
 to traverse up and check visibility for each element until a hidden one
 is found), thus it was never added to jQuery.

 -- Klaus



[jQuery] Re: Determine if a table cell is visible or not?

2007-04-11 Thread Brandon Aaron


I have not seen a plugin that contains such logic especially when
dealing with the col and colgroup tags. Of course if you could avoid
having the col and colgroup tags hidden you could use something like
this (untested and off the top of my head).

var visible = !!($('#myCell').parents().filter(':hidden').size == 0);

I guess you could also use the same kind of logic to filter out any
hidden col/colgroup tags and if one or more is hidden check their
attributes against the td.

--
Brandon Aaron

On 4/11/07, Matt Kruse [EMAIL PROTECTED] wrote:


I'd like to find out if a table cell is actually visible or not. Is
there a method in any plugin that will do this work for me?

The complexity is that any element in the cell's parent chain may be
display:none, in which case it would be hidden. But the cell's
corresponding col or colgroup tag may also be display:none which
would cause it to be hidden as well, and those tags are not parents of
the cell itself. Checking the cell's current 'display' value will of
course get me nowhere.

I've begun writing logic to handle this case, but it would be great if
someone has already done it!

Matt Kruse




[jQuery] Re: Determine if a table cell is visible or not?

2007-04-11 Thread Glen Lipka

On 4/11/07, real [EMAIL PROTECTED] wrote:



Oh... oops sorry about that! lol

On Apr 11, 2:48 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
 real schrieb:

  This should work for you:

  if ( $('td').is(':visible') ) { // the rest of your code }

 That won't work (for any element) if display: none has been declared
 for an ancestor element. Or in this special case the col which the td
 belongs to (which is not exactly an ancestor).

 This is a known issue, but solving it is too expensive (it would require
 to traverse up and check visibility for each element until a hidden one
 is found), thus it was never added to jQuery.

 -- Klaus



col style=display:none doesn't seem to work in FF.
Is there a FF equivelent?

I know in previous posts, the nth-child selector was used to get certain
columns and hide them.
Pro: Easier to tell what is hidden.  Con:  Possible performance hit for
large grids.

Glen


[jQuery] Re: How do you write custom callback functions in jQuery?

2007-04-11 Thread Jörn Zaefferer


real schrieb:

Not quite, I don't necessarily want a delay in a set amount of time, I
was looking to execute the second function after the first one has
completed. For animations and AJAX calls, jQuery already handles that,
but I wanted to integrate a callback functionality in my own custom
methods.
  
The delay is just one example of using callbacks. The basic principle is 
always the same: Pass in a function reference and call that later.


In case you are looking for a way to queue callbacks and automatically 
call one after the other: jQuery' testsuite[1] contains some code that 
could give you a good piece to start. I wrote that queuing stuff, let me 
know if you need any help with that.


The intersting methods are synchronize() and process(). stop() and 
start() is important to run asynchronous tests.


var _config = {
queue: [],
blocking: true,
timeout: null,
asyncTimeout: 2 // seconds for async timeout
};

function synchronize(callback) {
_config.queue[_config.queue.length] = callback;
if(!_config.blocking) {
process();
}
}

function process() {
while(_config.queue.length  !_config.blocking) {
var call = _config.queue[0];
_config.queue = _config.queue.slice(1);
call();
}
}

function stop(allowFailure) {
_config.blocking = true;
var handler = allowFailure ? start : function() {
ok( false, Test timed out );
start();
};
_config.timeout = setTimeout(handler, _config.asyncTimeout * 1000);
}
function start() {
if(_config.timeout)
clearTimeout(_config.timeout);
_config.blocking = false;
process();
}

You add callbacks by passing them to synchronize().

[1] http://dev.jquery.com/browser/trunk/jquery/build/test/data/testrunner.js

--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: How do you write custom callback functions in jQuery?

2007-04-11 Thread Jörn Zaefferer


Klaus Hartl schrieb:

I think you wanted to write this:

jQuery.fn.delay = function(time, callback) {
var self = this;
setTimeout(function() {
callback.call(self);
}, time);
};

Thanks Klaus. I shouldn't write code in my email client...

Nice! Where do useful micro plugins go?
Once upon a time there was a util folder in the plugins repository. 
But that didn't quite work out.


--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: combing classes ?

2007-04-11 Thread Jörn Zaefferer


Frans H. schrieb:

Jquery is really amazing! I am so glad I was introduced to it.

Is there a way to combine features from multiple plugins ? I'd  love a
sortable, scrollable table with key navigation :)
  
Combining plugins can be tricky. So far I haven't seen a good working 
solution of a client sortable, pageable and searchable table. Christian 
did some great work, but didn't quite finish it (there always other work 
besides jQuery) and Matt Kruse has something in the works, too, though 
so far that was announced as jQuery-independent, dunno if that matters 
for you.


On the other, combining plugins that don't effect each other work 
perfect together. Like combining form plugin with validation, datepicker 
and masked input.


--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: How do you write custom callback functions in jQuery?

2007-04-11 Thread Aaron Heimlich

On 4/11/07, Klaus Hartl [EMAIL PROTECTED] wrote:


Nice! Where do useful micro plugins go?



The cookbook[1] perhaps?

[1] http://docs.jquery.com/Cookbook (I do remember there being a lot more
here, though, when we had the old wiki)

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


[jQuery] Autocomplte plugin status

2007-04-11 Thread Jörn Zaefferer


Hi folks,

I've achieved some progress on the autocomplte plugin. The features 
added by Dan Switzer to Dylan's initial plugin are now merged with 
modifications for completing multiple values, like in the gmail 
recpient-field.


I made some minor API changes, changed a lot of default values to 
provide nice behaviour without specifying any options and refactored 
quite a lot of code to be able to fix the bugs I most likely introduced. 
I switched to event delegation for the select box, possibly improving 
performance a bit. Though Dylan's and Dan's caching code is already 
providing fast-as-hell autocompletition.


There is one major issue I want to solve before publishing a first 
release of that rewrite. Until then the code can be found in jQuery's 
repository[1], if anyone is interested in testing: You're welcome!


[1] svn://jquery.com/trunk/plugins/autocomplete

--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: How to load picture after picture

2007-04-11 Thread Jonathan Sharp

On 4/11/07, wyo [EMAIL PROTECTED] wrote:



On Apr 10, 11:58 pm, Jonathan Sharp [EMAIL PROTECTED] wrote:
 Another approach would be to print out the images like:
 echo img align=\center\ src=\$f\ style=\display: none;\
 class=\photo\brbr;

Doesn't this load all the pictures right away? Since I expect soon a
few hundreds pictures I don't want to load all.



Yes, that is true, but they'll load in the order in which they appear in the
document so it will in effect be a preload for future images.


And what about if the hiding (display:none) was done afterwards with

Javascript? So a user with Javascript disabled would still see the
pictures (of course all).



You could do that too... here's another option:

echo img align=\center\ src=\$f\ class=\photo\brbr;

Then the following jQuery code:
$(function(){
  $('img.photo').each(hidePhoto);

  function showPhoto() {
 this.src = this.$src;
 $(this).show();
  }
  function hidePhoto() {
 $(this).hide();
 this.$src = this.src;
 this.src = '';
  }

   $('img.next').bind('click', function() {
   $('img.photo:visible').each(hidePhoto).next().is('img.photo
').each(showPhoto);
   });
   $('img.prev).bind('click', function() { $('img.photo:visible'
).each(hidePhoto).prev().is('img.photo').each(showPhoto);
   });
});

Here's another slightly modified version that handles the image loading
issue as well as non-js.

-js


[jQuery] Re: Autocomplte plugin status

2007-04-11 Thread Dan G. Switzer, II

Jörn,

I've achieved some progress on the autocomplte plugin. The features
added by Dan Switzer to Dylan's initial plugin are now merged with
modifications for completing multiple values, like in the gmail
recpient-field.

I made some minor API changes, changed a lot of default values to
provide nice behaviour without specifying any options and refactored
quite a lot of code to be able to fix the bugs I most likely introduced.
I switched to event delegation for the select box, possibly improving
performance a bit. Though Dylan's and Dan's caching code is already
providing fast-as-hell autocompletition.

There is one major issue I want to solve before publishing a first
release of that rewrite. Until then the code can be found in jQuery's
repository[1], if anyone is interested in testing: You're welcome!

One issue I noticed by looking at the code is that the findValue() won't
work with multi-selects. I actually started adding the code and removed it,
because I realized this would be tricky w/the current code structure.

The findValue() callback should probably return an array of all the matches
found. 

-Dan



[jQuery] i fond some error in jquery.com

2007-04-11 Thread LOVEYANG

hi,everyone
  well,i found some error on it. in http://docs.jquery.com/Events
Before:
 pHello/p
Result:
 p onchange=alert('Hello');Hello/p

whypis  not input.but it  can change something .can you talk me
some?thank you.



[jQuery] Re: Autocomplte plugin status

2007-04-11 Thread Klaus Hartl


Jörn Zaefferer schrieb:


Hi folks,

I've achieved some progress on the autocomplte plugin. The features 
added by Dan Switzer to Dylan's initial plugin are now merged with 
modifications for completing multiple values, like in the gmail 
recpient-field.


I made some minor API changes, changed a lot of default values to 
provide nice behaviour without specifying any options and refactored 
quite a lot of code to be able to fix the bugs I most likely introduced. 
I switched to event delegation for the select box, possibly improving 
performance a bit. Though Dylan's and Dan's caching code is already 
providing fast-as-hell autocompletition.


There is one major issue I want to solve before publishing a first 
release of that rewrite. Until then the code can be found in jQuery's 
repository[1], if anyone is interested in testing: You're welcome!


[1] svn://jquery.com/trunk/plugins/autocomplete



Jörn, thanks for this. One question: I once modified Dylan's 
autocomplete a bit, so that if the autocomplete list is shown, tabbing 
would tab through the list instead of to the next form element. Is it 
possible to take into account?


Have a look here: http://plazes.com/plazes and type something into the 
Where field.


I think I also modified the behavior for arrow up/down keys a bit...


-- Klaus


[jQuery] Interface updates

2007-04-11 Thread Kush Murod


Hi,

Just wondering as to when Interface updates/fixes are going to be released.
I do release guys could  be very busy,  but little heads up would be 
appreciated.


--Kush