Re: [jQuery] make a div disappear after 2seconds?

2007-01-23 Thread Dossy Shiobara
ronaldo wrote:
>
> should be a simple question but its been doing my heading for 1 day now!!
> how can i make a div disappear after 2 seconds ?

Why not just:

setTimeout(function() { $(div).hide() }, 2000);

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

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


Re: [jQuery] jQuery in server side language?

2007-02-24 Thread Dossy Shiobara
On 2007.02.24, howard chen <[EMAIL PROTECTED]> wrote:
> Anyone think that it would be great to use jQuery in server side?
> 
> such as grab html from remote server, and process the html elements
> using jQuery,
> 
> any idea?

It's my current goal with AOLserver's nsjsapi module, to get it to the
point where I can use jQuery server-side in AOLserver.

So, there's at least one person who thinks it would be great.  :-)

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

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


Re: [jQuery] Google group email problem

2007-03-23 Thread Dossy Shiobara
On 2007.03.23, Janet Weber <[EMAIL PROTECTED]> wrote:
> I joined the group but I can't set the email option for indivdual 
> emails. Does anyone else have this problem?

I have the same problem--I thought it was just me.  Glad to hear I'm not
the only one.

Is this a problem with the group's settings ... or something else?

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

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


[jQuery] In-situ editing (Editable, etc.) disturbs layout

2006-08-14 Thread Dossy Shiobara
Hi,

I'm trying to use jQuery and the Editable plugin to implement in-situ
editing (ala Flickr) and it disturbs the layout, which I don't quite
understand.

I have something like this:


Some label: Some text
... some other text.


I set up the span as editable:

$(document).ready(function() {
$("#editme").editable("foo.adp");
});

On load, it renders like this:

Some label: some text ... some other text.

Once I click to edit, it renders like this:

Some label: [Some text.]
... some other text.

Once I submit, it renders like this:

Some label: Some text.
... some other text.

What gives?  The span is "display: inline" so once submitted, it should
render as it did originally, all on the same line.  It looks as though
the span is getting changed to "display: block" and/or a  is being
inserted, or something.

Aha ... Editable creates a new  ... which IIRC is "display: block"
... and Editable doesn't cleanup/destroy the  on submit/reset.

The short-term work-around I found to this is to add this to my CSS:

#editme form { display: inline; }

But, this isn't the whole solution.  Since Editable seems to repeatedly
create these DOM objects but never clean then up ... this would be a
source for a memory-leak in a long-lived web application, no?

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

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


Re: [jQuery] Naming plugin files

2006-08-15 Thread Dossy Shiobara
On 2006.08.15, Dylan Verheul <[EMAIL PROTECTED]> wrote:
> They don't line up nicely with jquery.js :-)
> 
> On 8/15/06, Dimitar Spassov <[EMAIL PROTECTED]> wrote:
> > What about these names:
> >
> > > So editable would be in jquery.editable.js, DOM would be in jquery.dom.js.
> > jq.editable.js, DOM would be in jq.dom.js.

I've named mine "jquery-editable.js" ... FWIW.

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

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


Re: [jQuery] In-situ editing (Editable, etc.) disturbs layout

2006-08-15 Thread Dossy Shiobara
On 2006.08.15, Jonathan Sharp <[EMAIL PROTECTED]> wrote:
> >I'll look into the memory leakage part, but I've never really noticed it
> >myself.
> 
> I doubt it would be a memory leak since the form is part of the dom. All it
> does is leave around some extra elements. In short it should clean up what
> it alters.

Yes, but every time the click handler is fired, it creates a new "form"
and "input" node ... and never removes them.  Imagine a web application
where the page is long-living (which is reasonable given AJAX).  What
will happen to the DOM tree?  It'll continue to accumulate "form" and
"input" nodes each time the click handler is fired.

Or, am I missing something here?  Do the form/input nodes get removed
and I just can't tell?  If so: why does the edited element stay rendered
the way it is?  From my empirical tests, it seems that the "form" node
continues to exist after the submit/reset of the in-situ editing is
performed.

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

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


[jQuery] filter() on attributes?

2006-09-05 Thread Dossy Shiobara
Hi,

I don't want to assign an id attribute to all my  fields, but
instead want to do something like this:


  


Then, get the value with something like:

$("#foo input[name=bar]").val();

That didn't work.  So, I tried:

$("#foo input").filter("[name=bar]").val();

That didn't work either.  I'm thinking I might have to use $.grep() but
I can't seem to get it to work:

$.grep($("#foo input"), function(a, i) { return (a[i].attr("name") == 
"bar"); })[0].val();

That one causes a JS error complaining that "a[i] has no properties."

The filter() docs say I should be able to use an XPath expression ...
so, this should work:

$("#foo input").filter("/[name=bar]").val();

Aha!  It does.  Is this the best way of doing this?  Are there any
pitfalls I need to worry about?  Can I collapse this into a more concise
form?

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

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


Re: [jQuery] filter() on attributes?

2006-09-05 Thread Dossy Shiobara
On 2006.09.05, Sam Collett <[EMAIL PROTECTED]> wrote:
> On 05/09/06, Dossy Shiobara <[EMAIL PROTECTED]> wrote:
> >
> > $("#foo input").filter("/[name=bar]").val();
> 
> I use:
> $("#foo [EMAIL PROTECTED]").val();
> 
> i.e. put @ before the attribute you want.

*facepalm*  Ah, yes.  Duh.  Thanks!

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

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


[jQuery] Client-side query term highlighting demo using jQuery

2006-09-11 Thread Dossy Shiobara
Client-side query term highlighting demo using jQuery
http://dossy.org/referer-demo.html

Here's a quick client-side query term highlighting demo that uses jQuery
to parse the document.referrer and walks the DOM to highlight text by
wrapping it in a  with the class "qterm".

Thanks, John, for pointing out that I can recursively walk the DOM with
$("body *") ... that hit the spot.

Here's the code:


.qterm { color: #444; background-color: #ee9; font-weight: bold; }
a span.qterm { color: #00f; text-decoration: underline; }
a:hover span.qterm { color: #666; }



$(document).ready(function() {
  if (!document.referrer) return;
  var matches = document.referrer.match(/[?&]q=([^&]*)/);
  if (!matches) return;
  var terms = unescape(matches[1].replace(/\+/g, ' '));
  var re = new RegExp().compile('(' + terms + ')', 'i');
  $("body *").each(function() {
if ($(this).children().size() > 0) return;
if ($(this).is("xmp, pre")) return;
var html = $(this).html();
var newhtml = html.replace(re, '<span class="qterm">$1</span>');
$(this).html(newhtml);
  });
});


Naturally, my parsing of document.referrer is *very* naive.  Naturally,
adding the appropriate expressions to match more than just Google (or
any search engine that uses the "q=terms" form) is probably necessary.

I leave that up to you folks to help fill that part in.  :-)

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

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


Re: [jQuery] Client-side query term highlighting demo using jQuery

2006-09-11 Thread Dossy Shiobara
On 2006.09.11, Matt Stith <[EMAIL PROTECTED]> wrote:
> Great job! Personally, i would check if document.location has a 'q'
> set, and if not, use the referrer, That would make it a little more
> usable.

More usable how?  The idea behind this code snippet is to highlight
search query terms on click-through from a SERP.  The SERP's URL is
what we have in document.referrer, not document.location.

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

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


Re: [jQuery] inside A

2006-09-12 Thread Dossy Shiobara
On 2006.09.12, Stamen Georgiev <[EMAIL PROTECTED]> wrote:
> Forgive me my stupid question... but is there an easy way to turn this:
> 
> some text
> 
> into this:
> 
> some text
> 
> It's some kind of wrap... but from the inside :-)

I'm assuming you want to inject the div for a reason OTHER than to add
the class?

If not, why not just $("[EMAIL PROTECTED]'#']").addClass("someclass") ... right?

To do what you're looking for, my first attempt would be:

var elem = $("[EMAIL PROTECTED]'#']");
elem.html('' + elem.html() + '');

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

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


Re: [jQuery] .each backwards ?

2006-10-06 Thread Dossy Shiobara
On 2006.10.06, Blair Mitchelmore <[EMAIL PROTECTED]> wrote:
> I propose hcae:

Oh, god no.  I see the smiley so I'm guessing you're only kidding, but
before someone goes "yeah, that's a good idea ..."

> kenton.simpson wrote:
> > Is there a way to make .each walk backwards threw the element collection?

I'm surprised there's no .reverse().  i.e.:

$(collection).reverse().each(...) 

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

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


Re: [jQuery] attach a click event to everything but one TR element...??

2006-10-14 Thread Dossy Shiobara
On 2006.10.14, Miel Soeterbroek <[EMAIL PROTECTED]> wrote:
> And finally, one more thing:
> Can the CSS/XPath expression be dynamic, ie:
> 
> function fillEditField(fieldname,value) {
>var fieldIdAttr = 'edit_' + fieldname;
>$("input#"+fieldIdAttr).val(value); 
> }

Don't use underscores in element IDs.  It's not a valid character, and
some browsers (like, MSIE) will not do what you want if you use it.

http://devedge-temp.mozilla.org/viewsource/2001/css-underscores/

Use hyphens, if you insist on using a visual separator.

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

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


Re: [jQuery] Groups, Forums

2006-10-16 Thread Dossy Shiobara
On 2006.10.16, Glen Lipka <[EMAIL PROTECTED]> wrote:
> I think this is John's call ultimately, but what do you all think?
> Would a more robust group site be helpful or get in the way?

It would get in the way.  Use a real mail client that supports
threading, already.  It's 2006, you know.

Now, if only people would allow you to download a forum's messages in
Unix mbox format (so I could open/search/etc. it locally using my
threading mail client!) ... most web-based forum GUIs are horrible.

A soft compromise might be an NNTP newsgroup, but I like the push-style
nature of email-based lists.  I hate to poll for new articles.

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

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


[jQuery] jQuery Bug #262: "name.replace is not a function" in 1.0.3

2006-11-09 Thread Dossy Shiobara
http://jquery.com/dev/bugs/bug/262/

I re-opened this bug (it was closed) as I'm now running into this error.

Can some more folks take a look at this and see if there's any kind of
work-around, even?  Is there anything that can be done if another JS
script extends the Object object in a foolish way?

-- Dossy

-- 
Dossy Shiobara  | [EMAIL PROTECTED] | http://dossy.org/
Panoptic Computer Network   | http://panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

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