[jQuery] Re: Sortables: configurable display-style?

2007-04-30 Thread dfd

Nobody?

On 29 Apr., 11:42, dfd <[EMAIL PROTECTED]> wrote:
> Hello group,
>
> i noticed that Sortables always appends a inline-style with hard-coded
> displaystyle 'block' ,  at least for div's, to the dragged object.
> Grmpf. Not very usable when your display-style is "table-row" or other
> table-like styles...
>
> It would be nice if we could have configurable displaystyles:
>
> ...
> displaystyle : ($.browser.msie) 'block' : 'table-row',
> ...
>
> with a default to 'block' to prevent existing applications to break.
> With this changes i think we can have sortable  table-like structures.
> IE6 does nice with block and float_left, so does Firefox 2 with table-
> row and table-cell... Other browsers than that i have not tested.
>
> Any comments?
>
> Best regards,
>
>frank aka dfd



[jQuery] Re: newsticker plugin updated

2007-04-30 Thread Sam Collett

On Apr 29, 6:06 pm, millionmonkey <[EMAIL PROTECTED]> wrote:
> Sam, thanks for the update.  Just in the nick of time for me as
> well.
>
> Newsticker Example:http://www.levelfield.com/newsticker1.html
>

You example also shows how it can also be used for things other than
news as well. Maybe use some image replacement as well (e.g. with jQIR
http://www.texotela.co.uk/code/jquery/jQIR/)

> On Apr 27, 12:06 pm, Sam Collett <[EMAIL PROTECTED]> wrote:
>
> > I've updated my news ticker plugin with some bug fixes and added a few
> > more examples of how to use 
> > it:http://www.texotela.co.uk/code/jquery/newsticker/



[jQuery] Re: Replacing the contents of a div that uses newsticker plug-in

2007-04-30 Thread Sam Collett

On Apr 28, 2:38 pm, "Sean Catchpole" <[EMAIL PROTECTED]> wrote:
> Looking at the code for newticker, you might/should be able to just
> recall $("ul").newsticker() and it should reset the ul. If for some
> reason it doesn't work, then this might be the change that the plugin
> needs:
>   stopTicker = function(el) { if(el.tickfn) clearInterval(el.tickfn); }
>
> ~Sean

Calling it again will work (at least it did when I did a test).



[jQuery] Re: Difference of $.getJSON versus $get

2007-04-30 Thread Rob Desbois

Just to add my £0.02 worth: it's not essential to use $.ajax if you want to
handle errors.
There's a function $.ajaxSetup() available for making global modifications
to the default parameters such as error handler.

I have a globally included error handler for all pages set up like so:

$(document).ready(function() {
  $.ajaxSetup({error: on_ajax_error});
});

function on_ajax_error(xhr, error, exception) {
  // ...
}

Hope that's worth something to you :-)
rob.


On 4/28/07, Dave Cardwell <[EMAIL PROTECTED]> wrote:



wyo wrote:
> What's the difference of $.getJSON versus $.get? I currently use
> $.getJSON to load JSON data but I can't see any advantages.
>
> Is $.getJSON just another way for
>
>  $.ajax({
>type: "GET",
>url: "link name",
>dataType: "json",
>complete: "function name"
>  })
>
> or is the callback excuted only when "success"?
>
> What means "data" in the POST case? How could I access this data on
> the server, e.g. in PHP?
>
> O. Wyss
>

Both $.get and $.getJSON are "shortcuts" for $.ajax, for use when you
don't need the more complex features. $.getJSON explicitly sets the
dataType to "json", as you speculated above, while $.get does not.

For $.get, the callback function will be passed a string containing what
was returned from the request. For $.getJSON however, the callback
function will be passed the data structure that the JSON represented
(see Wikipedia[1] and/or the jQuery docs[2] for more on that).

In the case of $.get and $.getJSON, the callback function is only used
when a successful request was made. If you want to handle errors as
well, you will need to use the more complex $.ajax. The "AJAX" page[3]
of the jQuery docs explains all this in detail.

For GET requests the data is passed as URL params (e.g.,
http://foo.com/bar.php?abc=def&ghi=jkl151). If you set the request method
to post, it issues a normal HTTP POST (as if you had, for example,
submitted a normal HTML form). How to access these on the server side
does depend on your language. I'm not a PHP programmer, but I think you
might access them through the $_GET and $_POST arrays.


[1]http://en.wikipedia.org/wiki/JSON

[2]http://docs.jquery.com/Ajax#.24.getJSON.28_url.2C_params.2C_callback_.29
[3]http://docs.jquery.com/Ajax


--
Best wishes,
Dave Cardwell.

http://davecardwell.co.uk/javascript/jquery/152





--
Rob Desbois
Eml: [EMAIL PROTECTED]
Tel: 01452 760631
Mob: 07946 705987
"There's a whale there's a whale there's a whale fish" he cried, and the
whale was in full view.
...Then ooh welcome. Ahhh. Ooh mug welcome.


[jQuery] Re: Several Carousel

2007-04-30 Thread agent2026


Not sure I follow you.  You can just give your container div a class, and
style it from there.  For the prev/next, I think the rule is if they're not
included then jCarousel will add them.  Otherwise you can add your own, and
make your own style rule for those classes.  If you're having trouble with
thumb sizes, try adjusting the width of your list items.

Here are my styles, if it can help you get anywhere:

.jcarousel-prev, .jcarousel-next {
 display:none;
 position:absolute;
 margin:.9em 5px 0;
 width:40px;
 height:20px;
 text-align:center;
 font-size:.8em;
 font-weight:bold;
 cursor:pointer;
 -moz-user-select:none;
}
.jcarousel-prev {
 left:28px;
}
.jcarousel-next {
 right:28px;
}
a.jcarousel-prev, a.jcarousel-next {
 color:#ccc;
 text-decoration:none;
}
a.jcarousel-prev:hover, a.jcarousel-next:hover {
 color:#fff;
}
#centerRight .carousel
{position:relative;width:310px;margin-bottom:10px;padding-bottom:10px;border-bottom:1px
solid #636a73}
#centerRight .carousel img {padding:0 5px
0px;width:300px;vertical-align:top}
#media img {height:226px}
#maps img {height:358px}
#maps .jcarousel-prev, #battlemaps .jcarousel-next {margin-top:1.4em}


Adam
-- 
View this message in context: 
http://www.nabble.com/Several-Carousel-tf3648594.html#a10250135
Sent from the jCarousel mailing list archive at Nabble.com.



[jQuery] Re: tickbox close window

2007-04-30 Thread Rob Desbois

Are you doing this from a frame?
If not then TB_remove() should do it just fine

rob

On 4/29/07, amircx <[EMAIL PROTECTED]> wrote:




hey. im using thickbox and i want that after some proceeses its will close
the window without user needs to click
ive tried to print out  somthing like

parent.TB_remove();


its not working...
how its can be done right?
--
View this message in context:
http://www.nabble.com/tickbox-close-window-tf3664867s15494.html#a1024010655
Sent from the JQuery mailing list archive at Nabble.com56.





--
Rob Desbois
Eml: [EMAIL PROTECTED]
Tel: 01452 760631
Mob: 07946 705987
"There's a whale there's a whale there's a whale fish" he cried, and the
whale was in full view.
...Then ooh welcome. Ahhh. Ooh mug welcome.


[jQuery] Central jQuery Plugin Database

2007-04-30 Thread Armin Ronacher

Hi,

I visited the mootools webpage yesterday and found their download
tool. While this makes no sense for jQuery it's probably a good idea
for the jQuery plugins. The plugin Wiki Page is really, really big and
if Plugins depend on each other it's not so easy to find the
dependencies.

What about adding a mootools like download page for the plugins that
resolves dependencies automatically and creates one jQueryPlugins.js
file out of the selection.

Regards,
Armin



[jQuery] Some editor like FCKeditor for Images

2007-04-30 Thread oscar esp

I am using FCKeditor.

Now I need to add a photo gallery with some image edit methods
(rotate, crop, resize). Any ones know any editor similar to FCKeditor
for images?

Moreover... I need to implement a Diary (like outllook) any ones know
some one in order to be integrted in my web app?

Thanks in advanced.



[jQuery] Re: BlockUI - IE block() offset problem, calculated incorrectly maybe?

2007-04-30 Thread Mike Alsup

Kush,

The opacity increases if you call block over and over without calling
unblock.  That is not new.  That doesn't happen in my demo because I
call unblock before calling block.

Yes, I noticed that the border is also blocked in IE6, but I don't see
why that is a problem.  Your page looks good to me.

Mike

>  I have replaced with the version you provided
>  It is even weirder now in IE, target border also getting blocked and the
> more you click 'block' the more opacity increases
>  http://khurshid.com/jquery/sandbox/blockUI/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery (English)" group.
To post to this group, send email to jquery-en@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-en?hl=en
-~--~~~~--~~--~--~---



[jQuery] Re: JQuery, Form plugin and FCKeditor

2007-04-30 Thread Mike Alsup


imatts,

I'm not sure I understand.  Are you manually modifying text in the
editor and then clicking the submit button?  Or are you modifying the
text via JavaScript?  Could you post a page that demonstrates the
problem?

Mike


I've just noticed that if I submit the form again without changing anything,
the modified text is picked up in the $_POST array, on the second try. Now
I'm wondering if there's a way to simulate this update of the input data
before sending the form, so that it has the correct data on the first
attempt?


> Is there a way to add an element to the array that get posted to the
> action="example.php"?
> The form plugin is great, and it sends all the form fields for you, easy
> and quick, but it's not sending the updated text in the edit area.
>
> Normally you can get this updated text by doing: var editor =
> FCKeditorAPI.GetInstance('editor').GetXHTML(true);
>
> which is fine, but how do I attach this variable to the $_POSTed ones that
> are in the form? (is there a way to do this using the form plugin?)
>
> Any help would be most appreciated!


[jQuery] Re: datePicker v2 beta

2007-04-30 Thread Sam Collett

On Apr 28, 9:39 am, "R. Rajesh Jeba Anbiah"
<[EMAIL PROTECTED]> wrote:
> On Apr 24, 2:54 pm, "Kelvin Luck" <[EMAIL PROTECTED]> wrote:> Hi,
>
> > I'd like to announce the beta release of v2 of mydatePickerplugin for 
> > jQuery. This release is a complete rewrite which makes the date picker 
> > considerably more powerful and flexible than it previously was. Check out 
> > the temporary project page:
>
> >http://kelvinluck.com/assets/jquery/datePicker/v2/demo/
>
>   
>
>  I suppose, you may take some of the nice concepts from 
> 
>
> --
>   
> Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/

That's quite a nice date picker.

Several features in that picker that look like they would be handy in
Kelvin's that aren't in yet are:

Keyboard Navigation
Don't show the days in other months (you can use CSS to hide them, but
they would still be clickable)
Disable certain days of the week (e.g. Saturday and Sunday)
Transparency (could probably be done with CSS)



[jQuery] Re: datePicker v2 beta

2007-04-30 Thread Sam Collett

On Apr 30, 12:25 pm, Sam Collett <[EMAIL PROTECTED]> wrote:
> On Apr 28, 9:39 am, "R. Rajesh Jeba Anbiah"
>
> <[EMAIL PROTECTED]> wrote:
> > On Apr 24, 2:54 pm, "Kelvin Luck" <[EMAIL PROTECTED]> wrote:> Hi,
>
> > > I'd like to announce the beta release of v2 of mydatePickerplugin for 
> > > jQuery. This release is a complete rewrite which makes the date picker 
> > > considerably more powerful and flexible than it previously was. Check out 
> > > the temporary project page:
>
> > >http://kelvinluck.com/assets/jquery/datePicker/v2/demo/
>
> >   
>
> >  I suppose, you may take some of the nice concepts from 
> > 
>
> > --
> >   
> > Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/
>
> That's quite a nice date picker.
>
> Several features in that picker that look like they would be handy in
> Kelvin's that aren't in yet are:
>
> Keyboard Navigation
> Don't show the days in other months (you can use CSS to hide them, but
> they would still be clickable)
> Disable certain days of the week (e.g. Saturday and Sunday)
> Transparency (could probably be done with CSS)

Just thought of something else - an onDateChanged event. Could be
useful for date pickers that depend on each other (i.e. a date range,
defined by two pickers - 'picker2' has to be a later date than
'picker1')



[jQuery] Re: datePicker v2 beta

2007-04-30 Thread R. Rajesh Jeba Anbiah

On Apr 30, 4:30 pm, Sam Collett <[EMAIL PROTECTED]> wrote:
> On Apr 30, 12:25 pm, Sam Collett <[EMAIL PROTECTED]> wrote:
> > On Apr 28, 9:39 am, "R.RajeshJebaAnbiah"
> > <[EMAIL PROTECTED]> wrote:
> > > On Apr 24, 2:54 pm, "Kelvin Luck" <[EMAIL PROTECTED]> wrote:> Hi,
>
> > > > I'd like to announce the beta release of v2 of mydatePickerplugin for 
> > > > jQuery. This release is a complete rewrite which makes the date picker 
> > > > considerably more powerful and flexible than it previously was. Check 
> > > > out the temporary project page:
>
> > > >http://kelvinluck.com/assets/jquery/datePicker/v2/demo/
>
> > >   
>
> > >  I suppose, you may take some of the nice concepts from 
> > > 
>
> > That's quite a nice date picker.
>
> > Several features in that picker that look like they would be handy in
> > Kelvin's that aren't in yet are:
>
> > Keyboard Navigation
> > Don't show the days in other months (you can use CSS to hide them, but
> > they would still be clickable)
> > Disable certain days of the week (e.g. Saturday and Sunday)
> > Transparency (could probably be done with CSS)
>
> Just thought of something else - an onDateChanged event. Could be
> useful for date pickers that depend on each other (i.e. a date range,
> defined by two pickers - 'picker2' has to be a later date than
> 'picker1')

 Oh, yes. But, I was hinting at the unobtrusiveness. The date
format and etc can be set via class attributes

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/



[jQuery] Re: JQuery, Form plugin and FCKeditor

2007-04-30 Thread imatts


Hi Mike. 

Thanks for your reply. Just modifying the test in the editor and then
clicking submit. The code is very simple:

 
 
 
// prepare the form when the DOM is ready  
$(document).ready(function() {  
var options = {  
target: '#output1', // target element(s) to be updated with server response  
};  
// bind form using 'ajaxForm'  
$('#edit_form').ajaxForm(options);  
}); 
 
 
 
 
BasePath = '/javascript/fckeditor/'; 
$oFCKeditor->Value = 'Default text in editor'; 
$oFCKeditor->Create();  
?> 
 
 

I've actually got around it temporarily by adding a few lines of code to the
jQuery.fn.ajaxSubmit function and a hidden  to the form which gets
updated with the updated text using this:

document.getElementById('updated_text').value =
FCKeditorAPI.GetInstance('editor').GetXHTML(true);

, but it's an ugly solution really. Unfortunately my javascript knowledge is
not that great at the moment to figure out a better solution, maybe someone
else can though (I hope).

Thanks in advance.

Matt




malsup wrote:
> 
> 
> imatts,
> 
> I'm not sure I understand.  Are you manually modifying text in the
> editor and then clicking the submit button?  Or are you modifying the
> text via JavaScript?  Could you post a page that demonstrates the
> problem?
> 
> Mike
> 
>> I've just noticed that if I submit the form again without changing
>> anything,
>> the modified text is picked up in the $_POST array, on the second try.
>> Now
>> I'm wondering if there's a way to simulate this update of the input data
>> before sending the form, so that it has the correct data on the first
>> attempt?
>>
>>
>> > Is there a way to add an element to the array that get posted to the
>> > action="example.php"?
>> > The form plugin is great, and it sends all the form fields for you,
>> easy
>> > and quick, but it's not sending the updated text in the edit area.
>> >
>> > Normally you can get this updated text by doing: var editor =
>> > FCKeditorAPI.GetInstance('editor').GetXHTML(true);
>> >
>> > which is fine, but how do I attach this variable to the $_POSTed ones
>> that
>> > are in the form? (is there a way to do this using the form plugin?)
>> >
>> > Any help would be most appreciated!
> 
> 

-- 
View this message in context: 
http://www.nabble.com/JQuery%2C-Form-plugin-and-FCKeditor-tf328s15494.html#a10252612
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: behaviors?

2007-04-30 Thread Brandon Aaron


Thanks Mike!

I updated the test/example page to make a call to 'bind' instead of
just 'click'. This illustrates how you can pass along any number of
extra arguments to the action/method/plugin.

--
Brandon Aaron.

On 4/28/07, Mike Alsup <[EMAIL PROTECTED]> wrote:


Brandon,

That is really slick!

Mike

> http://dev.jquery.com/browser/trunk/plugins/behavior



[jQuery] Re: Recommended way to overload jquery method?

2007-04-30 Thread George

Hi Jörn, this technique seems like a good idea though I'm not sure I
follow what you did in the metadata plugin. Would you be able provide
an example here of how you would overload the trim function in the
same way as the earlier posting?

Many thanks,

George

On Apr 23, 7:14 pm, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> howard chen schrieb:
>
> > I want tooverloadsome core jQuery method, e.g. trim() method
>
> > any codes sample or recommendation to do this?
>
> Save a reference to the original method in a closure and call that when
> appropiate. An example for this can be found 
> here:http://dev.jquery.com/browser/trunk/plugins/metadata/lib/jQuery/metad...
>
> The advantage over this instead of saving the original to a static name
> like _setArray: You can override a method more then once and won't notice.
>
> --
> Jörn Zaefferer
>
> http://bassistance.de


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery (English)" group.
To post to this group, send email to jquery-en@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-en?hl=en
-~--~~~~--~~--~--~---



[jQuery] Re: Recommended way to overload jquery method?

2007-04-30 Thread Jörn Zaefferer


George schrieb:

Hi Jörn, this technique seems like a good idea though I'm not sure I
follow what you did in the metadata plugin. Would you be able provide
an example here of how you would overload the trim function in the
same way as the earlier posting?
  

Sure thing.

(function($) {
var trim = $.trim;
$.trim = function() {
return trim.apply(this, arguments).replace("\$", "jQuery");
};
})(jQuery);

--
Jörn Zaefferer

http://bassistance.de



[jQuery] $().load() and redirect

2007-04-30 Thread ATom

I need load external page with AJAX, I used JQuery $().load(url)
syntax, but external page sometimes use HTTP redirect to another
location (in the same domain). Exist any way, how I can force Jquery
to follow redirect?



[jQuery] Re: datePicker v2 beta

2007-04-30 Thread Kelvin Luck

Hi,

On Mon, April 30, 2007 12:25 pm, Sam Collett wrote:
>
> Several features in that picker that look like they would be handy in
> Kelvin's that aren't in yet are:
>
> Keyboard Navigation

I've been thinking about this... It's not a priority for me currently
because I'm not sure that it would be worth the extra filesize on the
plugin for the amount of people who would use it. It is on a TODO list as
something to possibly implement as an optional extension if/ when I have
time...

> Don't show the days in other months (you can use CSS to hide them, but
> they would still be clickable)

You can also use CSS to render them non-clickable. Just give them a style
of disabled in the custom cell renderer... I'll set up an example of this
before the actual release of the plugin...

> Disable certain days of the week (e.g. Saturday and Sunday)

Did you see the custom cell renderer demo?
http://kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerCustomCellRender.html

> Transparency (could probably be done with CSS)
>

Yeah - I think this should be done in the CSS.

Thanks for the feedback,

Kelvin :)




[jQuery] Re: JQuery, Form plugin and FCKeditor

2007-04-30 Thread Mike Alsup


Hi Matt,

I don't know anything about the FCKeditor (but somehow it seems
inappropriate to say its name out loud at work), so I can't imagine
why it isn't working on the first pass.  However, you can "force" its
data w/o modifying the plugin by doing something like this (assuming
the element *name* of the editor is 'editor'):

var options = {
   target: '#output1',
   beforeSubmit: function(a, $f, o) {
   // force FCK data
   var val = FCKeditorAPI.GetInstance('editor').GetXHTML(true);
   for (var i=0; i < a.length; i++) {
   if (a[i].name = 'editor') {
   a[i].value = val;
   break;
   }
   }
   }
};

Mike



On 4/30/07, imatts <[EMAIL PROTECTED]> wrote:



Hi Mike.

Thanks for your reply. Just modifying the test in the editor and then
clicking submit. The code is very simple:




// prepare the form when the DOM is ready
$(document).ready(function() {
var options = {
target: '#output1', // target element(s) to be updated with server response
};
// bind form using 'ajaxForm'
$('#edit_form').ajaxForm(options);
});




BasePath = '/javascript/fckeditor/';
$oFCKeditor->Value = 'Default text in editor';
$oFCKeditor->Create();
?>



I've actually got around it temporarily by adding a few lines of code to the
jQuery.fn.ajaxSubmit function and a hidden  to the form which gets
updated with the updated text using this:

document.getElementById('updated_text').value =
FCKeditorAPI.GetInstance('editor').GetXHTML(true);

, but it's an ugly solution really. Unfortunately my javascript knowledge is
not that great at the moment to figure out a better solution, maybe someone
else can though (I hope).

Thanks in advance.

Matt




malsup wrote:
>
>
> imatts,
>
> I'm not sure I understand.  Are you manually modifying text in the
> editor and then clicking the submit button?  Or are you modifying the
> text via JavaScript?  Could you post a page that demonstrates the
> problem?
>
> Mike
>
>> I've just noticed that if I submit the form again without changing
>> anything,
>> the modified text is picked up in the $_POST array, on the second try.
>> Now
>> I'm wondering if there's a way to simulate this update of the input data
>> before sending the form, so that it has the correct data on the first
>> attempt?
>>
>>
>> > Is there a way to add an element to the array that get posted to the
>> > action="example.php"?
>> > The form plugin is great, and it sends all the form fields for you,
>> easy
>> > and quick, but it's not sending the updated text in the edit area.
>> >
>> > Normally you can get this updated text by doing: var editor =
>> > FCKeditorAPI.GetInstance('editor').GetXHTML(true);
>> >
>> > which is fine, but how do I attach this variable to the $_POSTed ones
>> that
>> > are in the form? (is there a way to do this using the form plugin?)
>> >
>> > Any help would be most appreciated!
>
>

--
View this message in context: 
http://www.nabble.com/JQuery%2C-Form-plugin-and-FCKeditor-tf328s15494.html#a10252612
Sent from the JQuery mailing list archive at Nabble.com.




[jQuery] Re: datePicker v2 beta

2007-04-30 Thread Kelvin Luck

On Mon, April 30, 2007 12:30 pm, Sam Collett wrote:

> Just thought of something else - an onDateChanged event. Could be
> useful for date pickers that depend on each other (i.e. a date range,
> defined by two pickers - 'picker2' has to be a later date than
> 'picker1')
>

I'm guessing you didn't see the "Start and end date pickers" example either?

http://kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerStartEnd.html

There are a number of custom events thrown by elements with date pickers
attached to them dateSelected, dpClosed, and dpMonthChanged. They are
described in more detail (along with descriptions of the arguments they
recieve) in the documentation (inline or HTML),

Hope that helps,

Kelvin :)



[jQuery] Re: BlockUI - IE block() offset problem, calculated incorrectly maybe?

2007-04-30 Thread Kush Murod
I meant it is blocked in IE but not in FF
-Kush

Mike Alsup wrote:
> Kush,
>
> The opacity increases if you call block over and over without calling
> unblock.  That is not new.  That doesn't happen in my demo because I
> call unblock before calling block.
>
> Yes, I noticed that the border is also blocked in IE6, but I don't see
> why that is a problem.  Your page looks good to me.
>
> Mike
>
>   
>>  I have replaced with the version you provided
>>  It is even weirder now in IE, target border also getting blocked and the
>> more you click 'block' the more opacity increases
>>  http://khurshid.com/jquery/sandbox/blockUI/
>> 
>
> >
>   


[jQuery] Re: BlockUI - IE block() offset problem, calculated incorrectly maybe?

2007-04-30 Thread Kush Murod

Sorry I meant to say border is also blocked in IE but not in FF

Kush Murod wrote:

I meant it is blocked in IE but not in FF
-Kush

Mike Alsup wrote:
  

Kush,

The opacity increases if you call block over and over without calling
unblock.  That is not new.  That doesn't happen in my demo because I
call unblock before calling block.

Yes, I noticed that the border is also blocked in IE6, but I don't see
why that is a problem.  Your page looks good to me.

Mike

  


 I have replaced with the version you provided
 It is even weirder now in IE, target border also getting blocked and the
more you click 'block' the more opacity increases
 http://khurshid.com/jquery/sandbox/blockUI/

  
  



  


[jQuery] Re: BlockUI - IE block() offset problem, calculated incorrectly maybe?

2007-04-30 Thread Mike Alsup


Yes, I know.  But still, blocking the border seems like it really
shouldn't matter.  Is this causing you problems?

Mike


On 4/30/07, Kush Murod <[EMAIL PROTECTED]> wrote:


 I meant it is blocked in IE but not in FF
 -Kush


 Mike Alsup wrote:
 Kush,

The opacity increases if you call block over and over without calling
unblock. That is not new. That doesn't happen in my demo because I
call unblock before calling block.

Yes, I noticed that the border is also blocked in IE6, but I don't see
why that is a problem. Your page looks good to me.

Mike



 I have replaced with the version you provided
 It is even weirder now in IE, target border also getting blocked and the
more you click 'block' the more opacity increases
 http://khurshid.com/jquery/sandbox/blockUI/






[jQuery] Re: JQuery, Form plugin and FCKeditor

2007-04-30 Thread Mike Alsup


Ooops.  This is obviously wrong:


if (a[i].name = 'editor') {


It should be:

if (a[i].name == 'editor') {


Mike


[jQuery] How to manage a response ...

2007-04-30 Thread Massimiliano Marini

Hi all,

sorry for my bad subject, I try to explain in a better way my question,
I'm using jQuery with Smarty and PHP, I've a form with username and
password fields for a simple authentication


  
Username : 
Password : 

  
  


$('#formLogIn').ajaxForm({
   target: '#responseLogIn',
   success: function() {
 $('#responseLogIn').fadeIn('fast');
   }
});

My structure with Smarty is this

index.php -> where smarty display index.tpl (the page site)

index.tpl -> include header.tpl footer.tpl and the content
like a DIV of TopNavBar, DIV Form LogIn and other content.


In login.php I check in DB if the account exist, If the account exist,
what I want to do is return "something" (I don't know what and how) can
change my page content with another DIV (a private area of the
account), this is my idea, but the problem is: I've not idea how to do
this. Any suggest are welcome. Thanks.

--
Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/
"It's easier to invent the future than to predict it."  -- Alan Kay


[jQuery] Re: JQuery, Form plugin and FCKeditor

2007-04-30 Thread imatts


Mike. Thanks again for the reply! I can see what you're doing with this code,
and I was sure it would work, but for some reason it doesn't?! No errors,
just left with the same default text again. In fact I added
alert(a[i].value); to your function just to make sure it was working, and
yes, it does contain the updated text, but this is not what gets sent to my
php script. Weird. Can you think of anything else? (problem would appear to
be in the form plugin rather than FCKeditor..?)

Thanks again for your help so far, it's much appreciated.

Matt

ps here's a link to fck in case you're interested:
http://wiki.fckeditor.net/FCKeditor (i know, strange name!)


malsup wrote:
> 
> 
> Hi Matt,
> 
> I don't know anything about the FCKeditor (but somehow it seems
> inappropriate to say its name out loud at work), so I can't imagine
> why it isn't working on the first pass.  However, you can "force" its
> data w/o modifying the plugin by doing something like this (assuming
> the element *name* of the editor is 'editor'):
> 
> var options = {
> target: '#output1',
> beforeSubmit: function(a, $f, o) {
> // force FCK data
> var val = FCKeditorAPI.GetInstance('editor').GetXHTML(true);
> for (var i=0; i < a.length; i++) {
> if (a[i].name = 'editor') {
> a[i].value = val;
> break;
> }
> }
> }
> };
> 
> Mike
> 
> 
> 
> On 4/30/07, imatts <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi Mike.
>>
>> Thanks for your reply. Just modifying the test in the editor and then
>> clicking submit. The code is very simple:
>>
>> 
>> > src="../javascript/jquery.form.js">
>> 
>> // prepare the form when the DOM is ready
>> $(document).ready(function() {
>> var options = {
>> target: '#output1', // target element(s) to be updated with server
>> response
>> };
>> // bind form using 'ajaxForm'
>> $('#edit_form').ajaxForm(options);
>> });
>> 
>>
>>
>> 
>> > $oFCKeditor = new FCKeditor('editor');
>> $oFCKeditor->BasePath = '/javascript/fckeditor/';
>> $oFCKeditor->Value = 'Default text in editor';
>> $oFCKeditor->Create();
>> ?>
>> 
>> 
>>
>> I've actually got around it temporarily by adding a few lines of code to
>> the
>> jQuery.fn.ajaxSubmit function and a hidden  to the form which gets
>> updated with the updated text using this:
>>
>> document.getElementById('updated_text').value =
>> FCKeditorAPI.GetInstance('editor').GetXHTML(true);
>>
>> , but it's an ugly solution really. Unfortunately my javascript knowledge
>> is
>> not that great at the moment to figure out a better solution, maybe
>> someone
>> else can though (I hope).
>>
>> Thanks in advance.
>>
>> Matt
>>
>>
>>
>>
>> malsup wrote:
>> >
>> >
>> > imatts,
>> >
>> > I'm not sure I understand.  Are you manually modifying text in the
>> > editor and then clicking the submit button?  Or are you modifying the
>> > text via JavaScript?  Could you post a page that demonstrates the
>> > problem?
>> >
>> > Mike
>> >
>> >> I've just noticed that if I submit the form again without changing
>> >> anything,
>> >> the modified text is picked up in the $_POST array, on the second try.
>> >> Now
>> >> I'm wondering if there's a way to simulate this update of the input
>> data
>> >> before sending the form, so that it has the correct data on the first
>> >> attempt?
>> >>
>> >>
>> >> > Is there a way to add an element to the array that get posted to the
>> >> > action="example.php"?
>> >> > The form plugin is great, and it sends all the form fields for you,
>> >> easy
>> >> > and quick, but it's not sending the updated text in the edit area.
>> >> >
>> >> > Normally you can get this updated text by doing: var editor =
>> >> > FCKeditorAPI.GetInstance('editor').GetXHTML(true);
>> >> >
>> >> > which is fine, but how do I attach this variable to the $_POSTed
>> ones
>> >> that
>> >> > are in the form? (is there a way to do this using the form plugin?)
>> >> >
>> >> > Any help would be most appreciated!
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/JQuery%2C-Form-plugin-and-FCKeditor-tf328s15494.html#a10252612
>> Sent from the JQuery mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/JQuery%2C-Form-plugin-and-FCKeditor-tf328s15494.html#a10254244
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: JQuery, Form plugin and FCKeditor

2007-04-30 Thread imatts


Mike, you're a genius, thanks. I should have spotted that! - It works now.

Thanks again, that's made my day! (and I've learned some stuff.)

Cheers.

Matt.



malsup wrote:
> 
> 
> Ooops.  This is obviously wrong:
> 
>> if (a[i].name = 'editor') {
> 
> It should be:
> 
>  if (a[i].name == 'editor') {
> 
> 
> Mike
> 
> 

-- 
View this message in context: 
http://www.nabble.com/JQuery%2C-Form-plugin-and-FCKeditor-tf328s15494.html#a10254427
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: UTF-7 Ajax form

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

Jeffrey,

>I'm having some troubles with extended characters (copyright symbol, etc.)
>being submitted to the server as a part of a CMS I am writing.
>
>For example, the javascript "escape" command will convert the copyright
>symbol to %A9.  However, the server receiving the ajax POST needs to see
>that as UTF-7 before it will correctly interpret it.
>
>Is there anyway to add the "charset=utf-7" header to the ajax call?  And if
>not, is there a better way to handle this?

The Accept-Charset header should be controlled by the browser and webserver.
You may need to make sure your app/web server is responding to pages using
UTF-8.

You can set custom headers by using the beforeSend mapping:

$.get(
{
url: "someurl.htm",
beforeSend: function (xml){
xml.setRequestHeader("Accept-Charset",
"ISO-8859-1,utf-8;q=0.7,*;q=0.7");
}

}

)

I'm not sure how well that will override the charset in various browsers
though, since that's a header automatically added by the browser.

-Dan



[jQuery] Re: JQuery, Form plugin and FCKeditor

2007-04-30 Thread Mike Alsup


Glad to help and glad that it's working now.

Cheers!

Mike


Mike, you're a genius, thanks. I should have spotted that! - It works now.

Thanks again, that's made my day! (and I've learned some stuff.)

Cheers.

Matt.


[jQuery] Re: BlockUI - IE block() offset problem, calculated incorrectly maybe?

2007-04-30 Thread Kush Murod


Hi Mike,
Sorry to bug all the time :(
FF looks fine, but in IE overlay is not positioned properly
http://khurshid.com/jquery/sandbox/blockUI/
Cheers,
Kush

Mike Alsup wrote:


Yes, I know.  But still, blocking the border seems like it really
shouldn't matter.  Is this causing you problems?

Mike


On 4/30/07, Kush Murod <[EMAIL PROTECTED]> wrote:


 I meant it is blocked in IE but not in FF
 -Kush


 Mike Alsup wrote:
 Kush,

The opacity increases if you call block over and over without calling
unblock. That is not new. That doesn't happen in my demo because I
call unblock before calling block.

Yes, I noticed that the border is also blocked in IE6, but I don't see
why that is a problem. Your page looks good to me.

Mike



 I have replaced with the version you provided
 It is even weirder now in IE, target border also getting blocked and 
the

more you click 'block' the more opacity increases
 http://khurshid.com/jquery/sandbox/blockUI/






[jQuery] Re: cant get autocomplete to work

2007-04-30 Thread bdee1

can anyone help

On Apr 26, 2:19 pm, bdee1 <[EMAIL PROTECTED]> wrote:
> i have been tryign for a while to get autocomplete to work on a page
> of my internal website with no success.  i have used it before on
> other sites but for some reason i can't get it to work here:
>
> i know that the autoComplete_PhoneList.cfm and
> autoComplete_docsearch.cfm files return valid xml data.
>
> below is my code - can anyone help??
>
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> http://www.w3.org/1999/xhtml";>
> 
> 
> Sunnyview Rehabilitation Hospital Intranet
> 
> 
>
> 
> 
>
> 
>
>   
>   
>   
>
> 
> //whenthe DOM is ready (page is loaded)
> $(document).ready(function() {
> //autocomplete for Document Search on index.cfm
> $('#autocomplete1').Autocomplete(
>  {
>  source: 'autocomplete_docSearch.cfm',
>  delay: 50,
>  fx: {
>  type: 'slide',
>  duration: 100
>  },
>  autofill: false,
>  helperClass: 'autocompleter',
>  selectClass: 'selectAutocompleter',
>  minchars: 1
>  }
>  );
>
> // Autocomplete for Phone List Search
> $('#autocompletePhone').Autocomplete(
>  {
>  source: 'autocomplete_PhoneList.cfm',
>  delay: 50,
>  fx: {
>  type: 'slide',
>  duration: 100
>  },
>  autofill: false,
>  helperClass: 'autocompleter',
>  selectClass: 'selectAutocompleter',
>  minchars: 1
>  }
>  );
>
> });
>
> 
>
> 
>
> 
> .autocompleter
> {
> border: 1px solid #6FBEFF;
> width: 250px;
> background-color: #EFF8FF;}
>
> .autocompleter ul li
> {
> padding: 2px 10px;
> white-space: nowrap;
> font-size: 11px;}
>
> .selectAutocompleter
> {
> background-color: #6FBEFF;}
>
> 
>
> 
>
> 
> 
> 
> 
>  name="SearchTerms" size="30"
> maxlength="255" value="" style="border: 1px solid #185693; font-
> family:Arial, Helvetica, sans-serif; font-size:12px; height:17px;
> color:#006699;" />
>  value="Search Documents"
> style="border: 1px solid #185693; font-family:Arial, Helvetica, sans-
> serif; font-size:11px; background-color:#dce9f5; color:#006699;" />
> 
>
> 
> 
>   
> http://sunweb";>Home
> http://sunweb/calendar";>Reserve 
> Projector
> Lunch Menu
>  href="http://sunweb/forums/viewforum.php?f=36";>Suggestion
> Box
>
> Education
>   
> 
> 
> 
>
> 
>
>   
>   
>   
> >  
>
>   
> Last Name
> First Name
>   
>     
>
> 
>   
>   
>   Sort by Department a>  Print This List a>  http://sunweb/
> index.cfm?page=pagerlist">Pager List
>
> 
>
> 
>
> 
> 
> 
>  href="./index.cfm?page=departments">Departments
>  href="http://sunweb/helpdesk";>Helpdesk
>  href="./index.cfm?page=directory">Phone List
>
> What's 
> New
>  href="./index.cfm?page=contact">Contact
>  href="./index.cfm?page=search">Search
> Intranet 
> Tools
> 
>
>  href="./index.cfm?page=alerts">System Alerts
>
> 
> 
> 
> 
>
> 
>
>  language="JavaScript" 
> src="http://www.capitalnews9.com/media/xml/wbox1.asp";>
>
>  href="http://sunweb/backend/docs/Tobacco%20Free%20Environment
> %20Campaign/Website%20Article%20-%20Tobacco-free.doc"> src="TobaccoFreeLogo.gif" width="82" height="83" 

[jQuery] Re: UTF-7 Ajax form

2007-04-30 Thread Mike Alsup


JK,

JavaScript encodes data in UTF-8.  Your server will need to account
for that if you're going to use AJAX.

Mike



I'm having some troubles with extended characters (copyright symbol, etc.)
being submitted to the server as a part of a CMS I am writing.

For example, the javascript "escape" command will convert the copyright
symbol to %A9.  However, the server receiving the ajax POST needs to see
that as UTF-7 before it will correctly interpret it.

Is there anyway to add the "charset=utf-7" header to the ajax call?  And if
not, is there a better way to handle this?

Thanks,
JK




[jQuery] Re: Sortables: configurable display-style?

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

Frank,

>> i noticed that Sortables always appends a inline-style with hard-coded
>> displaystyle 'block' ,  at least for div's, to the dragged object.
>> Grmpf. Not very usable when your display-style is "table-row" or other
>> table-like styles...
>>
>> It would be nice if we could have configurable displaystyles:
>>
>> ...
>> displaystyle : ($.browser.msie) 'block' : 'table-row',
>> ...

I've run into this issue as well in various Interface plug-ins (Draggables,
Droppables, etc.) What I've done to work around the issue is use the events
that run at the end of the function to manually set the display style.

So, for Sortables you'd do:

$('ul').Sortable(
{
accept : 'sortableitem',
activeclass : 'sortableactive',
hoverclass : 'sortablehover',
helperclass : 'sorthelper',
opacity:0.5,
fit :   false,
onStop: function (dragged){
// change the style on the sorted row
this.style.display = "table-row";
}
}
);

You probably could use the onStart to track the original style and then use
onStop to revert back if you have multiple display styles for your
sortables.

-Dan



[jQuery] Pagination ajax

2007-04-30 Thread Sebastián V . Würtz
i have a block with css button like a pagination

code:



 
 1
 2
 3
 Last
 Next »
 



and i have this script

$(document).ready(function(){
 navigation();
});

function navigation() {
 $('.nav_paginacion ul li a').each(function(i) {
  $(this).click(function(){
   $.get(
this.href,
function(data){
   $("#comment_block").html(data);
},
   );
   return false;
  });

 });
}


On the first click in any button it work ok, i have get the next 5 comments 
inside the div i want, but my problem is that i need to execute
the script again to have the same behaviour, because i lose it when i get those 
new comments via ajax.

Any idea?






--
Estoy usando la versión gratuita de SPAMfighter para usuarios privados.
Ha eliminado 1337 correos spam hasta la fecha.
Los usuarios de pago no tienen este mensaje en sus correos.
Obtenga SPAMfighter gratis aquí: http://www.spamfighter.com/les


[jQuery] Re: BlockUI - IE block() offset problem, calculated incorrectly maybe?

2007-04-30 Thread Mike Alsup


Hmm, yeah something is still weird there.  I'll look into it.

Mike


On 4/30/07, Kush Murod <[EMAIL PROTECTED]> wrote:


Hi Mike,
Sorry to bug all the time :(
FF looks fine, but in IE overlay is not positioned properly
http://khurshid.com/jquery/sandbox/blockUI/
Cheers,
Kush

Mike Alsup wrote:
>
> Yes, I know.  But still, blocking the border seems like it really
> shouldn't matter.  Is this causing you problems?
>
> Mike
>
>
> On 4/30/07, Kush Murod <[EMAIL PROTECTED]> wrote:
>>
>>  I meant it is blocked in IE but not in FF
>>  -Kush
>>
>>
>>  Mike Alsup wrote:
>>  Kush,
>>
>> The opacity increases if you call block over and over without calling
>> unblock. That is not new. That doesn't happen in my demo because I
>> call unblock before calling block.
>>
>> Yes, I noticed that the border is also blocked in IE6, but I don't see
>> why that is a problem. Your page looks good to me.
>>
>> Mike
>>
>>
>>
>>  I have replaced with the version you provided
>>  It is even weirder now in IE, target border also getting blocked and
>> the
>> more you click 'block' the more opacity increases
>>  http://khurshid.com/jquery/sandbox/blockUI/
>>
>>
>>
>>



[jQuery] Re: Pagination ajax

2007-04-30 Thread Sean Catchpole


I may have misinterpreted what you are trying to do, but perhaps this will work:

$(navigation);

function navigation() {
 $('.nav_paginacion ul li a').click(function() {
   $.get( this.href, function(data) {
 $("#comment_block").html(data);
 navigation();
   });
   return false;
 });
}

~Sean


[jQuery] Re: behaviors?

2007-04-30 Thread John Resig


Excellent Brandon, this is a great start. I suspect that in order to
get a full "behavior" plugin (one the feels natural) it'll require a
lot of code extensions. Hmm... I wonder if there's anything that can
be added to jQuery proper to ease the process.

--John

On 4/28/07, Brandon Aaron <[EMAIL PROTECTED]> wrote:


I had some down time this afternoon so I thought I would throw
something together real quick. I just checked it in:
http://dev.jquery.com/browser/trunk/plugins/behavior

This allows you to register any number of behaviors that will run any
jQuery method/plugin with any number of arguments. It also allows a
plugin developer to register their method so that behavior will auto
run when it is done. It also allows the developer to manually
run/remove a specific behavior or all behaviors.

It seems to be pretty flexible but with behavior auto running after a
DOM update, I could see it getting pretty out of hand with performance
if lots of behaviors are used.


Here is the test/example page that adds three behaviors; an append,
click and addClass. I also remove the addClass behavior before doing
the last two appendTo and prependTo calls.

http://brandon.jquery.com/plugins/behavior/test/test.html

--
Brandon Aaron



On 4/26/07, John Resig <[EMAIL PROTECTED]> wrote:
>
> .behavior() does not exist - but it could (without too much effort)
> the current solution with jQuery is shown in the previous slide (which
> is, unfortunately, rather verbose). I hope that it'll exist one day -
> I probably should've made that more explicit.
>
> You would, "simply", have to override append/prepend/before/after and
> after the injection has occurred, re-run all "behavior"ed expressions.
> Of course, you'd also have to cache all expressions for future use
> (and that's another nut, entirely). If someone feels compelled, you
> can hack on it - otherwise, I may take a stab at it.
>
> --John
>
> On 4/26/07, Starbow <[EMAIL PROTECTED]> wrote:
> >
> > I was just watching the video of John Resig at Yahoo, and in one slide
> > he talked about behaviors, as jquery bindings that act like css rules
> > and apply themselves to html fragments asynchronously loaded into the
> > page.  The code sample looked like this:
> >
> > $(document).ready( function() {
> >   $('li").behavior( "click", function() {
> > $(this).load("menu.html");
> >   });
> > });
> >
> > Is behavior a special jQuery function, something that is in the works,
> > or is it just a regular function and the code for it was missing from
> > the slide set?
> >
> >
>



[jQuery] Re: jQuery Powered Sites - More Sites Added.

2007-04-30 Thread Kevin Scholl

A small site I designed and developed, launched last week:

http://www.shoshintech.com/

Uses jQuery for the navigation, linking the default top level of the
breadcrumb, and automatically closing any popup window when leaving
the given parent page or opening a new popup window (see the About Us
> Location page).

Nothing groundbreaking, but there it is. Have another site in client
review that uses jQuery for some other things...

Kevin



[jQuery] Re: jQuery Powered Sites - More Sites Added.

2007-04-30 Thread Kevin Scholl

A small site I designed and developed, launched last week:

http://www.shoshintech.com/

Uses jQuery for the navigation, adding the "Print this page" link next
to the breadcrumb (since it relies on javascript), and automatically
closing any popup window when leavingthe given parent page or opening
a new popup window (see the About Us / Location page).

Nothing groundbreaking, but there it is. Have another site in client
review that uses jQuery for some other things...

Kevin


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery (English)" group.
To post to this group, send email to jquery-en@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-en?hl=en
-~--~~~~--~~--~--~---



[jQuery] Re: behaviors?

2007-04-30 Thread Scott Sauyet

John Resig wrote:
> Excellent Brandon, this is a great start. I suspect that in order to
> get a full "behavior" plugin (one the feels natural) it'll require a
> lot of code extensions. Hmm... I wonder if there's anything that can
> be added to jQuery proper to ease the process.

Do the browsers offer any DomChanged() hooks we could use?  I would 
guess not, or the bright minds here would already have taken advantage 
of them.

Brandon's approach seems the best that can be done without such hooks, 
and I could certainly make an argument for this going in the core, but 
it there were such hooks available, this could be pretty easy and very 
clean.  I just don't know much about the APIs exposed by the major browsers.

   -- Scott


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery (English)" group.
To post to this group, send email to jquery-en@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-en?hl=en
-~--~~~~--~~--~--~---



[jQuery] Interface Droppables/Sortables

2007-04-30 Thread real

Hi,

I have two unordered lists, one that needs to be both sortable and
droppable at the same time, and the other one is just a droppable.
Currently I can get it to work by making both UL sortables, so the LIs
can be moved between both lists fine.

Here's the problem though: I need to use the onDrop callback
functionality from the droppable, but I can't get droppables and
sortables to together properly. The sortables only have onStop, onOut
but neither of those callbacks will be adequate.

Would there be an alternative method of achieving this?

Thanks.



[jQuery] Re: behaviors?

2007-04-30 Thread Aaron Heimlich
Well, DOM2 does define "Mutation Events"[1], which seem to be what you're
looking for, but I dunno how many browsers actually support them. You could
trigger custom events inside append(), prepend(), etc., but I dunno how well
that will run.

[1]
http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-eventgroupings-mutationevents

On 4/30/07, Scott Sauyet <[EMAIL PROTECTED]> wrote:
>
>
> John Resig wrote:
> > Excellent Brandon, this is a great start. I suspect that in order to
> > get a full "behavior" plugin (one the feels natural) it'll require a
> > lot of code extensions. Hmm... I wonder if there's anything that can
> > be added to jQuery proper to ease the process.
>
> Do the browsers offer any DomChanged() hooks we could use?  I would
> guess not, or the bright minds here would already have taken advantage
> of them.
>
> Brandon's approach seems the best that can be done without such hooks,
> and I could certainly make an argument for this going in the core, but
> it there were such hooks available, this could be pretty easy and very
> clean.  I just don't know much about the APIs exposed by the major
> browsers.
>
>-- Scott
>
>
> >
>


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


[jQuery] Re: UTF-7 Ajax form

2007-04-30 Thread Jeffrey Kretz

Thanks very much.

Its possible I misunderstood the problem.  Here's the full symptom I ran
into.

1. If you type a copyright character (ALT-0169 in windows), and use the
Javascript escape function on it, you get %A9.  escape("C")=="%A9"

2. Passed in a form POST, my .NET server decodes it as an empty string.

3. Stepping through the Request object in debug mode shows the encoding set
for UTF-8.

4. Manually test: HttpUtility.UrlDecode("%A9",Encoding.UTF8)==string.Empty;

5. Manually test: HttpUtility.UrlDecode("%A9",Encoding.UTF7)=="C";

It's a bit odd to me.

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Mike Alsup
Sent: Monday, April 30, 2007 7:39 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: UTF-7 Ajax form


JK,

JavaScript encodes data in UTF-8.  Your server will need to account
for that if you're going to use AJAX.

Mike


> I'm having some troubles with extended characters (copyright symbol, etc.)
> being submitted to the server as a part of a CMS I am writing.
>
> For example, the javascript "escape" command will convert the copyright
> symbol to %A9.  However, the server receiving the ajax POST needs to see
> that as UTF-7 before it will correctly interpret it.
>
> Is there anyway to add the "charset=utf-7" header to the ajax call?  And
if
> not, is there a better way to handle this?
>
> Thanks,
> JK
>
>



[jQuery] change element's name

2007-04-30 Thread Lambari

Hello,

I'm trying to change a element's name and id. I've managed to change
the ID but it seems that jQuery can't change the name.

here is my code:
$("#custom_"+i).attr("id", "custom_"+cnt ); // working
$("#custom_title_"+i).attr("name", "custom_title_"+cnt ); // not
working
$("#custom_content_"+i).attr("name", "custom_content_"+cnt ); // not
working

is there another way to change an element's name?


cheers,
bigo



[jQuery] Re: UTF-7 Ajax form

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

>1. If you type a copyright character (ALT-0169 in windows), and use the
>Javascript escape function on it, you get %A9.  escape("C")=="%A9"

Use encodeURI() instead to correctly encode the characters.

-Dan



[jQuery] Re: behaviors?

2007-04-30 Thread Scott Sauyet


Aaron Heimlich wrote:
Well, DOM2 does define "Mutation Events"[1], which seem to be what 
you're looking for, but I dunno how many browsers actually support them. 
You could trigger custom events inside append(), prepend(), etc., but I 
dunno how well that will run.


They don't seem well supported according to a cursory investigation. 
The latter approach is the one Brandon took, and is probably the best 
that can be done with current browsers, although maybe it could back all 
the way into the underlying DOM functions.


  -- Scott



[jQuery] Help with Interface Blind

2007-04-30 Thread ryanod

I would like to use the Interface Blind plugin. I have it on my page,
but when you first arrive, it is visible. I would like it to be
hidden. Then, when the user clicks 'login', it drops in.

How can I do this?

Ryan OD



[jQuery] Re: UTF-7 Ajax form

2007-04-30 Thread Jeffrey Kretz

Thanks for this.  Unfortunately, I must be barking up the wrong tree.  The
.NET server still decoded the Request.Form collection UTF8 no matter what I
set the charset to on the XML post.  And '%A9' is decoded to an empty string
on UTF8.

I guess I could write my own method to replace the javascript "escape" to
make it .NET friendly, but that would kind of suck.

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Dan G. Switzer, II
Sent: Monday, April 30, 2007 7:32 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: UTF-7 Ajax form


Jeffrey,

>I'm having some troubles with extended characters (copyright symbol, etc.)
>being submitted to the server as a part of a CMS I am writing.
>
>For example, the javascript "escape" command will convert the copyright
>symbol to %A9.  However, the server receiving the ajax POST needs to see
>that as UTF-7 before it will correctly interpret it.
>
>Is there anyway to add the "charset=utf-7" header to the ajax call?  And if
>not, is there a better way to handle this?

The Accept-Charset header should be controlled by the browser and webserver.
You may need to make sure your app/web server is responding to pages using
UTF-8.

You can set custom headers by using the beforeSend mapping:

$.get(
{
url: "someurl.htm",
beforeSend: function (xml){
xml.setRequestHeader("Accept-Charset",
"ISO-8859-1,utf-8;q=0.7,*;q=0.7");
}

}

)

I'm not sure how well that will override the charset in various browsers
though, since that's a header automatically added by the browser.

-Dan




[jQuery] Re: behaviors?

2007-04-30 Thread Brandon Aaron


Yeah I have an idea... I'm going to go see if it works. :)

--
Brandon Aaron

On 4/30/07, John Resig <[EMAIL PROTECTED]> wrote:


Excellent Brandon, this is a great start. I suspect that in order to
get a full "behavior" plugin (one the feels natural) it'll require a
lot of code extensions. Hmm... I wonder if there's anything that can
be added to jQuery proper to ease the process.

--John

On 4/28/07, Brandon Aaron <[EMAIL PROTECTED]> wrote:
>
> I had some down time this afternoon so I thought I would throw
> something together real quick. I just checked it in:
> http://dev.jquery.com/browser/trunk/plugins/behavior
>
> This allows you to register any number of behaviors that will run any
> jQuery method/plugin with any number of arguments. It also allows a
> plugin developer to register their method so that behavior will auto
> run when it is done. It also allows the developer to manually
> run/remove a specific behavior or all behaviors.
>
> It seems to be pretty flexible but with behavior auto running after a
> DOM update, I could see it getting pretty out of hand with performance
> if lots of behaviors are used.
>
>
> Here is the test/example page that adds three behaviors; an append,
> click and addClass. I also remove the addClass behavior before doing
> the last two appendTo and prependTo calls.
>
> http://brandon.jquery.com/plugins/behavior/test/test.html
>
> --
> Brandon Aaron
>
>
>
> On 4/26/07, John Resig <[EMAIL PROTECTED]> wrote:
> >
> > .behavior() does not exist - but it could (without too much effort)
> > the current solution with jQuery is shown in the previous slide (which
> > is, unfortunately, rather verbose). I hope that it'll exist one day -
> > I probably should've made that more explicit.
> >
> > You would, "simply", have to override append/prepend/before/after and
> > after the injection has occurred, re-run all "behavior"ed expressions.
> > Of course, you'd also have to cache all expressions for future use
> > (and that's another nut, entirely). If someone feels compelled, you
> > can hack on it - otherwise, I may take a stab at it.
> >
> > --John
> >
> > On 4/26/07, Starbow <[EMAIL PROTECTED]> wrote:
> > >
> > > I was just watching the video of John Resig at Yahoo, and in one slide
> > > he talked about behaviors, as jquery bindings that act like css rules
> > > and apply themselves to html fragments asynchronously loaded into the
> > > page.  The code sample looked like this:
> > >
> > > $(document).ready( function() {
> > >   $('li").behavior( "click", function() {
> > > $(this).load("menu.html");
> > >   });
> > > });
> > >
> > > Is behavior a special jQuery function, something that is in the works,
> > > or is it just a regular function and the code for it was missing from
> > > the slide set?
> > >
> > >
> >
>



[jQuery] Re: UTF-7 Ajax form

2007-04-30 Thread Jeffrey Kretz

Wow!  I feel simultaneously grateful and foolish.

That totally solved my problem.

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Dan G. Switzer, II
Sent: Monday, April 30, 2007 9:57 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: UTF-7 Ajax form


>1. If you type a copyright character (ALT-0169 in windows), and use the
>Javascript escape function on it, you get %A9.  escape("C")=="%A9"

Use encodeURI() instead to correctly encode the characters.

-Dan




[jQuery] jqModal via POST ?

2007-04-30 Thread Brian Cherne

Has anyone implemented jqModal (or something like it) via the POST method?

I really enjoy how simple jqModal is for calling modal dialogs and I want to
use it on a secure web page. In order to get the right information from the
server I'll need to send in params... ideally params that are protected via
HTTPS wrapper (and not sent via plain-text GET URI).

Brian.


[jQuery] Re: change element's name

2007-04-30 Thread Karl Swedberg


On Apr 30, 2007, at 12:38 PM, Lambari wrote:



Hello,

I'm trying to change a element's name and id. I've managed to change
the ID but it seems that jQuery can't change the name.

here is my code:
$("#custom_"+i).attr("id", "custom_"+cnt ); // working
$("#custom_title_"+i).attr("name", "custom_title_"+cnt ); // not
working
$("#custom_content_"+i).attr("name", "custom_content_"+cnt ); // not
working

is there another way to change an element's name?


cheers,
bigo



Are you getting a JavaScript error?

Also, are you selecting on the id when you should be selecting on the  
name?


You might want to try something like this to make sure that you're  
actually selecting something:


$('[EMAIL PROTECTED]' + i + ']').attr("name", "custom_title_"+cnt );



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




[jQuery] Re: behaviors?

2007-04-30 Thread Brandon Aaron


Okay ... I've created a jQuery.fn.behavior() and
jQuery.fn.unbehavior(). I haven't checked anything in yet but I have
uploaded it to here:
http://brandon.jquery.com/plugins/behavior/test/test.html

I also added a pretty rough $.behavior.find() so that unbehavior will work.

The only extension I needed to make to the core was exposing the
selector and context for the jQuery object.

Index: src/jquery/jquery.js
===
--- src/jquery/jquery.js(revision 1827)
+++ src/jquery/jquery.js(working copy)
@@ -43,8 +43,12 @@
a = jQuery.clean( [ m[1] ] );

// HANDLE: $(expr)
-   else
-   return new jQuery( c ).find( a );
+   else {
+   var r = new jQuery( c ).find( a );
+   r.selector = a;
+   r.context = c;
+   return r;
+   }
}

return this.setArray(


--
Brandon Aaron

On 4/30/07, Brandon Aaron <[EMAIL PROTECTED]> wrote:

Yeah I have an idea... I'm going to go see if it works. :)

--
Brandon Aaron

On 4/30/07, John Resig <[EMAIL PROTECTED]> wrote:
>
> Excellent Brandon, this is a great start. I suspect that in order to
> get a full "behavior" plugin (one the feels natural) it'll require a
> lot of code extensions. Hmm... I wonder if there's anything that can
> be added to jQuery proper to ease the process.
>
> --John
>
> On 4/28/07, Brandon Aaron <[EMAIL PROTECTED]> wrote:
> >
> > I had some down time this afternoon so I thought I would throw
> > something together real quick. I just checked it in:
> > http://dev.jquery.com/browser/trunk/plugins/behavior
> >
> > This allows you to register any number of behaviors that will run any
> > jQuery method/plugin with any number of arguments. It also allows a
> > plugin developer to register their method so that behavior will auto
> > run when it is done. It also allows the developer to manually
> > run/remove a specific behavior or all behaviors.
> >
> > It seems to be pretty flexible but with behavior auto running after a
> > DOM update, I could see it getting pretty out of hand with performance
> > if lots of behaviors are used.
> >
> >
> > Here is the test/example page that adds three behaviors; an append,
> > click and addClass. I also remove the addClass behavior before doing
> > the last two appendTo and prependTo calls.
> >
> > http://brandon.jquery.com/plugins/behavior/test/test.html
> >
> > --
> > Brandon Aaron
> >
> >
> >
> > On 4/26/07, John Resig <[EMAIL PROTECTED]> wrote:
> > >
> > > .behavior() does not exist - but it could (without too much effort)
> > > the current solution with jQuery is shown in the previous slide (which
> > > is, unfortunately, rather verbose). I hope that it'll exist one day -
> > > I probably should've made that more explicit.
> > >
> > > You would, "simply", have to override append/prepend/before/after and
> > > after the injection has occurred, re-run all "behavior"ed expressions.
> > > Of course, you'd also have to cache all expressions for future use
> > > (and that's another nut, entirely). If someone feels compelled, you
> > > can hack on it - otherwise, I may take a stab at it.
> > >
> > > --John
> > >
> > > On 4/26/07, Starbow <[EMAIL PROTECTED]> wrote:
> > > >
> > > > I was just watching the video of John Resig at Yahoo, and in one slide
> > > > he talked about behaviors, as jquery bindings that act like css rules
> > > > and apply themselves to html fragments asynchronously loaded into the
> > > > page.  The code sample looked like this:
> > > >
> > > > $(document).ready( function() {
> > > >   $('li").behavior( "click", function() {
> > > > $(this).load("menu.html");
> > > >   });
> > > > });
> > > >
> > > > Is behavior a special jQuery function, something that is in the works,
> > > > or is it just a regular function and the code for it was missing from
> > > > the slide set?
> > > >
> > > >
> > >
> >
>



[jQuery] Re: change element's name

2007-04-30 Thread Lambari

Hi!

thanks for your help. I wasn't getting any error and there was an id
with the same name (but I just would like to change the name to submit
the page and handle it in a php script).

Your suggestion fixed the problem :) thanks!

-bigo

On Apr 30, 3:07 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> On Apr 30, 2007, at 12:38 PM, Lambari wrote:
>
>
>
>
>
> > Hello,
>
> > I'm trying to change a element's name and id. I've managed to change
> > the ID but it seems that jQuery can't change the name.
>
> > here is my code:
> > $("#custom_"+i).attr("id", "custom_"+cnt ); // working
> > $("#custom_title_"+i).attr("name", "custom_title_"+cnt ); // not
> > working
> > $("#custom_content_"+i).attr("name", "custom_content_"+cnt ); // not
> > working
>
> > is there another way to change an element's name?
>
> > cheers,
> > bigo
>
> Are you getting a JavaScript error?
>
> Also, are you selecting on the id when you should be selecting on the
> name?
>
> You might want to try something like this to make sure that you're
> actually selecting something:
>
> $('[EMAIL PROTECTED]' + i + ']').attr("name", "custom_title_"+cnt );
>
> --Karl
> _
> Karl Swedbergwww.englishrules.comwww.learningjquery.com



[jQuery] Re: behaviors?

2007-04-30 Thread Mike Alsup


Brandon,

This is really, really cool!   I think this is functionality that
belongs in core as it solves an extremely common use case (and
addresses the most commonly asked question regarding ajax usage).

Awesome job!

Mike


Okay ... I've created a jQuery.fn.behavior() and
jQuery.fn.unbehavior(). I haven't checked anything in yet but I have
uploaded it to here:
http://brandon.jquery.com/plugins/behavior/test/test.html

I also added a pretty rough $.behavior.find() so that unbehavior will work.

The only extension I needed to make to the core was exposing the
selector and context for the jQuery object.


[jQuery] Re: Autocomplete Question

2007-04-30 Thread Jeff Fleitz

Hey Dan,

I am playing around with your suggestions below on how to implement
multiple autocomplete calls on one form using your implementation. I
have added the second argument (input) in the callback as you
suggested, but am stumped about where in the code to pass the input
reference from? I have tried the onFindValue argument in the
autocomplete call, but that is not working.  I am getting 'input is
not defined' errors and have not yet been able to trigger an alert
box.

Any clues?

>
> What you could do is look through the callbacks in the source code and add
> the "input" variable as a second argument. So for example, you'd change the
> line:
>
> if( options.onFindValue ) setTimeout(function() { options.onFindValue(li) },
> 1);
>
> To:
> if( options.onFindValue ) setTimeout(function() { options.onFindValue(li,
> input) }, 1);
>
> This would pass a reference to the current input DOM element, so you could
> do:
>
> if( input.id == "unit_lookup" ) alert("Ok, do something!");
>
> This would also allow you to attach the behavior to multiple elements w/the
> same call.



[jQuery] A simple Comparison

2007-04-30 Thread Mario Moura

Hi Folks

I am trying a simple Comparison.

IF ($('.field_image04').find(".imagefield-edit-image-row") == null ) 

When I test in differents .class (.field_image04, .field_image03..) I
receive empty, null results or a random text result.

What I need is just do if have result or else do another thing if I havent.
(I know do that)

But comparison always return false in both cases.

What is missing? Is it a bug?

Regards

Mario


[jQuery] Re: Autocomplete Question

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

Jeff,

>I am playing around with your suggestions below on how to implement
>multiple autocomplete calls on one form using your implementation. I
>have added the second argument (input) in the callback as you
>suggested, but am stumped about where in the code to pass the input
>reference from? I have tried the onFindValue argument in the
>autocomplete call, but that is not working.  I am getting 'input is
>not defined' errors and have not yet been able to trigger an alert
>box.
>
>Any clues?
>
>>
>> To:
>> if( options.onFindValue ) setTimeout(function() { options.onFindValue(li,
>> input) }, 1);

If you've changed the option.onFindValue() to the above code, that's the
only autocomplete code change you need to make.

Now the onFindValue call back will have access to both the li and original
input fields.



var oAutocomplete = $("#myField").autocomplete(
"somepage.htm",
{
onFindValue: function(li, input){
alert(input.id);
}
}
});

oAutocomplete[0].autocompleter.findValue();

When the findValue() method is invoked now, it would alert the id attribute
for the input element--which would be "myField" in this case.

-Dan



[jQuery] Re: A simple Comparison

2007-04-30 Thread Mario Moura

Ok Done

If someone is looking for this:

$(".field_image03']").children().is(".imagefield-edit-image-row");

return true or false

Thanks for all

Mario


2007/4/30, Mario Moura <[EMAIL PROTECTED]>:


Hi Folks

I am trying a simple Comparison.

IF ($('.field_image04').find(".imagefield-edit-image-row") == null ) 

When I test in differents .class (.field_image04, .field_image03..) I
receive empty, null results or a random text result.

What I need is just do if have result or else do another thing if I
havent. (I know do that)

But comparison always return false in both cases.

What is missing? Is it a bug?

Regards

Mario





--
Mário Alberto Chaves Moura
[EMAIL PROTECTED]
31-9157-6000


[jQuery] Re: behaviors?

2007-04-30 Thread Brandon Aaron


Thanks Mike! My vote is to expose the selector and context on the
jQuery object as properties and leave this as an "official" plugin ...
at least for now.

John, what are your thoughts about adding the selector and context
properties to jQuery? I know this isn't the first time I've wanted to
get the selector used via a plugin. I think it could open the doors
for some more creative plugins. If you are okay with adding these in,
I can go ahead and clean up the code for behavior, commit it and the
additions to jQuery. Of course the current version of behavior could
work for people not able to immediately upgrade to 1.1.3 (once it is
finally released).

--
Brandon Aaron

On 4/30/07, Mike Alsup <[EMAIL PROTECTED]> wrote:


Brandon,

This is really, really cool!   I think this is functionality that
belongs in core as it solves an extremely common use case (and
addresses the most commonly asked question regarding ajax usage).

Awesome job!

Mike

> Okay ... I've created a jQuery.fn.behavior() and
> jQuery.fn.unbehavior(). I haven't checked anything in yet but I have
> uploaded it to here:
> http://brandon.jquery.com/plugins/behavior/test/test.html
>
> I also added a pretty rough $.behavior.find() so that unbehavior will work.
>
> The only extension I needed to make to the core was exposing the
> selector and context for the jQuery object.



[jQuery] An idea for a jQuery core addition - Plugin Registering...

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

Guys,

It occurred to me last night with the growing list of plug-ins and the fact
that so many plug-ins now are dependant on other plug-ins, that we should
try to add a couple of functions to the jQuery core for registering plug-ins
and detecting if a plug-in has been registered.

So, to register a plug-in, you'd add something like this to a plug-in:
$.plugin.register("autocomplete");

And then when writing a plug-in that's dependent on some other plug-in, you
could check for loaded plug-ins:
$.plugin.find(["dimension","blockui","below"]);

I'm just thinking that maybe the core library needs something to help
plug-in authors to manage the dependencies of their plug-ins--in order to
help developers using their plug-ins.

If we at least added a few core methods for tracking, we could expand the
architecture later if need be.

Does this make sense to anyone else? 

-Dan


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery (English)" group.
To post to this group, send email to jquery-en@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-en?hl=en
-~--~~~~--~~--~--~---



[jQuery] Re: An idea for a jQuery core addition - Plugin Registering...

2007-04-30 Thread Alexandre Plennevaux

It seems like inevitable to me too, Dan.  

If for example, $.plugin.find(["dimension","blockui","below"]);  fails, it
would output a message "Error: plugin  requires
". 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Dan G. Switzer, II
Sent: lundi 30 avril 2007 21:50
To: jquery-en@googlegroups.com
Subject: [jQuery] An idea for a jQuery core addition - Plugin Registering...


Guys,

It occurred to me last night with the growing list of plug-ins and the fact
that so many plug-ins now are dependant on other plug-ins, that we should
try to add a couple of functions to the jQuery core for registering plug-ins
and detecting if a plug-in has been registered.

So, to register a plug-in, you'd add something like this to a plug-in:
$.plugin.register("autocomplete");

And then when writing a plug-in that's dependent on some other plug-in, you
could check for loaded plug-ins:
$.plugin.find(["dimension","blockui","below"]);

I'm just thinking that maybe the core library needs something to help
plug-in authors to manage the dependencies of their plug-ins--in order to
help developers using their plug-ins.

If we at least added a few core methods for tracking, we could expand the
architecture later if need be.

Does this make sense to anyone else? 

-Dan

Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.467 / Base de données virus: 269.6.2/780 - Date: 29/04/2007
6:30
 



[jQuery] Re: UTF-7 Ajax form

2007-04-30 Thread Jeffrey Kretz

And if anyone else on a .NET environment runs into this, the server-side
HttpUtility.UrlEncode/URLDecode does NOT match the client-side javascript
encodeURI/decodeURI, making it hard to pass data back and forth.

The remedy is to reference the Jscript 8.0 library to your project, and use
the Microsoft.JScript.GlobalObject.encodeURI as server-side code.  This is,
in fact, the same encodeURI method used by the browser.  Thus, the inputs
and outputs will match.

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Jeffrey Kretz
Sent: Monday, April 30, 2007 10:11 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: UTF-7 Ajax form


Wow!  I feel simultaneously grateful and foolish.

That totally solved my problem.

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Dan G. Switzer, II
Sent: Monday, April 30, 2007 9:57 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: UTF-7 Ajax form


>1. If you type a copyright character (ALT-0169 in windows), and use the
>Javascript escape function on it, you get %A9.  escape("C")=="%A9"

Use encodeURI() instead to correctly encode the characters.

-Dan





[jQuery] Re: Release: autocomplete 1.0 alpha

2007-04-30 Thread Shelane

Jörn,

I believe I found a bug in the new autocompleter.  Line 157 has:
var $input = $(input).attr("autocomplete",
"off").addClass(options.inputClass);

This throws a javascript error if jQuery.noConflict() has been called:
$(input).attr is not a function

changing it to var $input = jQuery(input).attr("autocomplete",
"off").addClass(options.inputClass);

fixes the problem

On Apr 19, 11:08 am, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> Dan G. Switzer, II schrieb:>> What would be passed to the function?  The 
> containing li?  a jQuery object
> >> containing the containing li?  The HTML text?
>
> > The source is available here:
> >http://dev.jquery.com/browser/trunk/plugins/autocomplete/jquery.autoc...
> > .js
>
> > [...]
>
> > At the moment it runs against li.innerHTML.
>
> So far it was internal only, I'd pass the formatted string as the first
> argument and the other stuff in addition.
> Formatting would be very flexible then. Default takes a simple string
> and adds simple highlighting. Then you can replace that simple string
> with some custom formatting and default highlighting. Or you use
> formatting and include highlighting and switch off default
> highlighting... I hope we really need that degree.
>
> Ah, and thanks Dan for the regex and the link, I'll test that.
>
> --
> Jörn Zaefferer
>
> http://bassistance.de



[jQuery] Re: jqModal via POST ?

2007-04-30 Thread Erik Beeson


Sure, just use ajax, load the result into a div, and show the div with jqModal.

--Erik


On 4/30/07, Brian Cherne <[EMAIL PROTECTED]> wrote:

Has anyone implemented jqModal (or something like it) via the POST method?

I really enjoy how simple jqModal is for calling modal dialogs and I want to
use it on a secure web page. In order to get the right information from the
server I'll need to send in params... ideally params that are protected via
HTTPS wrapper (and not sent via plain-text GET URI).

Brian.



[jQuery] Detecting key presses.

2007-04-30 Thread MikeR

I am wondering if using the keyup() jQuery event handler on (for
example) and input field.. if there is a way to detect which key was
pressed? IE: keycode 38, 40, etc.



[jQuery] Re: Release: autocomplete 1.0 alpha

2007-04-30 Thread Shelane Enos

Also, a few other issues.

If the default caching is set at 10 and matcheSubset default is true, why is
it making a second call to the server when I add a new letter.

First input: cap
Additional letter: i

Then a new query goes out to the server:
http://education.llnl.gov/jQuery/pages/lookup.lasso?q=capi&limit=50

Second question: is there a way I can do max all?  It seems counter
intuitive if caching is used.  Unless it's set so that if caching is used,
only the final output is limited.

Third question: I have seen a few examples out there including these params:
highlight: false,
highlight: function(value) {
//alert(value);
return value;
},

But I don't see anything documenting these (in your documentation online).

Thanks.

On 4/30/07 2:05 PM, "Shelane" <[EMAIL PROTECTED]> wrote:

> 
> Jörn,
> 
> I believe I found a bug in the new autocompleter.  Line 157 has:
> var $input = $(input).attr("autocomplete",
> "off").addClass(options.inputClass);
> 
> This throws a javascript error if jQuery.noConflict() has been called:
> $(input).attr is not a function
> 
> changing it to var $input = jQuery(input).attr("autocomplete",
> "off").addClass(options.inputClass);
> 
> fixes the problem
> 
> On Apr 19, 11:08 am, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
>> Dan G. Switzer, II schrieb:>> What would be passed to the function?  The
>> containing li?  a jQuery object
 containing the containing li?  The HTML text?
>> 
>>> The source is available here:
>>> http://dev.jquery.com/browser/trunk/plugins/autocomplete/jquery.autoc...
>>> .js
>> 
>>> [...]
>> 
>>> At the moment it runs against li.innerHTML.
>> 
>> So far it was internal only, I'd pass the formatted string as the first
>> argument and the other stuff in addition.
>> Formatting would be very flexible then. Default takes a simple string
>> and adds simple highlighting. Then you can replace that simple string
>> with some custom formatting and default highlighting. Or you use
>> formatting and include highlighting and switch off default
>> highlighting... I hope we really need that degree.
>> 
>> Ah, and thanks Dan for the regex and the link, I'll test that.
>> 
>> --
>> Jörn Zaefferer
>> 
>> http://bassistance.de
> 
> 
> 


[jQuery] Re: Release: autocomplete 1.0 alpha

2007-04-30 Thread Shelane Enos

Forgot to add my example link:

http://education.llnl.gov/jQuery/ajax.html

Click auto complete (unknown if this is working at all in IE right now).
Definitely in FF.  Your plugin is the second example.


On 4/30/07 2:35 PM, "Shelane Enos" <[EMAIL PROTECTED]> wrote:

> 
> Also, a few other issues.
> 
> If the default caching is set at 10 and matcheSubset default is true, why is
> it making a second call to the server when I add a new letter.
> 
> First input: cap
> Additional letter: i
> 
> Then a new query goes out to the server:
> http://education.llnl.gov/jQuery/pages/lookup.lasso?q=capi&limit=50
> 
> Second question: is there a way I can do max all?  It seems counter
> intuitive if caching is used.  Unless it's set so that if caching is used,
> only the final output is limited.
> 
> Third question: I have seen a few examples out there including these params:
> highlight: false,
> highlight: function(value) {
> //alert(value);
> return value;
> },
> 
> But I don't see anything documenting these (in your documentation online).
> 
> Thanks.
> 
> On 4/30/07 2:05 PM, "Shelane" <[EMAIL PROTECTED]> wrote:
> 
>> 
>> Jörn,
>> 
>> I believe I found a bug in the new autocompleter.  Line 157 has:
>> var $input = $(input).attr("autocomplete",
>> "off").addClass(options.inputClass);
>> 
>> This throws a javascript error if jQuery.noConflict() has been called:
>> $(input).attr is not a function
>> 
>> changing it to var $input = jQuery(input).attr("autocomplete",
>> "off").addClass(options.inputClass);
>> 
>> fixes the problem
>> 
>> On Apr 19, 11:08 am, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
>>> Dan G. Switzer, II schrieb:>> What would be passed to the function?  The
>>> containing li?  a jQuery object
> containing the containing li?  The HTML text?
>>> 
 The source is available here:
 http://dev.jquery.com/browser/trunk/plugins/autocomplete/jquery.autoc...
 .js
>>> 
 [...]
>>> 
 At the moment it runs against li.innerHTML.
>>> 
>>> So far it was internal only, I'd pass the formatted string as the first
>>> argument and the other stuff in addition.
>>> Formatting would be very flexible then. Default takes a simple string
>>> and adds simple highlighting. Then you can replace that simple string
>>> with some custom formatting and default highlighting. Or you use
>>> formatting and include highlighting and switch off default
>>> highlighting... I hope we really need that degree.
>>> 
>>> Ah, and thanks Dan for the regex and the link, I'll test that.
>>> 
>>> --
>>> Jörn Zaefferer
>>> 
>>> http://bassistance.de
>> 
>> 
>> 
> 
> 


[jQuery] Re: Detecting key presses.

2007-04-30 Thread MikeR

Oops, sorry folks! I answered my own question. I should have
experimented a little more before posting :|.

In case anyone else happens to wonder how, here is a very basic
snippet:

$(document).ready(function() {
$('#test').keyup(function(e) {
alert("A key was pressed");
alert(e.keyCode);

switch(e.keyCode) {
case 38:
alert("You keyed up");
break;
case 40:
alert("You keyed down");
break;
}
});
});

On Apr 30, 3:31 pm, MikeR <[EMAIL PROTECTED]> wrote:
> I am wondering if using the keyup() jQuery event handler on (for
> example) and input field.. if there is a way to detect which key was
> pressed? IE: keycode 38, 40, etc.



[jQuery] Using a variable in a selector

2007-04-30 Thread poorgeek

I'm having the hardest time trying to figure out how to use a variable
in a selector. I have the following code that works as part of a basic
accordion menu but with a twist that if someone links to the page
using an internal link then that section of the menu defaults to open.

$(document).ready(function(){
  $('.accordionMenu dl').hide();
  if (window.location.hash) {
$(window.location.hash+' dl').show();
  }
...
}

Any ideas what I might be doing wrong or just haven't learned yet?

- Justin



[jQuery] Re: Release: autocomplete 1.0 alpha

2007-04-30 Thread Jörn Zaefferer


Shelane,

thanks for your reports! That helps a lot. In detail:

I believe I found a bug in the new autocompleter.  Line 157 has:
var $input = $(input).attr("autocomplete",
"off").addClass(options.inputClass);
  

Good catch, fixed.

If the default caching is set at 10 and matcheSubset default is true, why is
it making a second call to the server when I add a new letter.

First input: cap
Additional letter: i

Then a new query goes out to the server:

http://education.llnl.gov/jQuery/pages/lookup.lasso?q=capi&limit=50
  

That isn't supposed to happen, I'll need to check that.

Second question: is there a way I can do max all?  It seems counter
intuitive if caching is used.  Unless it's set so that if caching is used,
only the final output is limited.

Third question: I have seen a few examples out there including these params:
highlight: false,
highlight: function(value) {
//alert(value);
return value;
},

But I don't see anything documenting these (in your documentation online).
  
I haven't made a new release yet. To keep up-to-date with the latest 
revision you can get it directly from the repository: 
http://dev.jquery.com/browser/trunk/plugins/autocomplete/jquery.autocomplete.js?format=txt

The updated documentation is already there, but not very readable.

Forgot to add my example link:

http://education.llnl.gov/jQuery/ajax.html

Click auto complete (unknown if this is working at all in IE right now).
Definitely in FF.  Your plugin is the second example.
You may want to set the width of the displayed select box via the width 
option. That should help to avoid line breaks within one item.


Let me know if you notice anything else!

--
Jörn Zaefferer

http://bassistance.de



[jQuery] Getting the value of a select option by it's text

2007-04-30 Thread David


Hi,

I have an odd problem that I'm trying to solve with jQuery. I have 
select box with multiple options. Each of the options has a value, which 
is a database id, and text which is what is displayed in the select box, 
e.g.:



Please select:
---
Phone me for payment details
Secure Online Credit Card Payment


The nature of the application means that the database id for each of the 
options can change, while the text is unchanged. Because of this I need 
to find a way to select the option by its text instead of its value. For 
example I need to get the value for the option "Phone me for Payment 
details" which in this case would return 248. I could then use the value 
to select the option in the select element.


As far as I know I can't use the filter method to look for values, only 
to filter by properties or class, so something like this doesn't work:


$("#payment_method").filter("Phone me for payment details").val()

Can anyone think of a way I can do this with jQuery?

Regards,

David






[jQuery] Re: An idea for a jQuery core addition - Plugin Registering...

2007-04-30 Thread Jörn Zaefferer


Dan G. Switzer, II schrieb:

Guys,

It occurred to me last night with the growing list of plug-ins and the fact
that so many plug-ins now are dependant on other plug-ins, that we should
try to add a couple of functions to the jQuery core for registering plug-ins
and detecting if a plug-in has been registered.
  

I like the idea Dan!

So, to register a plug-in, you'd add something like this to a plug-in:
$.plugin.register("autocomplete");

And then when writing a plug-in that's dependent on some other plug-in, you
could check for loaded plug-ins:
$.plugin.find(["dimension","blockui","below"]);

I'm just thinking that maybe the core library needs something to help
plug-in authors to manage the dependencies of their plug-ins--in order to
help developers using their plug-ins.

If we at least added a few core methods for tracking, we could expand the
architecture later if need be.

Does this make sense to anyone else? 
  

Yes! How about this:

// Implementation:
$.require = function(names) {
$.each(names.split(","), function(i, n) {
if( !$.fn[n] || $[n] )
throw "required plugin " + n + " not found";
});
}
// Usage:
$.require("autocomplete,dimensions");

Of course this doesn't work with dimensions as it is. But the easiest 
approach would be to add this line to the dimensions plugin:


$.dimensions = {};

I don't see any need for explicit registration methods.

--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: Using a variable in a selector

2007-04-30 Thread Jörn Zaefferer


poorgeek schrieb:

I'm having the hardest time trying to figure out how to use a variable
in a selector. I have the following code that works as part of a basic
accordion menu but with a twist that if someone links to the page
using an internal link then that section of the menu defaults to open.

$(document).ready(function(){
  $('.accordionMenu dl').hide();
  if (window.location.hash) {
$(window.location.hash+' dl').show();
  }
...
}

Any ideas what I might be doing wrong or just haven't learned yet?
  
Can you provide a bit more information? What is window.location.hash 
supposed to contain? How are the links looking like?


--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: Getting the value of a select option by it's text

2007-04-30 Thread Jörn Zaefferer


David,

Can anyone think of a way I can do this with jQuery?

have you check the contains method?
http://docs.jquery.com/DOM/Traversing#contains.28_str_.29

That should work for your case.

--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: Release: autocomplete 1.0 alpha

2007-04-30 Thread Shelane Enos

Ok, I tried the width thing by initially putting "300px" and nothing
happened.  Then I entered 300 and it worked fine.  Can you place in the
documentation the expected value type (an integer value).  Or maybe allow
people to set measurement types if you detect it's not an integer.

I don't notice my little indicator when it's doing the lookup.  The file
that I have in my css file is there.  Maybe my results are coming back too
fast :-)

Just want to make the comment that I'm glad you're working on this.  I can't
wait to fully abandon my script.aculo.us implementation and not ever have to
worry about the competing libraries again :-) or the super bloated prototype
just to have one silly little piece of functionality.


On 4/30/07 2:55 PM, "Jörn Zaefferer" <[EMAIL PROTECTED]> wrote:

> 
> Shelane,
> 
> thanks for your reports! That helps a lot. In detail:
>> I believe I found a bug in the new autocompleter.  Line 157 has:
>> var $input = $(input).attr("autocomplete",
>> "off").addClass(options.inputClass);
>>   
> Good catch, fixed.
>> If the default caching is set at 10 and matcheSubset default is true, why is
>> it making a second call to the server when I add a new letter.
>> 
>> First input: cap
>> Additional letter: i
>> 
>> Then a new query goes out to the server:
>> http://education.llnl.gov/jQuery/pages/lookup.lasso?q=capi&limit=50
>>   
> That isn't supposed to happen, I'll need to check that.
>> Second question: is there a way I can do max all?  It seems counter
>> intuitive if caching is used.  Unless it's set so that if caching is used,
>> only the final output is limited.
>> 
>> Third question: I have seen a few examples out there including these params:
>> highlight: false,
>> highlight: function(value) {
>> //alert(value);
>> return value;
>> },
>> 
>> But I don't see anything documenting these (in your documentation online).
>>   
> I haven't made a new release yet. To keep up-to-date with the latest
> revision you can get it directly from the repository:
> http://dev.jquery.com/browser/trunk/plugins/autocomplete/jquery.autocomplete.j
> s?format=txt
> The updated documentation is already there, but not very readable.
>> Forgot to add my example link:
>> 
>> http://education.llnl.gov/jQuery/ajax.html
>> 
>> Click auto complete (unknown if this is working at all in IE right now).
>> Definitely in FF.  Your plugin is the second example.
> You may want to set the width of the displayed select box via the width
> option. That should help to avoid line breaks within one item.
> 
> Let me know if you notice anything else!



[jQuery] Re: An idea for a jQuery core addition - Plugin Registering...

2007-04-30 Thread Brandon Aaron


I believe Yehuda has been working on something like Dan describes:
http://dev.jquery.com/browser/branches/yehuda-dev/register.js

I think I like what Jörn presents but not the name. It makes me think
it would load the necessary files. Maybe $.required().

--
Brandon Aaron

On 4/30/07, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:


Dan G. Switzer, II schrieb:
> Guys,
>
> It occurred to me last night with the growing list of plug-ins and the fact
> that so many plug-ins now are dependant on other plug-ins, that we should
> try to add a couple of functions to the jQuery core for registering plug-ins
> and detecting if a plug-in has been registered.
>
I like the idea Dan!
> So, to register a plug-in, you'd add something like this to a plug-in:
> $.plugin.register("autocomplete");
>
> And then when writing a plug-in that's dependent on some other plug-in, you
> could check for loaded plug-ins:
> $.plugin.find(["dimension","blockui","below"]);
>
> I'm just thinking that maybe the core library needs something to help
> plug-in authors to manage the dependencies of their plug-ins--in order to
> help developers using their plug-ins.
>
> If we at least added a few core methods for tracking, we could expand the
> architecture later if need be.
>
> Does this make sense to anyone else?
>
Yes! How about this:

// Implementation:
$.require = function(names) {
$.each(names.split(","), function(i, n) {
if( !$.fn[n] || $[n] )
throw "required plugin " + n + " not found";
});
}
// Usage:
$.require("autocomplete,dimensions");

Of course this doesn't work with dimensions as it is. But the easiest
approach would be to add this line to the dimensions plugin:

$.dimensions = {};

I don't see any need for explicit registration methods.

--
Jörn Zaefferer

http://bassistance.de




[jQuery] Re: Release: autocomplete 1.0 alpha

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

Shelane,

>I don't notice my little indicator when it's doing the lookup.  The file
>that I have in my css file is there.  Maybe my results are coming back too
>fast :-)

The odds are you the path you have in your CSS to the indicator icon is
wrong. Remember the image path is relative from the CSS file, not the html
page the CSS page is called from. 

I'd double check your CSS.

-Dan



[jQuery] Re: Release: autocomplete 1.0 alpha

2007-04-30 Thread Shelane Enos

That's why I did this:
.ac_loading {
background: ('/resources/images/indicator.gif') right center no-repeat;
}

On 4/30/07 3:42 PM, "Dan G. Switzer, II" <[EMAIL PROTECTED]> wrote:

> 
> Shelane,
> 
>> I don't notice my little indicator when it's doing the lookup.  The file
>> that I have in my css file is there.  Maybe my results are coming back too
>> fast :-)
> 
> The odds are you the path you have in your CSS to the indicator icon is
> wrong. Remember the image path is relative from the CSS file, not the html
> page the CSS page is called from.
> 
> I'd double check your CSS.
> 
> -Dan
> 
> 
> 


[jQuery] Multiple draggable (interface) drag/drop question

2007-04-30 Thread dennis

I have gotten drag/ drop working with one draggable.
I need to know the right way to do multiple draggables.

I have a gallery app that will display rows of thumbnail images,
and I need to be able to drag some subset of those into
the dropbox.

I have code working, like that below. I *CAN* make multiple
copies of the Draggable and the Droppable calls to handle
the multiple draggable thumbnails (I've tried, that works),
but that seems klunkey to me. If there are, say, 20 thumbs
on a page, that's 20 Draggable calls, 20 Droppable calls

Is there a trimmer, better approach?


/dennis

jQuery 1.1, interface 1.2
=
JAVASCRIPT:
$(document).ready(
function() {

 $('#drag1').Draggable(
  {
   settings...
  }
 );

 $('#drag2').Draggable(
  {
   settings...
  }
 );

 $('#dropbox').Droppable(
  {
   settings...
   ondrop:  function (drag1) {
 var PhotoSrc = $('img',drag1).attr('src'); //
 alert( PhotoSrc );
 },
  }
  );

 $('#dropbox').Droppable(
  {
   settings...
   ondrop:  function (drag2) {
 var PhotoSrc = $('img',drag2).attr('src'); //
 alert( PhotoSrc );
 },
  }
  );
}
);
=
HTML:
Drop the photo in here



  


  




[jQuery] Re: jqModal via POST ?

2007-04-30 Thread Brian Cherne

I basically have a ton of modal dialogs, some will require GET, some will
require POST, and my initial thinking is to treat them all the same (send
them all to jqModal). Then hack the plug-in (add a setting/configurable
option) to strip params from the HREF and send them via POST. It wouldn't be
too hard to extend jqModal to handle this... just wondering if someone else
has done it already to save me the trouble... ?

Or I could go down the route you suggest and have all my POST requests go
through a different mechanism before calling jqModal.

Brian.

On 4/30/07, Erik Beeson <[EMAIL PROTECTED]> wrote:



Sure, just use ajax, load the result into a div, and show the div with
jqModal.

--Erik


On 4/30/07, Brian Cherne <[EMAIL PROTECTED]> wrote:
> Has anyone implemented jqModal (or something like it) via the POST
method?
>
> I really enjoy how simple jqModal is for calling modal dialogs and I
want to
> use it on a secure web page. In order to get the right information from
the
> server I'll need to send in params... ideally params that are protected
via
> HTTPS wrapper (and not sent via plain-text GET URI).
>
> Brian.
>



[jQuery] Re: Release: autocomplete 1.0 alpha

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

Shelane,

>That's why I did this:
>.ac_loading {
>background: ('/resources/images/indicator.gif') right center no-repeat;
>}

Firefox is reporting the .ac_loading class as:

.ac_loading {
}

I'm looking at: http://education.llnl.gov/jQuery/ajax.html

-Dan



[jQuery] Re: An idea for a jQuery core addition - Plugin Registering...

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

Jörn,

>// Implementation:
>$.require = function(names) {
>   $.each(names.split(","), function(i, n) {
>   if( !$.fn[n] || $[n] )
>   throw "required plugin " + n + " not found";
>   });
>}
>// Usage:
>$.require("autocomplete,dimensions");

I was thinking of using an array instead of splitting a string. The reason
is, I could see eventually being able to define more information about a
plugin, such as a version number.

/*
Require:
Autocomplete v1.2
Dimensions (any version)
*/
$.require([["autocomplete, 1.2], "dimensions"];

Or something like that...

-Dan



[jQuery] Re: An idea for a jQuery core addition - Plugin Registering...

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

Brandon,

>I believe Yehuda has been working on something like Dan describes:
>http://dev.jquery.com/browser/branches/yehuda-dev/register.js
>
>I think I like what Jörn presents but not the name. It makes me think
>it would load the necessary files. Maybe $.required().

I was just thinking of something that would be extremely
lightweight--something that could be done with minimal code.

-Dan



[jQuery] Re: Release: autocomplete 1.0 alpha

2007-04-30 Thread Shelane Enos

Yes, I had a malformed style :-(

I fixed it.  I should have checked with firebug.  That's for the extra pair
of eyes.


On 4/30/07 4:11 PM, "Dan G. Switzer, II" <[EMAIL PROTECTED]> wrote:

> 
> Shelane,
> 
>> That's why I did this:
>> .ac_loading {
>>background: ('/resources/images/indicator.gif') right center no-repeat;
>> }
> 
> Firefox is reporting the .ac_loading class as:
> 
> .ac_loading {
> }
> 
> I'm looking at: http://education.llnl.gov/jQuery/ajax.html
> 
> -Dan
> 
> 
> 


[jQuery] Re: Getting the value of a select option by it's text

2007-04-30 Thread David

Hi,

Thanks for the suggestion Jorn.

That didn't work for me at first, it just returned me the object I 
already had, ie. the select element. But when I changed the selector to 
"#payment_method option" the magic started to happen.


Thanks again,

David

Jörn Zaefferer wrote:


David,

Can anyone think of a way I can do this with jQuery?

have you check the contains method?
http://docs.jquery.com/DOM/Traversing#contains.28_str_.29

That should work for your case.



[jQuery] Re: Keyboard shortcuts

2007-04-30 Thread DaveG


Did you get a chance to work on this? No hurry, I'd just like to use it 
if it's available.


 ~ ~ Dave

Gilles (Webunity) wrote:

Yes i've ported this to jQuery, i'll add it to SVN tonight. It has
thesame options as the keyboard_shortcuts, but i've improved (cleaned
up) the code a lot. You can bind any combination you want.






[jQuery] .attr()

2007-04-30 Thread Ariel Jakobovits

I am looking for an explanation as to why .attr('id') executed on an array of 
jQuery elements does not return an array of ids.


[jQuery] Re: .attr()

2007-04-30 Thread Mike Alsup


That's just not what it does.  Getter methods like that generally
return the value for the first matched element.  If you want a plugin
to return all the values in an array you can write it like this
(untested):

jQuery.fn.attrs = function(key,val) {
   if (val != undefined)
   return this.each(function() {
   $(this).attr(key,val);
   });
   var a = [];
   this.each(function() { a.push($(this).attr(key)); });
   return a;
};

And then call it like this:

var arr = $('div').attrs("id");

Mike



On 4/30/07, Ariel Jakobovits <[EMAIL PROTECTED]> wrote:


I am looking for an explanation as to why .attr('id') executed on an array of 
jQuery elements does not return an array of ids.



[jQuery] serialize() output in key/value pairs

2007-04-30 Thread [EMAIL PROTECTED]

Is there a way to easily convert a string of parameters
[name=John&location=Boston] into key/value pairs [{name: "John",
location: "Boston"}]?  I found the FastSerialize plugin, but it claims
that the native one is much faster, and doesn't require the extra
plugin code.  What I want to be able to do, is just do
$.get("page.php",$('input').serialize()), just like you can in the
FastSerialize plugin.



[jQuery] Re: serialize() output in key/value pairs

2007-04-30 Thread Erik Beeson


How about (untested):

$.get("page.php?" + $("input").serialize());

--Erik

On 4/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


Is there a way to easily convert a string of parameters
[name=John&location=Boston] into key/value pairs [{name: "John",
location: "Boston"}]?  I found the FastSerialize plugin, but it claims
that the native one is much faster, and doesn't require the extra
plugin code.  What I want to be able to do, is just do
$.get("page.php",$('input').serialize()), just like you can in the
FastSerialize plugin.




[jQuery] Re: Multiple draggable (interface) drag/drop question

2007-04-30 Thread Erik Beeson


I don't get what the problem is. Are you wanting different settings on
the draggables? If the issues is just how to apply Draggable to bunch
of elements, just do $('.dropaccept').Draggable(...)

Your droppable settings appear to be identical except for the function
parameter name, which is an irrelevant difference. You only need to
apply Droppable once anyways...

--Erik

On 4/30/07, dennis <[EMAIL PROTECTED]> wrote:


I have gotten drag/ drop working with one draggable.
I need to know the right way to do multiple draggables.

I have a gallery app that will display rows of thumbnail images,
and I need to be able to drag some subset of those into
the dropbox.

I have code working, like that below. I *CAN* make multiple
copies of the Draggable and the Droppable calls to handle
the multiple draggable thumbnails (I've tried, that works),
but that seems klunkey to me. If there are, say, 20 thumbs
on a page, that's 20 Draggable calls, 20 Droppable calls

Is there a trimmer, better approach?


/dennis

jQuery 1.1, interface 1.2
=
JAVASCRIPT:
$(document).ready(
function() {

 $('#drag1').Draggable(
  {
   settings...
  }
 );

 $('#drag2').Draggable(
  {
   settings...
  }
 );

 $('#dropbox').Droppable(
  {
   settings...
   ondrop:  function (drag1) {
 var PhotoSrc = $('img',drag1).attr('src'); //
 alert( PhotoSrc );
 },
  }
  );

 $('#dropbox').Droppable(
  {
   settings...
   ondrop:  function (drag2) {
 var PhotoSrc = $('img',drag2).attr('src'); //
 alert( PhotoSrc );
 },
  }
  );
}
);
=
HTML:
Drop the photo in here



  


  





[jQuery] Re: Using a variable in a selector

2007-04-30 Thread Justin Stockton

window.location returns the current URL in the browser's locator.
window.location.hash refers to the specific part of the page that the
URL refers too (the part that follow the #). So if you're visiting
http://example.org/index.html#foo then window.location would return
http://example.org/index.html#foo while window.location.hash returns
only #foo. You'll notice that the hash looks exactly like an ID
selector which I am hoping to use on the following code:


Some Menu Item




[repeat for each item in the menu each with a different value for ID]

Now if I am able to use the value of window.location.hash as a
selector then I should get something similar to $('#foo dl').show().
Unfortunately though it appears that the jQuery method ($) only wants
to accept strings and objects.

On Apr 30, 6:06 pm, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> poorgeek schrieb:> I'm having the hardest time trying to figure out how to 
> use a variable
> > in a selector. I have the following code that works as part of a basic
> > accordion menu but with a twist that if someone links to the page
> > using an internal link then that section of the menu defaults to open.
>
> > $(document).ready(function(){
> >   $('.accordionMenu dl').hide();
> >   if (window.location.hash) {
> > $(window.location.hash+' dl').show();
> >   }
> > ...
> > }
>
> > Any ideas what I might be doing wrong or just haven't learned yet?
>
> Can you provide a bit more information? What is window.location.hash
> supposed to contain? How are the links looking like?
>
> --
> Jörn Zaefferer
>
> http://bassistance.de



[jQuery] Re: .attr()

2007-04-30 Thread Ariel Jakobovits

Thanks for the response Mike.

That "Getter methods like that generally return the value for the first matched 
element" doesn't make sense to me. Why? There's no need for this altered 
behavior. It breaks the jQuery model in my opinion. Unless I am missing 
something.

Everything else in jQuery operates on arrays. I guess I am looking for someone 
to explain WHY the 'getter' functions operate this way from a design 
perspective.

- Original Message 
From: Mike Alsup <[EMAIL PROTECTED]>
To: jquery-en@googlegroups.com
Sent: Monday, April 30, 2007 8:20:54 PM
Subject: [jQuery] Re: .attr()


That's just not what it does.  Getter methods like that generally
return the value for the first matched element.  If you want a plugin
to return all the values in an array you can write it like this
(untested):

jQuery.fn.attrs = function(key,val) {
if (val != undefined)
return this.each(function() {
$(this).attr(key,val);
});
var a = [];
this.each(function() { a.push($(this).attr(key)); });
return a;
};

And then call it like this:

var arr = $('div').attrs("id");

Mike



On 4/30/07, Ariel Jakobovits <[EMAIL PROTECTED]> wrote:
>
> I am looking for an explanation as to why .attr('id') executed on an array of 
> jQuery elements does not return an array of ids.
>


[jQuery] Re: .attr()

2007-04-30 Thread Karl Rudd


It does "break the model" in some sense, but I think that is only
because the API seems to be built from actual use rather than on a
theorectical structure.

I can't honestly remember ever needing a list of the attributes of the
objects I have selected. Mostly because you usually want to act on
each object based on it's attributes. Most of the time I've needed to
iterate through the list of objects (with each() or filter()),
checking some attribute and doing something based on that.

Karl Rudd

On 5/1/07, Ariel Jakobovits <[EMAIL PROTECTED]> wrote:


Thanks for the response Mike.

That "Getter methods like that generally return the value for the first matched 
element" doesn't make sense to me. Why? There's no need for this altered behavior. 
It breaks the jQuery model in my opinion. Unless I am missing something.

Everything else in jQuery operates on arrays. I guess I am looking for someone 
to explain WHY the 'getter' functions operate this way from a design 
perspective.

- Original Message 
From: Mike Alsup <[EMAIL PROTECTED]>
To: jquery-en@googlegroups.com
Sent: Monday, April 30, 2007 8:20:54 PM
Subject: [jQuery] Re: .attr()


That's just not what it does.  Getter methods like that generally
return the value for the first matched element.  If you want a plugin
to return all the values in an array you can write it like this
(untested):

jQuery.fn.attrs = function(key,val) {
if (val != undefined)
return this.each(function() {
$(this).attr(key,val);
});
var a = [];
this.each(function() { a.push($(this).attr(key)); });
return a;
};

And then call it like this:

var arr = $('div').attrs("id");

Mike



On 4/30/07, Ariel Jakobovits <[EMAIL PROTECTED]> wrote:
>
> I am looking for an explanation as to why .attr('id') executed on an array of 
jQuery elements does not return an array of ids.
>



[jQuery] Re: An idea for a jQuery core addition - Plugin Registering...

2007-04-30 Thread Christof Donat

Hi,

> // Implementation:
> $.require = function(names) {
>   $.each(names.split(","), function(i, n) {
>   if( !$.fn[n] || $[n] )
>   throw "required plugin " + n + " not found";
>   });
> }
> // Usage:
> $.require("autocomplete,dimensions");

Why not use OpenAjax?

If you would like to load your js files that way as well, your API looks much 
like the jsPax API. I was planing to make an "OpenAjax"-package for jsPax 
that uses the jsPax package information, but did not get around to do it.

> $.dimensions = {};

OK, here we use $package('dimensions',{}) with jsPax - not really more 
complicated.

Christof



[jQuery] OT: Suppress Apache Authentication

2007-04-30 Thread Sean Catchpole


Simple problem:

   I add an image from an external site to the page and sometimes the
site is protected by Apache authentication so it pops up a login box.
This is really annoying, any ideas on how this can be suppressed. All
creative suggestions accepted.

~Sean


[jQuery] demo request: Page Content Menu

2007-04-30 Thread Ariel Jakobovits

Hey Joel, :), how about a demo page for 'Page Content Menu'?