[jQuery] how to disable events on a iframe?

2007-10-12 Thread Rodrigo Moraes

Hey,
Do you know a jQuery solution to disable events on an iframe?
Basically, I want to display an iframe, but disallow all interactions
(click on links, forms, etc) on it. The blockUI plugin seems to not
work in this case... Any ideas?

thanks,
rodrigo moraes


[jQuery] jqMultiSelects suggestion

2007-09-22 Thread Rodrigo Moraes

Hey Rob,

Thanks for jqMultiSelects. Useful one. :)

One suggestion: let the user decide the selectors that will be used
for the elements, instead of forcing an ID. I modified it to allow
this:

jQuery.fn.multiSelect = function(to, button) {
return this.each(function() {
var select = this;
jQuery(this).dblclick(function() {
moveOptions(select, to);
});

if (typeof button != undefined) {
jQuery(button).click(function() {
moveOptions(select, to);
});
}
});

function moveOptions(from, to) {
jQuery(from).children(option:selected).each(function() {
jQuery(this)
.attr(selected, false)
.appendTo(to);
});
}
};

Then it can be called like this:

$(#select_left).multiSelect(#select_right, #options_right);
$(#select_right).multiSelect(#select_left, #options_left);

Don't you think it is less restrictive?
-- rodrigo


[jQuery] Re: Tablesorter 2.0

2007-09-16 Thread Rodrigo Moraes

On 9/14/07, James Dempster wrote:

 The problem with Zebra Striping widget in tablesorter is because it
 uses a little bit of xpath, which has been taken out of jQuery 1.2, to
 fix this replace the format function on line 819 or around there with

 $( tbody:first  tr:visible,table)
   .filter(':even')
   
 .removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0])
   .end().filter(':odd')
   
 .removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1])
 ;

Could you describe the problem with zebra stripes? My TableSorter is
working with jQuery 1.2, except that when you sort the table the
stripes aren't updated. Is this the problem?

Anyway, I don't see any functional difference using your code, but
probably I'm missing something.

Once I get some time, I'll implement two features I need:

1. Allow to define which thead row will be used to trigger sorting. By
default, use the first row. This would allow multiple thead rows
without breaking TableSorter execution.

2. Implement an Ajax pagination widget, to reload tbody rows with
server-side data.

Of course, I'll keep an eye on the community hacks to see if something
similar appears.

Hey, thanks for the plugin. It is super simple but slick. Lovely stuff. :)

-- rodrigo moraes


[jQuery] Re: jQuery UI already released?

2007-09-16 Thread Rodrigo Moraes

On 9/16/07, ivor.horton wrote:
 it is mentioned that jQuery UI will be released in 2007.09.16 in the
 jQuery blog, right?
 and now, it is 2007.09.17, have it been already released?

It is still September 16 here in Brazil. =)

You can see some previews here:

http://ui.jquery.com

(btw, the home page looks great, and the default theme previews too -
h, cute tabs and dialogs!)

It was said somewhere that it would indeed be released today
(2007.09.16) until midnight (US hour, I think -5 GMT), but even if it
arrives a bit late I think it will be great, right? I'm looking
forward to it too.

-- rodrigo


[jQuery] [OT] Importing jQuery mailing list archives

2007-07-17 Thread Rodrigo Moraes


Hi,
This is not directly related to jQuery, but to this mailing list.
Sorry for the off-topic.

I'd like to know how did you moved the entire mailing list archives to
Google Groups. Were the messages re-sent or...?

I'm asking because people from another project I'm involved is
considering to migrate to Google Groups and I couldn't find an
official way to import archives from Mailman. There are topics about
this in Google Groups discussion group, but no solution is given. And
I knew that jQuery-en moved including its archives, so... could you
give me a clue?

thanks,
rodrigo moraes


[jQuery] Re: How to point Thickbox3 links in an iframe to the iframe's container

2007-06-04 Thread Rodrigo Moraes


On 6/4/07, n00bert wrote:

Another way of putting it: the links in the thickbox cause a page to load in
the thickbox. I want those links to close the thickbox and then open their
pages underneath the thickbox. Is this possible? What do I need to do?


I've been doing this using window.top.my_function(), to trigger a
function in the main window. In ThickBox 3, you can then call
tb_remove() to close the thickbox right before or after the action is
executed.

-- rodrigo


[jQuery] Re: Simple new plugin seeking feedback

2007-06-02 Thread Rodrigo Moraes


On 6/2/07, boermans wrote:


My first jQuery plugin is finally operational!

It adjusts the line-height (CSS) of text in proportion to container
width.

Demo here:
http://www.ollicle.com/eg/jquery/autolineheight/


Sweet! I have an use for it. Thanks!

-- rodrigo


[jQuery] Re: jQuery css properties

2007-06-02 Thread Rodrigo Moraes


On 6/2/07, SamCKayak wrote:

Is there a list somewhere of all the revised property names?

I need border-bottom in particular.


I would expect it converted to camel caps (e.g., borderBottom), as in
js and other libs, but I'm not sure.

-- rodrigo


[jQuery] jQuery'zed Ext.Template

2007-05-29 Thread Rodrigo Moraes


Hi,
I made a simple port of Ext.Template [1] / Ext.MasterTemplate [2] to
be used with jQuery, removing Ext dependencies and so. The result is
tiny - 2,4KB packed, and given that it can make other codes smaller, I
think it is worth. Here's the code (feedback appreciated, I'm not a
javascript master! ;):

http://dev.tipos.org/browser/javascript/jquery/template/jquery.template.js?format=txt

I still have three global functions while I'm looking for alternatives
in the jQuery world. I'm looking for something that helps extending
classes / overriding class members in jQuery or any jQuery
plugin/utility. Something like the extend() function in YUI or Ext. Is
there any?

thanks,
rodrigo

[1] http://extjs.com/deploy/ext/docs/output/Ext.Template.html
[2] http://extjs.com/deploy/ext/docs/output/Ext.MasterTemplate.html

---

Usage (based on Ext.MasterTemplate docs):

   var t = new $.MasterTemplate(
   'select name={name}',
   'tpl name=optionsoption value={value}{text}/option/tpl',
   '/select'
   );
   t.add('options', {value: 'foo', text: 'bar'});

   // or you can add multiple child elements in one shot
   t.fill('options', [
   {value: 'foo', text: 'bar'},
   {value: 'foo2', text: 'bar2'},
   {value: 'foo3', text: 'bar3'}
   ]);

   // then append applying the master template values
   $(document.body).append(t.apply({name: 'my-select'}));


[jQuery] Re: jQuery'zed Ext.Template

2007-05-29 Thread Rodrigo Moraes


On 5/29/07, Diego A. wrote:

It's not only great for saving code, but it will come in handy for
customizing the html output of plugins...
much easier than having a bunch of individual options.


I thought that too! :) I'm using it in a plugin I'm writing to make
the output customizable. Also I think that it is much more readable
and easy to maintain a template than a function with a lot of + and
vars to build a complex html structure.

The code came entirely from Ext - the brilliant work was made by Jack
Slocum. As I've used it for a while, I missed the template class a lot
when I moved to jQuery. And so I adapted/simplified it to use on
plugins.

-- rodrigo


[jQuery] Re: jQuery'zed Ext.Template

2007-05-29 Thread Rodrigo Moraes


On 5/29/07, John Resig wrote:

You mean like jQuery.extend()? You just pass in two objects and the
first one is extended with the second.

http://docs.jquery.com/JavaScript#.24.extend.28_target.2C_prop1.2C_propN_.29


Thanks, John. I tried it first, but it doesn't seem appropriate in
this case. I can't use superclass in the extended class (Error:
$.MasterTemplate.superclass has no properties), and uh, I don't
understand this completelly.

So I've duplicated Ext.extend() [1] (similar to YAHOO.extend() [2]) to
get it working. I wonder if I could use something that's already used
by other plugins / core to extend a class in such way, to avoiding
including the function and instead use an existing solution.

-- rodrigo

[1] http://localhost/ext-1.0.1/docs/output/Ext.html#extend
[2] http://developer.yahoo.com/yui/docs/YAHOO.html


[jQuery] Re: jQuery'zed Ext.Template

2007-05-29 Thread Rodrigo Moraes


Hi,
Sorry to reply to myself. :)
I've updated the Template plugin to use $.extend() in a new
$.extendClass() function. This is probably Javascript 101, but I
couldn't go ahead from this point. If somebody can point me an example
of a extended class/constructor/prototype in jQuery, maybe I can take
a look and try to follow it.

I know how to override a class prototype using $.extend(), but not how
to provide a inheritance mechanism so a class can, for example, call
its parent constructor. Well, I saw some mechanisms like
YAHOO.extend() or Ext.extend(), but I would like to make the plugin as
jQuery'zed as I can, so any help would be appreciated.

Here's the updated code:

http://dev.tipos.org/browser/javascript/jquery/template/jquery.template.js?format=txt

thanks,
-- rodrigo


[jQuery] Thickbox Reloaded strange problem

2007-05-25 Thread Rodrigo Moraes


Hi,
I have a problem with Thickbox contents not being loaded when the
trigger is set dynamically. Here's an example:

  http://dev.tipos.com.br/jquery/thickbox.php

1. Click on 'add a new thickbox trigger'.
2. Click on the new link to open the ThickBox. It will open and the
content will be set normally.
3. Repeat step 1. The new link will open a Thickbox which is empty.

Any clues why this is happening?

thanks,
rodrigo


[jQuery] Re: Thickbox Reloaded strange problem

2007-05-25 Thread Rodrigo Moraes


On 5/25/07, Scott Sauyet wrote:

Sorry, I've looked at it a bit, and have absolutely no idea.  It is very
strange.  Sorry to have nothing to offer; I just didn't want you to feel
ignored.  Good luck,


Thanks. :)

As I'm not familiar with the internals of Thickbox Reloaded, I've
added a dirt hack to make that example work: an extra parameter
'content' was added and I set $('#content') explicitly when
initializing it. Then inside Thickbox I check to see if content is
already set.

As someone pointed on the IRC channel, it seems that the #content box
is moved from dom to memory when the script starts, and then the
dynamically added thickboxes don't have it available anymore. I tried
but couldn't find in the code where this happens.

Another issue with Thickbox Reloaded is that, if you want to load a
iframed content which is on the same domain/port, you won't be able
because if it's on the same domain it will guess that you want ajax
(and this is not always true). I hacked it again to force an iframe
even when it's on the same domain, if a config is set.

Thanks again. If you think it is worth, I'll fill an issue to report these.

-- rodrigo


[jQuery] Re: Thickbox Reloaded strange problem

2007-05-25 Thread Rodrigo Moraes


On 5/25/07, Klaus Hartl wrote:

What currently happens is this: When opening the Thickbox this content
gets captured in a closure and never gets reappended back to its
original location - it is appended to the modal with appendTo, e.g. it
is moved in the DOM. But when the modal gets closed it is emptied
without restoring the content to its origin.


Ah, I got it. Thanks for the explanation. I tried to find where this
happens but I was a bit lost.


I don't want to clone the content, because I want to preserve existing
event handlers. I didn't restore the content, because (until now) it
worked the way it is, so I was fine with it. I have never thought about
the case you're talking of, so I will have to think of a way to solve this.


I have several places where this happens. Here's one usage: a form
inside a Thickbox which changes the values depending on which link
opens the thickbox. Then I add another block to the page and it also
has the same thickbox triger, etc. I don't need a lot of repeated
forms in the dom, just one, and them I change their values onShow.

thanks again for the explanation and the great Thickbox Reloaded,
-- rodrigo


[jQuery] Highlight problem in IE6

2007-05-23 Thread Rodrigo Moraes


The problem: a simple highlight in IE6 ends with the highlight color,
instead of the element original color. See by yourself:

   http://dev.tipos.com.br/jquery/highlight.php

Am I doing something wrong? Can highlight work on IE6 without reseting
the background color by hand in the end?

-- rodrigo


[jQuery] Re: Highlight problem in IE6

2007-05-23 Thread Rodrigo Moraes


On 5/23/07, Rodrigo Moraes wrote:

The problem: a simple highlight in IE6 ends with the highlight color,
instead of the element original color. See by yourself:


sorry to not look for it before. there's a bug filled about this already:

http://dev.jquery.com/ticket/1014

in the mean time, I'll set the element back to the original bg color by hand.

-- rodrigo


[jQuery] two doubts: Highlight() and sortables

2007-05-22 Thread Rodrigo Moraes


Hi everybody,
I'm Rodrigo from Brazil and I'm new to jQuery (started 2 days ago).
I'm pretty happy with what I achieved so far. :) I have two IE
problems that are difficult to debug and maybe you had similar
experience of what may cause them. First, an example:

   http://dev.tipos.com.br/jquery/sortables.php

On Firefox it seems perfect. On IE:

1. The Highlight() effect triggered right after a new widget ('add
widget' link) or columns ('add columns' menu) are added ends with the
color set for the effect (yellow), and not the element's bg color
(blue). What can I do to avoid this?

2. The 'drag' operation on widgets are not, hmm, 'smooth'. It is ok,
but sometimes you click and drag but the element is not dragged, which
may give a bad experience to the user. It seems that columns are
perfect, but the widgets are not draggable 100% of the time. Any tips
to improve this or recommended configuration for the sortables?

thanks! jQuery rocks! :)

rodrigo