[Proto-Scripty] Re: drag between sortables - how to pass sortable id to db

2009-07-24 Thread DJ Mangus
you could probably just add the id to the params object directly before you
pass it to the Ajax.Request

On Thu, Jul 23, 2009 at 12:13 PM, johnb  wrote:

>
> I have a small app using sortables where you can re-order within them
> but also drag them between different sortables, saving both position
> within and which sortable they are in to a db.
>
> My problem: getting the order within each sortable is passing ok but I
> can't find the way to get the id of the sortable to pass.
>
> For example, the sortable is created as so:
> 
>// Sortable.create('group_1',{tag:'div',dropOnEmpty: true, containment:
> sections,only:'lineitem',onUpdate:updateList});
>Sortable.create('group_'2',{tag:'div',dropOnEmpty: true,
> containment:
> sections,only:'lineitem',onUpdate:updateList});
>Sortable.create('page',
> {tag:'div',only:'section'||'mainsection',handle:'handle'});
>// ]]>
>  
>
> Then when drag/drop the JS is activated:
>function updateList(container) {
>var url = 'ajax.php';
>var params = Sortable.serialize(container.id)
>var ajax = new Ajax.Request(url,{
>method: 'post',
>parameters: params,
>});
>}
>
> This calls the Ajax which uses:
>$demo->updateList($_POST['group_1']);
>
> This passes all the group1[]=1 info ok. I just can't figure out how to
> have that Ajax use something like $demo->updateList($_POST
> [$x_groupvariable]); since I can't figure out how to assign the id of
> the sortable. Any help would be supremely appreciated.
>
> John
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Which parameters are affected by Effect.Move()

2009-07-24 Thread DJ Mangus

If you know the original values of x and y you shouldn't have to know
the current value to use effect.Move if you use mode: 'absolute'
unless I am misunderstanding what you are trying to do, can you
explain in a little bit more detail?  (an example would be nice)

On Thu, Jul 23, 2009 at 11:20 AM, tej  wrote:
>
> Hi,
>
> I have a project where I have 3 DIVs one on top of another and I have
> 3 anchors to show the contents of each DIV.
> if I click "show 1" then divs 2 and 3 move to show div 1's content
>
> now if i click "show 2" divs 2 and 3 move back to original position
> and followed by moving div 3 to show div2 content
>
> in order to do this i need to know the current x and y values of div2
> to move back to its original value.
>
> or is there any way to do this??
>
> i have used getDimentions and getStyles() but those values remain the
> same as i defined in the beginning..
> If so.. what values of the element are changed when i use effect.Move
> ();
>
> any help is appreciated
> thanks in advance
> ravi
>
>
>
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: how to use scripts without clicks

2009-07-28 Thread DJ Mangus

document.observe("dom:loaded", function() {
  // initially hide all containers for tab content
  $$('div.tabcontent').invoke('hide');
});

Note: you can of course do anything you want in that function.  The
function runs when everything is loaded and available to javascript.

On Tue, Jul 28, 2009 at 12:02 PM, dmcglone wrote:
>
> Hi everyone,
>
> I'm new to scriptaculous and javascript. I've followed the examples
> on
> scriptaculous web site, but I can't find any examples implement the
> events
> without them being links, such as when the page loads.
>
> currently what I'm trying to do is make a block of text fade in on the
> page
> when it loads. I've already got 1 script that I am playing with that
> zooms the
> header in, and the only way It works is to add a tag to the body tag
> of the
> document This seems to not allow me to add other stuff to the page
> unless they
> are links.
>
> My goal is to learn how to load more than 1 element on a page with 2
> or more
> effects.
>
> My Google searches have turned up fruitless, does anyone know of any
> good
> tutorials or such?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: how to use scripts without clicks

2009-07-29 Thread DJ Mangus

OK, I'll explain this code, hopefully it's what you want.

Observe is a prototype method to set event callbacks.  So,
document.observe sets an event callback on the document.  It takes two
arguments, the event name and a function (either name or literal as is
used in the example).  We are setting a callback for "dom:loaded"
which is an event prototype adds to the document to indicate that all
nodes are available to javascript.  Inside that function you can place
any javascript you want called after the DOM is available.  For
example, anything that you want to use script.aculo.us effects on you
can call with like this:  new Effect.Appear("idhere"), for multiple
nodes you can call them all within that function.  If you want more
effects on the same node but want them all to run at once, just call
them all in that function.  Fill it out with all the onload effects
you want.  If on the other hand you want them to run one at a time on
the node, then you want to use the afterFinish callback like this:
new Effect.Appear("idhere", { afterFinish: function(effect) { new
Effect.Highlight(effect.element) } })

Hopefully this will get you headed in the right direction.

On Tue, Jul 28, 2009 at 12:09 PM, DJ Mangus wrote:
> document.observe("dom:loaded", function() {
>  // initially hide all containers for tab content
>  $$('div.tabcontent').invoke('hide');
> });
>
> Note: you can of course do anything you want in that function.  The
> function runs when everything is loaded and available to javascript.
>
> On Tue, Jul 28, 2009 at 12:02 PM, dmcglone wrote:
>>
>> Hi everyone,
>>
>> I'm new to scriptaculous and javascript. I've followed the examples
>> on
>> scriptaculous web site, but I can't find any examples implement the
>> events
>> without them being links, such as when the page loads.
>>
>> currently what I'm trying to do is make a block of text fade in on the
>> page
>> when it loads. I've already got 1 script that I am playing with that
>> zooms the
>> header in, and the only way It works is to add a tag to the body tag
>> of the
>> document This seems to not allow me to add other stuff to the page
>> unless they
>> are links.
>>
>> My goal is to learn how to load more than 1 element on a page with 2
>> or more
>> effects.
>>
>> My Google searches have turned up fruitless, does anyone know of any
>> good
>> tutorials or such?
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: how to use scripts without clicks

2009-07-29 Thread DJ Mangus

> 
>
> document.observe("dom:loaded",
>
>   function ShowEffect(){
>       new Effect.Appear(Show,
>       {duration:3});
>   }
>
>   
> 
> 
>
> 
>     alt="" />
> 
>
>
> --

Quite a few errors there, first off you are naming the function, you
cannot do that if you are using a function literal.  Secondly for
Effect.Appear you are probably best off using it directly on the DOM
element after it's been extended with $().  And lastly your braces and
parentheses are incorrect.  The following should work (though I
drycoded it).

document.observe("dom:loaded", function() {
   $('show').Appear({ duration: 3.0 });
});

I'm not 100% sure that Effect.Appear will work properly with an inline
style like that, if not then remove the inline style and call the
document.observe thusly to hide it before rendering and then fade it
in over 3 seconds:

document.observe("dom:loaded", function() {
   $('show').Hide();
   $('show').Appear({ duration: 3.0 });
});

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX

2009-08-03 Thread DJ Mangus

Is the password-form submit button a return from procBasketEmail.php?
if so then you should observe it in the OnSuccess callback.  If that
isn't correct chalk it up to me checking this moments after awakening.

On Mon, Aug 3, 2009 at 6:23 AM, Ash wrote:
>
> Thanks for the help, I just tried replacing Event.stop(e); with return
> false; in the function but it still submits the form.
>
> I would prefer to do it the new way anyway, if you would be able to
> help me...
>
> The first function is called from Event.observe('email-form',
> 'submit', callProcBasketEmail); which is within a function that is
> called when the document loads.
>
> The question is, where to put the event observe to watch the second
> form.
>
> My first instinct would be to put it in the function which outputs the
> form EG
>
>
> function callProcBasketEmail(e) {
>  var pars = Form.serialize('email-form');
>  var myAjax = new Ajax.Updater('email-response',
> 'procBasketEmail.php', {method: 'post', parameters: pars});
>  Event.observe('password-form', 'submit', callProcBasketPassword);
>  Event.stop(e);
> }
>
> (line added just after the ajax function has drawn 'password-form' to
> the screen)
>
> But this stops the whole function from working - where should the
> observe line be placed to ensure it will work properly?
>
> Thanks in advance, I think once I get over these initial few hurdles
> of getting to grips with good practices, I will be fine!
>
> Ashley
>
>
> Here is the javascript in full:
>
>
>
> // Attach handler to window load event
> Event.observe(window, 'load', init, false);
>
> function init(){
>    Event.observe('email-form', 'submit', callProcBasketEmail);
> }
>
> function callProcBasketEmail(e) {
>  var pars = Form.serialize('email-form');
>  var myAjax = new Ajax.Updater('email-response',
> 'procBasketEmail.php', {method: 'post', parameters: pars});
>  Event.observe('password-form', 'submit', callProcBasketPassword);
>  Event.stop(e);
> }
>
> function callProcBasketPassword(e) {
>  var pars = Form.serialize('password-form');
>  alert(pars);
>  var myAjax = new Ajax.Updater('password-response',
> 'procBasketPassword.php', {method: 'post', parameters: pars});
>  Event.stop(e);
> }
>
> On Aug 2, 11:19 am, "T.J. Crowder"  wrote:
>> Hi Ashley,
>>
>> In the one that's not working, you're using what's called a "DOM0-
>> style" handler -- that's where you're attaching the handler the old-
>> fashioned way, by using an attribute on the form element:
>>
>> >    > > action="procBasketPasswordNoJS.php" method="post">
>>
>> Event.stop works only for handlers registered with more modern methods
>> like the Event.observe you used with your first form.
>>
>> To correct the problem, I'd recommend using Event.observe to set up
>> the handler for the second form as you did with the first.  If there's
>> a reason you can't do that, though, the "DOM0" equivalent of
>> Event.stop is to return false from callProcBasketPassword.
>>
>> HTH,
>> --
>> T.J. Crowder
>> tj / crowder software / com
>> Independent Software Engineer, consulting services available
>>
>> On Aug 1, 4:35 pm, Ash  wrote:
>>
>> > Hi, I just started my first experiment with AJAX today. Got the basics
>> > working, but when I add a tiny bit more complexity I have a problem,
>> > Event.stop doesn't work properly for me.
>>
>> > I've followed a couple of basic tutorials to submit an e-mail address
>> > to a PHP script, the PHP looks up the e-mail address and if it finds
>> > it, it shows an input to enter a password. This all works fine except
>> > the function with the ajax call to the password PHP script does not
>> > stop the form submitting.
>>
>> > There is probably something very obvious I am doing wrong so hopefully
>> > someone will be able to spot this a mile away! :)
>>
>> > The HTML looks like this, once the second form has been displayed
>>
>> > 
>> > 
>> > 
>> > 
>>
>> > 
>> >    we have saved details on file for you, please enter your password
>> > below to retrieve them
>> >    
>> >    > > action="procBasketPasswordNoJS.php" method="post">
>> >         > > name="password"/>
>> >         > > value="Submit"/>
>> >    
>> > 
>>
>> > 
>> > 
>>
>> > Here is the ajax.js
>>
>> > // Attach handler to window load event
>> > Event.observe(window, 'load', init, false);
>>
>> > function init(){
>> >  Event.observe('email-form', 'submit', callProcBasketEmail);
>>
>> > }
>>
>> > function callProcBasketEmail(e) {
>> >  var pars = Form.serialize('email-form');
>> >  var myAjax = new Ajax.Updater('email-response',
>> > 'procBasketEmail.php', {method: 'post', parameters: pars});
>> >  Event.stop(e);
>>
>> > }
>>
>> > function callProcBasketPassword(e) {
>> >  var pars = Form.serialize('password-form');
>> > var myAjax = new Ajax.Updater('password-response',
>> > 'procBasketPassword.php', {method: 'post', parameters: pars});
>> >  Event.stop(e);
>>
>> > }
>>
>> > When I step through in Firebug I can see that the password-response
>> > div gets filled with the results of the procBas

[Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX

2009-08-05 Thread DJ Mangus

Try adding e.preventDefault(); instead of Event.stop(e) and let me
know if that works?

On Tue, Aug 4, 2009 at 4:55 PM, Ash wrote:
> function callProcBasketEmail(e) {
>    var pars = Form.serialize('email-form');
>    var myAjax = new Ajax.Updater('email-response',
> 'procBasketEmail.php', {
>        method: 'post',
>        parameters: pars,
>        onSuccess: function(response)
>        {
>            Event.observe('password-form', 'submit',
> callProcBasketPassword);
>        }
>    });
>    Event.stop(e);
> }
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Browser scroller position after Ajax.Update

2009-08-05 Thread DJ Mangus

Maybe this might help. http://www.prototypejs.org/api/element/scrollto

On Wed, Aug 5, 2009 at 1:33 PM, DJJQ wrote:
>
> Oh my god my english was terrible in my post, sorry about that.
> I'll try to explain the problem again:
> On my php page I have a link a long way down the page, so users have
> to scroll down a bit. the link triggers an ajax.update on the page.
> When users press the link the browser returns to the top of the page.
> How do I restore the browser position to where the link is? (So the
> scroller position remains unchanged when calling ajax update)
>
>
>
> On Aug 5, 9:45 pm, "Alex McAuley" 
> wrote:
>> Can you explain it a bit better please... i cant really understand what you
>> mean by that
>>
>> Thanks
>>
>> Alex Mcauleyhttp://www.thevacancymarket.com
>>
>>
>>
>> - Original Message -
>> From: "DJJQ" 
>> To: "Prototype & script.aculo.us" 
>> Sent: Wednesday, August 05, 2009 8:22 PM
>> Subject: [Proto-Scripty] Browser scroller position after Ajax.Update
>>
>> > Hello.
>> > My problem when is apparent on my page. The div to be updated (and
>> > link) are a long way down the page so users have to scroll down.
>> > When they press the link and thus update the div the browsers scroller
>> > returns to top, forcing the user to scroll down again to the div.
>> > Is there any "quickfix" (like option I have missed) or more advanced
>> > solution?
>>
>> > Best Regards and Thanks in Advance, Joel
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX

2009-08-05 Thread DJ Mangus

Are you getting any Javascript errors?  Note: firefox and firebug is
your friend. Don't forget to break on all errors.

On Wed, Aug 5, 2009 at 11:22 AM, Ash wrote:
>
> Hi, I wasn't sure whether you meant in the 1st or second function, but
> it doesn't make a difference in either.
>
> I think it is the Event.observe('password-form', 'submit',
> callProcBasketPassword); which is not working properly, although I
> don't know how to debug it
>
>
> On Aug 5, 6:48 pm, DJ Mangus  wrote:
>> Try adding e.preventDefault(); instead of Event.stop(e) and let me
>> know if that works?
>>
>> On Tue, Aug 4, 2009 at 4:55 PM, Ash wrote:
>> > function callProcBasketEmail(e) {
>> >    var pars = Form.serialize('email-form');
>> >    var myAjax = new Ajax.Updater('email-response',
>> > 'procBasketEmail.php', {
>> >        method: 'post',
>> >        parameters: pars,
>> >        onSuccess: function(response)
>> >        {
>> >            Event.observe('password-form', 'submit',
>> > callProcBasketPassword);
>> >        }
>> >    });
>> >    Event.stop(e);
>> > }
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX

2009-08-05 Thread DJ Mangus

 when Firebug breaks on the error, check the DOM tab to see the
state at that particular moment.

On Wed, Aug 5, 2009 at 2:05 PM, Alex
McAuley wrote:
>
> Seems the element does not exist...
>
> Does it exist in the DOM ?
>
>
> Alex Mcauley
> http://www.thevacancymarket.com
> - Original Message -
> From: "Ash" 
> To: "Prototype & script.aculo.us" 
> Sent: Wednesday, August 05, 2009 10:04 PM
> Subject: [Proto-Scripty] Re: Beginners question, trouble with Event.stop in
> AJAX
>
>
>
> When I set firebug to break on all errors...
>
> Submit the first form and I get (from prototype.js)
>
>  function getEventID(element) {
> element is null3936 if (element._prototypeEventID) return
> element._prototypeEventID[0]; (element is null error)
>
> if I step past it and submit the second form I get the same error
> again
>
> Unfortunately I don't know why both errors are caused, can you help
> please?
>
> On Aug 5, 9:40 pm, DJ Mangus  wrote:
>> Are you getting any Javascript errors? Note: firefox and firebug is
>> your friend. Don't forget to break on all errors.
>>
>> On Wed, Aug 5, 2009 at 11:22 AM, Ash wrote:
>>
>> > Hi, I wasn't sure whether you meant in the 1st or second function, but
>> > it doesn't make a difference in either.
>>
>> > I think it is the Event.observe('password-form', 'submit',
>> > callProcBasketPassword); which is not working properly, although I
>> > don't know how to debug it
>>
>> > On Aug 5, 6:48 pm, DJ Mangus  wrote:
>> >> Try adding e.preventDefault(); instead of Event.stop(e) and let me
>> >> know if that works?
>>
>> >> On Tue, Aug 4, 2009 at 4:55 PM, Ash wrote:
>> >> > function callProcBasketEmail(e) {
>> >> > var pars = Form.serialize('email-form');
>> >> > var myAjax = new Ajax.Updater('email-response',
>> >> > 'procBasketEmail.php', {
>> >> > method: 'post',
>> >> > parameters: pars,
>> >> > onSuccess: function(response)
>> >> > {
>> >> > Event.observe('password-form', 'submit',
>> >> > callProcBasketPassword);
>> >> > }
>> >> > });
>> >> > Event.stop(e);
>> >> > }
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX

2009-08-05 Thread DJ Mangus

actually just checked firebug, best place would be html tab.  DOM tab
lists the entire DOM which would be very hard to go through.

On Wed, Aug 5, 2009 at 2:12 PM, Ash wrote:
>
> Sorry, i'm quite new to this, should I be looking for the form
> id=password-form element in the DOM, not sure where to look for it in
> the DOM tab of firebug?
>
> Is this correct?
>
> On Aug 5, 10:06 pm, DJ Mangus  wrote:
>>  when Firebug breaks on the error, check the DOM tab to see the
>> state at that particular moment.
>>
>> On Wed, Aug 5, 2009 at 2:05 PM, Alex
>>
>> McAuley wrote:
>>
>> > Seems the element does not exist...
>>
>> > Does it exist in the DOM ?
>>
>> > Alex Mcauley
>> >http://www.thevacancymarket.com
>> > - Original Message -
>> > From: "Ash" 
>> > To: "Prototype & script.aculo.us" 
>> > 
>> > Sent: Wednesday, August 05, 2009 10:04 PM
>> > Subject: [Proto-Scripty] Re: Beginners question, trouble with Event.stop in
>> > AJAX
>>
>> > When I set firebug to break on all errors...
>>
>> > Submit the first form and I get (from prototype.js)
>>
>> >  function getEventID(element) {
>> > element is null3936 if (element._prototypeEventID) return
>> > element._prototypeEventID[0]; (element is null error)
>>
>> > if I step past it and submit the second form I get the same error
>> > again
>>
>> > Unfortunately I don't know why both errors are caused, can you help
>> > please?
>>
>> > On Aug 5, 9:40 pm, DJ Mangus  wrote:
>> >> Are you getting any Javascript errors? Note: firefox and firebug is
>> >> your friend. Don't forget to break on all errors.
>>
>> >> On Wed, Aug 5, 2009 at 11:22 AM, Ash wrote:
>>
>> >> > Hi, I wasn't sure whether you meant in the 1st or second function, but
>> >> > it doesn't make a difference in either.
>>
>> >> > I think it is the Event.observe('password-form', 'submit',
>> >> > callProcBasketPassword); which is not working properly, although I
>> >> > don't know how to debug it
>>
>> >> > On Aug 5, 6:48 pm, DJ Mangus  wrote:
>> >> >> Try adding e.preventDefault(); instead of Event.stop(e) and let me
>> >> >> know if that works?
>>
>> >> >> On Tue, Aug 4, 2009 at 4:55 PM, Ash wrote:
>> >> >> > function callProcBasketEmail(e) {
>> >> >> > var pars = Form.serialize('email-form');
>> >> >> > var myAjax = new Ajax.Updater('email-response',
>> >> >> > 'procBasketEmail.php', {
>> >> >> > method: 'post',
>> >> >> > parameters: pars,
>> >> >> > onSuccess: function(response)
>> >> >> > {
>> >> >> > Event.observe('password-form', 'submit',
>> >> >> > callProcBasketPassword);
>> >> >> > }
>> >> >> > });
>> >> >> > Event.stop(e);
>> >> >> > }
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX

2009-08-05 Thread DJ Mangus

good question.  You might change Event.observe( . . . etc to
Event.observe.defer( . . .  and see if that fixes it.  Odd that the
node isn't available in the DOM at onSuccess but that might work
around it while I research.

On Wed, Aug 5, 2009 at 2:22 PM, Ash wrote:
>
> yes, when I check the HTML tab, the form with the id=password-form has
> not been created within the email-response div, even though I have
> waited to check for it with the onSuccess line
>
> EG
>
> function callProcBasketEmail(e) {
>    var pars = Form.serialize('email-form');
>    var myAjax = new Ajax.Updater('email-response',
> 'procBasketEmail.php', {
>        method: 'post',
>        parameters: pars,
>        onSuccess: function(response)
>        {
>            Event.observe('password-form', 'submit',
> callProcBasketPassword);
>        }
>    });
>    Event.stop(e);
> }
>
> Once I jump past the error, the email-response div gets populated with
> the form i'm trying to observe, so the question is, why is the
> onSuccess running before the DOM has been updated?
>
>
> On Aug 5, 10:17 pm, DJ Mangus  wrote:
>> actually just checked firebug, best place would be html tab.  DOM tab
>> lists the entire DOM which would be very hard to go through.
>>
>> On Wed, Aug 5, 2009 at 2:12 PM, Ash wrote:
>>
>> > Sorry, i'm quite new to this, should I be looking for the form
>> > id=password-form element in the DOM, not sure where to look for it in
>> > the DOM tab of firebug?
>>
>> > Is this correct?
>>
>> > On Aug 5, 10:06 pm, DJ Mangus  wrote:
>> >>  when Firebug breaks on the error, check the DOM tab to see the
>> >> state at that particular moment.
>>
>> >> On Wed, Aug 5, 2009 at 2:05 PM, Alex
>>
>> >> McAuley wrote:
>>
>> >> > Seems the element does not exist...
>>
>> >> > Does it exist in the DOM ?
>>
>> >> > Alex Mcauley
>> >> >http://www.thevacancymarket.com
>> >> > - Original Message -
>> >> > From: "Ash" 
>> >> > To: "Prototype & script.aculo.us" 
>> >> > 
>> >> > Sent: Wednesday, August 05, 2009 10:04 PM
>> >> > Subject: [Proto-Scripty] Re: Beginners question, trouble with 
>> >> > Event.stop in
>> >> > AJAX
>>
>> >> > When I set firebug to break on all errors...
>>
>> >> > Submit the first form and I get (from prototype.js)
>>
>> >> >  function getEventID(element) {
>> >> > element is null3936 if (element._prototypeEventID) return
>> >> > element._prototypeEventID[0]; (element is null error)
>>
>> >> > if I step past it and submit the second form I get the same error
>> >> > again
>>
>> >> > Unfortunately I don't know why both errors are caused, can you help
>> >> > please?
>>
>> >> > On Aug 5, 9:40 pm, DJ Mangus  wrote:
>> >> >> Are you getting any Javascript errors? Note: firefox and firebug is
>> >> >> your friend. Don't forget to break on all errors.
>>
>> >> >> On Wed, Aug 5, 2009 at 11:22 AM, Ash wrote:
>>
>> >> >> > Hi, I wasn't sure whether you meant in the 1st or second function, 
>> >> >> > but
>> >> >> > it doesn't make a difference in either.
>>
>> >> >> > I think it is the Event.observe('password-form', 'submit',
>> >> >> > callProcBasketPassword); which is not working properly, although I
>> >> >> > don't know how to debug it
>>
>> >> >> > On Aug 5, 6:48 pm, DJ Mangus  wrote:
>> >> >> >> Try adding e.preventDefault(); instead of Event.stop(e) and let me
>> >> >> >> know if that works?
>>
>> >> >> >> On Tue, Aug 4, 2009 at 4:55 PM, Ash 
>> >> >> >> wrote:
>> >> >> >> > function callProcBasketEmail(e) {
>> >> >> >> > var pars = Form.serialize('email-form');
>> >> >> >> > var myAjax = new Ajax.Updater('email-response',
>> >> >> >> > 'procBasketEmail.php', {
>> >> >> >> > method: 'post',
>> >> >> >> > parameters: pars,
>> >> >> >> > onSuccess: function(response)
>> >> >> >> > {
>> >> >> >> > Event.observe('password-form', 'submit',
>> >> >> >> > callProcBasketPassword);
>> >> >> >> > }
>> >> >> >> > });
>> >> >> >> > Event.stop(e);
>> >> >> >> > }
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Browser scroller position after Ajax.Update

2009-08-05 Thread DJ Mangus

The only problem with that solution is you provide no degradation to
people without javascript.

On 8/5/09, DJJQ  wrote:
>
> Thank you for your solution, but instead I changed  to  href="javascript:null()"> and it works like a charm.
>
> On Aug 5, 11:00 pm, "Alex McAuley" 
> wrote:
>> Nope...
>>
>> If you are observing the click with observe()
>>  just call Event.stop(event); on it
>>
>> Example.
>>
>> $('myHref').observe('click',function(event) {
>> Event.stop(event);
>>         Your ajax code here.
>>
>> });
>>
>> That way it will degrade in browsers not having javascript and they will
>> just goto the href of the link.
>>
>> HTH
>>
>> Alex Mcauleyhttp://www.thevacancymarket.com
>>
>>
>>
>> - Original Message -
>> From: "DJJQ" 
>> To: "Prototype & script.aculo.us"
>> 
>> Sent: Wednesday, August 05, 2009 9:42 PM
>> Subject: [Proto-Scripty] Re: Browser scroller position after Ajax.Update
>>
>> Yes that's right. Maybe that's the problem, should I javascript:null
>> it?
>>
>> On Aug 5, 10:40 pm, "Alex McAuley" 
>> wrote:
>> > what does the link look like ?
>>
>> > Click me
>>
>> > Like that ?
>>
>> > Alex Mcauleyhttp://www.thevacancymarket.com
>>
>> > - Original Message -
>> > From: "DJJQ" 
>> > To: "Prototype & script.aculo.us"
>> > 
>> > Sent: Wednesday, August 05, 2009 9:33 PM
>> > Subject: [Proto-Scripty] Re: Browser scroller position after Ajax.Update
>>
>> > Oh my god my english was terrible in my post, sorry about that.
>> > I'll try to explain the problem again:
>> > On my php page I have a link a long way down the page, so users have
>> > to scroll down a bit. the link triggers an ajax.update on the page.
>> > When users press the link the browser returns to the top of the page.
>> > How do I restore the browser position to where the link is? (So the
>> > scroller position remains unchanged when calling ajax update)
>>
>> > On Aug 5, 9:45 pm, "Alex McAuley" 
>> > wrote:
>> > > Can you explain it a bit better please... i cant really understand
>> > > what
>> > > you
>> > > mean by that
>>
>> > > Thanks
>>
>> > > Alex Mcauleyhttp://www.thevacancymarket.com
>>
>> > > - Original Message -
>> > > From: "DJJQ" 
>> > > To: "Prototype & script.aculo.us"
>> > > 
>> > > Sent: Wednesday, August 05, 2009 8:22 PM
>> > > Subject: [Proto-Scripty] Browser scroller position after Ajax.Update
>>
>> > > > Hello.
>> > > > My problem when is apparent on my page. The div to be updated (and
>> > > > link) are a long way down the page so users have to scroll down.
>> > > > When they press the link and thus update the div the browsers
>> > > > scroller
>> > > > returns to top, forcing the user to scroll down again to the div.
>> > > > Is there any "quickfix" (like option I have missed) or more advanced
>> > > > solution?
>>
>> > > > Best Regards and Thanks in Advance, Joel
> >
>

-- 
Sent from my mobile device

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX

2009-08-05 Thread DJ Mangus

Kind of a hack but function.defer is useful in many other contexts.

On 8/5/09, Ash  wrote:
>
> That seems to be working!
>
> Is Event.observe.defer a standard method, or is it only to be used in
> certain cases?
>
> I'm happy that it's working but I would really like to learn the
> basics properly.
>
> Thanks anyway for getting me up and running!
> Ashley
>
> On Aug 5, 10:32 pm, DJ Mangus  wrote:
>> good question.  You might change Event.observe( . . . etc to
>> Event.observe.defer( . . .  and see if that fixes it.  Odd that the
>> node isn't available in the DOM at onSuccess but that might work
>> around it while I research.
>>
>> On Wed, Aug 5, 2009 at 2:22 PM, Ash wrote:
>>
>> > yes, when I check the HTML tab, the form with the id=password-form has
>> > not been created within the email-response div, even though I have
>> > waited to check for it with the onSuccess line
>>
>> > EG
>>
>> > function callProcBasketEmail(e) {
>> >    var pars = Form.serialize('email-form');
>> >    var myAjax = new Ajax.Updater('email-response',
>> > 'procBasketEmail.php', {
>> >        method: 'post',
>> >        parameters: pars,
>> >        onSuccess: function(response)
>> >        {
>> >            Event.observe('password-form', 'submit',
>> > callProcBasketPassword);
>> >        }
>> >    });
>> >    Event.stop(e);
>> > }
>>
>> > Once I jump past the error, the email-response div gets populated with
>> > the form i'm trying to observe, so the question is, why is the
>> > onSuccess running before the DOM has been updated?
>>
>> > On Aug 5, 10:17 pm, DJ Mangus  wrote:
>> >> actually just checked firebug, best place would be html tab.  DOM tab
>> >> lists the entire DOM which would be very hard to go through.
>>
>> >> On Wed, Aug 5, 2009 at 2:12 PM, Ash wrote:
>>
>> >> > Sorry, i'm quite new to this, should I be looking for the form
>> >> > id=password-form element in the DOM, not sure where to look for it in
>> >> > the DOM tab of firebug?
>>
>> >> > Is this correct?
>>
>> >> > On Aug 5, 10:06 pm, DJ Mangus  wrote:
>> >> >>  when Firebug breaks on the error, check the DOM tab to see
>> >> >> the
>> >> >> state at that particular moment.
>>
>> >> >> On Wed, Aug 5, 2009 at 2:05 PM, Alex
>>
>> >> >> McAuley wrote:
>>
>> >> >> > Seems the element does not exist...
>>
>> >> >> > Does it exist in the DOM ?
>>
>> >> >> > Alex Mcauley
>> >> >> >http://www.thevacancymarket.com
>> >> >> > - Original Message -
>> >> >> > From: "Ash" 
>> >> >> > To: "Prototype & script.aculo.us"
>> >> >> > 
>> >> >> > Sent: Wednesday, August 05, 2009 10:04 PM
>> >> >> > Subject: [Proto-Scripty] Re: Beginners question, trouble with
>> >> >> > Event.stop in
>> >> >> > AJAX
>>
>> >> >> > When I set firebug to break on all errors...
>>
>> >> >> > Submit the first form and I get (from prototype.js)
>>
>> >> >> >  function getEventID(element) {
>> >> >> > element is null3936 if (element._prototypeEventID) return
>> >> >> > element._prototypeEventID[0]; (element is null error)
>>
>> >> >> > if I step past it and submit the second form I get the same error
>> >> >> > again
>>
>> >> >> > Unfortunately I don't know why both errors are caused, can you
>> >> >> > help
>> >> >> > please?
>>
>> >> >> > On Aug 5, 9:40 pm, DJ Mangus  wrote:
>> >> >> >> Are you getting any Javascript errors? Note: firefox and firebug
>> >> >> >> is
>> >> >> >> your friend. Don't forget to break on all errors.
>>
>> >> >> >> On Wed, Aug 5, 2009 at 11:22 AM, Ash
>> >> >> >> wrote:
>>
>> >> >> >> > Hi, I wasn't sure whether you meant in the 1st or second
>> >> >> >> > function, but
>> >> >

[Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX

2009-08-05 Thread DJ Mangus

yes but onSuccess shouldn't be called until after the ajax.updater is
completed.  Therefore the DOM node should be available at that point.

On Wed, Aug 5, 2009 at 2:40 PM, Alex
McAuley wrote:
>
> Ajax is Asyncronous so it gets  executed along with other script ...
> ergo its not serial like php and other stuff your prolly used to...
>
> you can make a request synconous (script waits for the ajax request to
> finish before continuing but its not recommended
>
> Alex Mcauley
> http://www.thevacancymarket.com
> - Original Message -
> From: "Ash" 
> To: "Prototype & script.aculo.us" 
> Sent: Wednesday, August 05, 2009 10:37 PM
> Subject: [Proto-Scripty] Re: Beginners question, trouble with Event.stop in
> AJAX
>
>
>
> That seems to be working!
>
> Is Event.observe.defer a standard method, or is it only to be used in
> certain cases?
>
> I'm happy that it's working but I would really like to learn the
> basics properly.
>
> Thanks anyway for getting me up and running!
> Ashley
>
> On Aug 5, 10:32 pm, DJ Mangus  wrote:
>> good question. You might change Event.observe( . . . etc to
>> Event.observe.defer( . . . and see if that fixes it. Odd that the
>> node isn't available in the DOM at onSuccess but that might work
>> around it while I research.
>>
>> On Wed, Aug 5, 2009 at 2:22 PM, Ash wrote:
>>
>> > yes, when I check the HTML tab, the form with the id=password-form has
>> > not been created within the email-response div, even though I have
>> > waited to check for it with the onSuccess line
>>
>> > EG
>>
>> > function callProcBasketEmail(e) {
>> > var pars = Form.serialize('email-form');
>> > var myAjax = new Ajax.Updater('email-response',
>> > 'procBasketEmail.php', {
>> > method: 'post',
>> > parameters: pars,
>> > onSuccess: function(response)
>> > {
>> > Event.observe('password-form', 'submit',
>> > callProcBasketPassword);
>> > }
>> > });
>> > Event.stop(e);
>> > }
>>
>> > Once I jump past the error, the email-response div gets populated with
>> > the form i'm trying to observe, so the question is, why is the
>> > onSuccess running before the DOM has been updated?
>>
>> > On Aug 5, 10:17 pm, DJ Mangus  wrote:
>> >> actually just checked firebug, best place would be html tab. DOM tab
>> >> lists the entire DOM which would be very hard to go through.
>>
>> >> On Wed, Aug 5, 2009 at 2:12 PM, Ash wrote:
>>
>> >> > Sorry, i'm quite new to this, should I be looking for the form
>> >> > id=password-form element in the DOM, not sure where to look for it in
>> >> > the DOM tab of firebug?
>>
>> >> > Is this correct?
>>
>> >> > On Aug 5, 10:06 pm, DJ Mangus  wrote:
>> >> >>  when Firebug breaks on the error, check the DOM tab to see
>> >> >> the
>> >> >> state at that particular moment.
>>
>> >> >> On Wed, Aug 5, 2009 at 2:05 PM, Alex
>>
>> >> >> McAuley wrote:
>>
>> >> >> > Seems the element does not exist...
>>
>> >> >> > Does it exist in the DOM ?
>>
>> >> >> > Alex Mcauley
>> >> >> >http://www.thevacancymarket.com
>> >> >> > - Original Message -
>> >> >> > From: "Ash" 
>> >> >> > To: "Prototype & script.aculo.us"
>> >> >> > 
>> >> >> > Sent: Wednesday, August 05, 2009 10:04 PM
>> >> >> > Subject: [Proto-Scripty] Re: Beginners question, trouble with
>> >> >> > Event.stop in
>> >> >> > AJAX
>>
>> >> >> > When I set firebug to break on all errors...
>>
>> >> >> > Submit the first form and I get (from prototype.js)
>>
>> >> >> > function getEventID(element) {
>> >> >> > element is null3936 if (element._prototypeEventID) return
>> >> >> > element._prototypeEventID[0]; (element is null error)
>>
>> >> >> > if I step past it and submit the second form I get the same error
>> >> >> > again
>>
>> >> >> > Unfortunately I don't know why both errors are caused, can you
>> >> >> > help
>> >

[Proto-Scripty] Re: Browser scroller position after Ajax.Update

2009-08-05 Thread DJ Mangus

pretty much yes but some shut it off for security reasons

On Wed, Aug 5, 2009 at 3:01 PM, DJJQ wrote:
>
> Ok. I thought everyone had javscript by now :)
>
> On Aug 5, 11:39 pm, DJ Mangus  wrote:
>> The only problem with that solution is you provide no degradation to
>> people without javascript.
>>
>> On 8/5/09, DJJQ  wrote:
>>
>>
>>
>>
>>
>>
>>
>> > Thank you for your solution, but instead I changed  to > > href="javascript:null()"> and it works like a charm.
>>
>> > On Aug 5, 11:00 pm, "Alex McAuley" 
>> > wrote:
>> >> Nope...
>>
>> >> If you are observing the click with observe()
>> >>  just call Event.stop(event); on it
>>
>> >> Example.
>>
>> >> $('myHref').observe('click',function(event) {
>> >> Event.stop(event);
>> >>         Your ajax code here.
>>
>> >> });
>>
>> >> That way it will degrade in browsers not having javascript and they will
>> >> just goto the href of the link.
>>
>> >> HTH
>>
>> >> Alex Mcauleyhttp://www.thevacancymarket.com
>>
>> >> - Original Message -
>> >> From: "DJJQ" 
>> >> To: "Prototype & script.aculo.us"
>> >> 
>> >> Sent: Wednesday, August 05, 2009 9:42 PM
>> >> Subject: [Proto-Scripty] Re: Browser scroller position after Ajax.Update
>>
>> >> Yes that's right. Maybe that's the problem, should I javascript:null
>> >> it?
>>
>> >> On Aug 5, 10:40 pm, "Alex McAuley" 
>> >> wrote:
>> >> > what does the link look like ?
>>
>> >> > Click me
>>
>> >> > Like that ?
>>
>> >> > Alex Mcauleyhttp://www.thevacancymarket.com
>>
>> >> > - Original Message -
>> >> > From: "DJJQ" 
>> >> > To: "Prototype & script.aculo.us"
>> >> > 
>> >> > Sent: Wednesday, August 05, 2009 9:33 PM
>> >> > Subject: [Proto-Scripty] Re: Browser scroller position after Ajax.Update
>>
>> >> > Oh my god my english was terrible in my post, sorry about that.
>> >> > I'll try to explain the problem again:
>> >> > On my php page I have a link a long way down the page, so users have
>> >> > to scroll down a bit. the link triggers an ajax.update on the page.
>> >> > When users press the link the browser returns to the top of the page.
>> >> > How do I restore the browser position to where the link is? (So the
>> >> > scroller position remains unchanged when calling ajax update)
>>
>> >> > On Aug 5, 9:45 pm, "Alex McAuley" 
>> >> > wrote:
>> >> > > Can you explain it a bit better please... i cant really understand
>> >> > > what
>> >> > > you
>> >> > > mean by that
>>
>> >> > > Thanks
>>
>> >> > > Alex Mcauleyhttp://www.thevacancymarket.com
>>
>> >> > > - Original Message -
>> >> > > From: "DJJQ" 
>> >> > > To: "Prototype & script.aculo.us"
>> >> > > 
>> >> > > Sent: Wednesday, August 05, 2009 8:22 PM
>> >> > > Subject: [Proto-Scripty] Browser scroller position after Ajax.Update
>>
>> >> > > > Hello.
>> >> > > > My problem when is apparent on my page. The div to be updated (and
>> >> > > > link) are a long way down the page so users have to scroll down.
>> >> > > > When they press the link and thus update the div the browsers
>> >> > > > scroller
>> >> > > > returns to top, forcing the user to scroll down again to the div.
>> >> > > > Is there any "quickfix" (like option I have missed) or more advanced
>> >> > > > solution?
>>
>> >> > > > Best Regards and Thanks in Advance, Joel
>>
>> --
>> Sent from my mobile device
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX

2009-08-05 Thread DJ Mangus

OK, just checked the source.  onComplete is where ajax.updater
actually updates the node.  onSuccess is called before that.
Workaround is to either a.) use defer like you did, or b.) use
Ajax.request and update it yourself onSuccess, then do your
Event.observe.

Plusses of option b is that it won't try and update anything upon a
failed ajax request.

On Wed, Aug 5, 2009 at 3:03 PM, Ash wrote:
>
> I wonder why in this case, that onSuccess is executed before the DOM
> node has been created.
>
> Using a hack is okay to get me up and running but I would like to know
> how to use ajax methods correctly
>
> On Aug 5, 10:48 pm, DJ Mangus  wrote:
>> yes but onSuccess shouldn't be called until after the ajax.updater is
>> completed.  Therefore the DOM node should be available at that point.
>>
>> On Wed, Aug 5, 2009 at 2:40 PM, Alex
>>
>> McAuley wrote:
>>
>> > Ajax is Asyncronous so it gets  executed along with other script ...
>> > ergo its not serial like php and other stuff your prolly used to...
>>
>> > you can make a request synconous (script waits for the ajax request to
>> > finish before continuing but its not recommended
>>
>> > Alex Mcauley
>> >http://www.thevacancymarket.com
>> > - Original Message -
>> > From: "Ash" 
>> > To: "Prototype & script.aculo.us" 
>> > 
>> > Sent: Wednesday, August 05, 2009 10:37 PM
>> > Subject: [Proto-Scripty] Re: Beginners question, trouble with Event.stop in
>> > AJAX
>>
>> > That seems to be working!
>>
>> > Is Event.observe.defer a standard method, or is it only to be used in
>> > certain cases?
>>
>> > I'm happy that it's working but I would really like to learn the
>> > basics properly.
>>
>> > Thanks anyway for getting me up and running!
>> > Ashley
>>
>> > On Aug 5, 10:32 pm, DJ Mangus  wrote:
>> >> good question. You might change Event.observe( . . . etc to
>> >> Event.observe.defer( . . . and see if that fixes it. Odd that the
>> >> node isn't available in the DOM at onSuccess but that might work
>> >> around it while I research.
>>
>> >> On Wed, Aug 5, 2009 at 2:22 PM, Ash wrote:
>>
>> >> > yes, when I check the HTML tab, the form with the id=password-form has
>> >> > not been created within the email-response div, even though I have
>> >> > waited to check for it with the onSuccess line
>>
>> >> > EG
>>
>> >> > function callProcBasketEmail(e) {
>> >> > var pars = Form.serialize('email-form');
>> >> > var myAjax = new Ajax.Updater('email-response',
>> >> > 'procBasketEmail.php', {
>> >> > method: 'post',
>> >> > parameters: pars,
>> >> > onSuccess: function(response)
>> >> > {
>> >> > Event.observe('password-form', 'submit',
>> >> > callProcBasketPassword);
>> >> > }
>> >> > });
>> >> > Event.stop(e);
>> >> > }
>>
>> >> > Once I jump past the error, the email-response div gets populated with
>> >> > the form i'm trying to observe, so the question is, why is the
>> >> > onSuccess running before the DOM has been updated?
>>
>> >> > On Aug 5, 10:17 pm, DJ Mangus  wrote:
>> >> >> actually just checked firebug, best place would be html tab. DOM tab
>> >> >> lists the entire DOM which would be very hard to go through.
>>
>> >> >> On Wed, Aug 5, 2009 at 2:12 PM, Ash wrote:
>>
>> >> >> > Sorry, i'm quite new to this, should I be looking for the form
>> >> >> > id=password-form element in the DOM, not sure where to look for it in
>> >> >> > the DOM tab of firebug?
>>
>> >> >> > Is this correct?
>>
>> >> >> > On Aug 5, 10:06 pm, DJ Mangus  wrote:
>> >> >> >>  when Firebug breaks on the error, check the DOM tab to see
>> >> >> >> the
>> >> >> >> state at that particular moment.
>>
>> >> >> >> On Wed, Aug 5, 2009 at 2:05 PM, Alex
>>
>> >> >> >> McAuley wrote:
>>
>> >> >> >> > Seems the element does not exist...
>>
>> >> >> >> > Does it exist in the DOM ?

[Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX

2009-08-05 Thread DJ Mangus

I honestly think the defer is best at this point as oncomplete occurs
even on failed requests. Your choices are to rewrite your own stuff
instead of prototype functions (ie. Do your own success checks or do
your own updating) or just stick with defer.

On 8/5/09, Ash  wrote:
>
> Do you mean to use
>
> function callProcBasketEmail(e) {
> var pars = Form.serialize('email-form');
> var myAjax = new Ajax.Updater('email-response',
> 'procBasketEmail.php', {
> method: 'post',
> parameters: pars,
> onComplete: function(response)
> {
> Event.observe('password-form', 'submit',
> callProcBasketPassword);
>     }
> });
> Event.stop(e);
> }
>
> rather than testing for onSuccess?
>
> On Aug 5, 11:07 pm, DJ Mangus  wrote:
>> OK, just checked the source.  onComplete is where ajax.updater
>> actually updates the node.  onSuccess is called before that.
>> Workaround is to either a.) use defer like you did, or b.) use
>> Ajax.request and update it yourself onSuccess, then do your
>> Event.observe.
>>
>> Plusses of option b is that it won't try and update anything upon a
>> failed ajax request.
>>
>> On Wed, Aug 5, 2009 at 3:03 PM, Ash wrote:
>>
>> > I wonder why in this case, that onSuccess is executed before the DOM
>> > node has been created.
>>
>> > Using a hack is okay to get me up and running but I would like to know
>> > how to use ajax methods correctly
>>
>> > On Aug 5, 10:48 pm, DJ Mangus  wrote:
>> >> yes but onSuccess shouldn't be called until after the ajax.updater is
>> >> completed.  Therefore the DOM node should be available at that point.
>>
>> >> On Wed, Aug 5, 2009 at 2:40 PM, Alex
>>
>> >> McAuley wrote:
>>
>> >> > Ajax is Asyncronous so it gets  executed along with other script ...
>> >> > ergo its not serial like php and other stuff your prolly used to...
>>
>> >> > you can make a request synconous (script waits for the ajax request
>> >> > to
>> >> > finish before continuing but its not recommended
>>
>> >> > Alex Mcauley
>> >> >http://www.thevacancymarket.com
>> >> > - Original Message -
>> >> > From: "Ash" 
>> >> > To: "Prototype & script.aculo.us"
>> >> > 
>> >> > Sent: Wednesday, August 05, 2009 10:37 PM
>> >> > Subject: [Proto-Scripty] Re: Beginners question, trouble with
>> >> > Event.stop in
>> >> > AJAX
>>
>> >> > That seems to be working!
>>
>> >> > Is Event.observe.defer a standard method, or is it only to be used in
>> >> > certain cases?
>>
>> >> > I'm happy that it's working but I would really like to learn the
>> >> > basics properly.
>>
>> >> > Thanks anyway for getting me up and running!
>> >> > Ashley
>>
>> >> > On Aug 5, 10:32 pm, DJ Mangus  wrote:
>> >> >> good question. You might change Event.observe( . . . etc to
>> >> >> Event.observe.defer( . . . and see if that fixes it. Odd that the
>> >> >> node isn't available in the DOM at onSuccess but that might work
>> >> >> around it while I research.
>>
>> >> >> On Wed, Aug 5, 2009 at 2:22 PM, Ash
>> >> >> wrote:
>>
>> >> >> > yes, when I check the HTML tab, the form with the id=password-form
>> >> >> > has
>> >> >> > not been created within the email-response div, even though I have
>> >> >> > waited to check for it with the onSuccess line
>>
>> >> >> > EG
>>
>> >> >> > function callProcBasketEmail(e) {
>> >> >> > var pars = Form.serialize('email-form');
>> >> >> > var myAjax = new Ajax.Updater('email-response',
>> >> >> > 'procBasketEmail.php', {
>> >> >> > method: 'post',
>> >> >> > parameters: pars,
>> >> >> > onSuccess: function(response)
>> >> >> > {
>> >> >> > Event.observe('password-form', 'submit',
>> >> >> > callProcBasketPassword);
>> >> >> > }
>> >> >> >

[Proto-Scripty] Re: lightwindow not working after ajax update

2009-08-06 Thread DJ Mangus

Explain lightwindow for me, does it use javascript to display?  If so
then post that script too please.

On 8/6/09, Martín Marqués  wrote:
>
> We are working on and html page which has a div with id="container"
> that gets updated when pressing link buttons that are on the top.
>
> This is very simple code:
>
> new Ajax.Updater('container', 'somepage.html', {
>   parameters: { method: GET }
> });
>
>
> The thing is that one of the pages has a link with lightwindow class.
> This page by it self works great, but when it is inserted in the
> container div it doesn't use the lightwindow efect, it just opens the
> link as if it was a normal link youn press on.
>
> Anything wrong with how we are working with this?
>
> --
> Martín Marqués
> select 'martin.marques' || '@' || 'gmail.com'
> DBA, Programador, Administrador
>
> >
>

-- 
Sent from my mobile device

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Example values input text

2009-08-07 Thread DJ Mangus

I don't know of a plugin like that but shouldn't be too hard to port

On 8/7/09, spielberg  wrote:
>
> Hello to the people of the group. It´s my first question. Any one know
> abut something like this http://mucur.name/system/jquery_example/ to
> prototype?? I need to use the element title of the text input. Thanks
> for all;
>
> Spielberg
>
> >
>

-- 
Sent from my mobile device

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Updating a form's "clean" state

2009-08-07 Thread DJ Mangus

You could implement your own reset method on your form object.

On 8/7/09, mr_justin  wrote:
>
> This is in no way a prototype related question, but we've got some
> pretty smart JavasScript people on here so I figured I'd pose the
> question.
>
> Here's the scenario:
>
> I have a form on a page with a bunch of inputs (text boxes). That form
> is hidden by default. Elsewhere on the page is a list of elements that
> are hooked up to an IPE. The elements that can be edited by the IPE
> are the same as those that can be edited in the form. So yes, there
> are two ways to edit the same data. One place is inline while you're
> reading it, and the other is if you click a little "edit" link that
> flips the page into edit mode. Does that make sense so far?
>
> Once in edit mode, you can either save your changes or click cancel
> which calls the built-in Form#reset() method that resets the form to
> it's clean state (the state the form was in when the page loaded).
>
> Now here's the thing, if you use the IPE to edit the data inline, the
> data is saved to the server AND also the corresponding input control
> in the hidden form is updated. That puts the form in a dirty state. So
> if I call the reset method at this point, the changes I just made with
> the IPE are cleared out. Those changes have already been saved to the
> server, so it doesn't make sense to clear them.
>
> Now that I've explained it all, my question is, does anyone know of a
> way to update a form's "clean" state somehow without a DOM reload?
> Perhaps there's a method that can be called on a form object? Maybe
> instead of just updating the value of the input I should replace the
> entire input. Hmmm, that's not a bad idea.
>
> What do you guys think?
>
> -justin
> >
>

-- 
Sent from my mobile device

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: lightwindow not working after ajax update

2009-08-07 Thread DJ Mangus

>From glancing at the source of that it doesn't look like it handles
elements created after the lightwindow object is initialized.  You
might want to get ahold of the author of that for support with it.

2009/8/7 Martín Marqués :
>
> lightwindow is based on scriptaculous.
>
> http://www.stickmanlabs.com/lightwindow/
>
> Nobody uses it?
>
> 2009/8/6 DJ Mangus :
>>
>> Explain lightwindow for me, does it use javascript to display?  If so
>> then post that script too please.
>>
>> On 8/6/09, Martín Marqués  wrote:
>>>
>>> We are working on and html page which has a div with id="container"
>>> that gets updated when pressing link buttons that are on the top.
>>>
>>> This is very simple code:
>>>
>>> new Ajax.Updater('container', 'somepage.html', {
>>>   parameters: { method: GET }
>>> });
>>>
>>>
>>> The thing is that one of the pages has a link with lightwindow class.
>>> This page by it self works great, but when it is inserted in the
>>> container div it doesn't use the lightwindow efect, it just opens the
>>> link as if it was a normal link youn press on.
>>>
>>> Anything wrong with how we are working with this?
>>>
>>> --
>>> Martín Marqués
>>> select 'martin.marques' || '@' || 'gmail.com'
>>> DBA, Programador, Administrador
>>>
>>> >
>>>
>>
>> --
>> Sent from my mobile device
>>
>> >
>>
>
>
>
> --
> Martín Marqués
> select 'martin.marques' || '@' || 'gmail.com'
> DBA, Programador, Administrador
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Updating a form's "clean" state

2009-08-07 Thread DJ Mangus

Of course.  Shouldn't be really hard to implement your own reset
though.  Just keep a hash of initial values and ids (you can use
http://www.prototypejs.org/api/element/identify to give elements w/o
an id one) and upon "customreset" set them all back.  Then if you save
changes to server just update the hash.

On Fri, Aug 7, 2009 at 1:53 PM, mr_justin wrote:
>
> Yeah that would require quite a bit more work than I was thinking. I
> tried out the technique of replacing the entire input control rather
> than just updating the value, and it works great. Except in IE. Of
> course.
>
> -justin
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to loop through array? New to Proto

2009-08-07 Thread DJ Mangus

Give them all a class of 'error' and use $$('error').each('hide')

Note: drycoded on my phone so look those up before using them.

On 8/7/09, trope  wrote:
>
> I have some code that appears to be a prime candidate for a loop.
>
> How could I wrap this up in one neat little function???
>
> /* Hide previous errors */
>   $('ErrorConsumerEmail0address').hide();
>   $('ErrorConsumerfirstname').hide();
>   $('ErrorConsumerlastname').hide();
>   $('ErrorConsumerPhone0Number').hide();
>
>
> Thank you.
>
> Trope!
>
> >
>

-- 
Sent from my mobile device

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: spam click = buggy???

2009-08-08 Thread DJ Mangus

I can't get to the examples on my phone to check but do the examples
use the event queue?  If not that explains it, these effects run
simultaneously and can get tangled unless you use the queue.  You
should be able to look event queues up for more info.  Note: not all
effects tangle which is why you have to specify when you want to queue
things.

On 8/8/09, HOLYCOWBATMAN  wrote:
>
> Hi , im looking into script.aculo.us Functional Tests effects3_test
> and if i spam 'Start slide down' 4-5 times( or any other effect on any
> other page) it starts to bug... the animation is only partial then
> complete instantly and it wont get back to normal until i reload the
> page. I would like to know if this is normal... and if its the example
> that are faulty .. or scriptaculous itself ( i tested it in ie8 and
> ff3 and the same bug happens ) or if its something on my side
>
> Im just starting to look into some javascript / ajax framework and
> found scriptaculous / prototype to be really simple and powerfull but
> seeing that kind of bug would make me stay away from the
> 'effects'...everything else seems great though!
>
> >
>

-- 
Sent from my mobile device

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: how to select multiple entries from a auto complete box?

2009-08-10 Thread DJ Mangus

If you use the script.aculo.us autocompleter the option you need to
set is called tokens which takes either a string or an array of
strings to reset on.  Note: I haven't used autocompleter myself just
looked up the info.

On Mon, Aug 10, 2009 at 4:11 AM, Angeline wrote:
>
> Hi, I have an auto complete box which is populated with the list of
> users of the application. It is working fine with the box listing the
> users.
>
> But I am able to select only one user. How to select multiple users
> from the list ?
> I am using the built-in auto complete feature of the CakePHP
> framework. But in order to select multiple entries, I think I must
> code the js separately, since the ajax helper in CakePHP does not
> support selecting multiple entries.  This is the action in the
> controller which generates the auto complete text box.
>
> function autoComplete()
> {
>  $this->set('users',$this->User->find('all',array(
>                                  'fields'=>array
> ('User.id','User.name'),
>    'conditions'=>array('User.name LIKE' => $this->data['User']
> ['name'].'%';
>
>    $this->layout = "ajax";
> }
>
> This is the auto_complete.ctp file
>
> 
>    
>         
>    
> 
>
> And this is the view where I have the auto complete box:
>
> create('User', array('url' => '/forms/share')); ?>
>
>     autoComplete('User.name', '/forms/
> autoComplete');?>
>
>  end('Share');?>
>
> In the auto complete box, I am able to select only one user name. how
> can I select multiple users with a comma or space separator?
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Making a Draggable-"pool"

2009-08-10 Thread DJ Mangus

Not sure I understand what you are wanting to do. If you mean drag
from one location and the pop back so it can be dragged again, then
yes you have full control over what happens during and after drags.
Look in the documentation for the various callbacks you have
available.

On 8/10/09, Drr  wrote:
>
> Hi, is it possible to make a draggable be dragged unlimited times from
> one Position? I want to make some kind of Item pool that can be
> dragged multiple times...
> >
>

-- 
Sent from my mobile device

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Dropping

2009-08-14 Thread DJ Mangus

Revert true then move it in the dom in your droopable callback. Should
work for inline elements.

On 8/14/09, Floyd Resler  wrote:
>
> I think you're right on that.  I should have expanded my question.  If
> the object isn't dropped on a Droppable object, how do I get it to go
> back to its original position?  I tried setting revert to true but the
> object always goes back.
>
> Thanks!
> Floyd
>
> On Aug 14, 2009, at 5:58 AM, Alex McAuley wrote:
>
>>
>> I am sure that Droppables do that already dont they ?
>>
>>
>> Alex Mcauley
>> http://www.thevacancymarket.com
>> - Original Message -
>> From: "Floyd Resler" 
>> To: "Prototype & script.aculo.us"
>> > >
>> Sent: Thursday, August 13, 2009 9:55 PM
>> Subject: [Proto-Scripty] Dropping
>>
>>
>>>
>>> I want to make an object revert back to its original position only if
>>> it isn't dropped on an object that accepts it.  How can I do this?
>>>
>>> Thanks!
>>> Floyd
>>>

>>>
>>
>>
>> >
>
>
> >
>

-- 
Sent from my mobile device

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Observing a checkbox

2009-08-18 Thread DJ Mangus

Spec and reality often differ.

On 8/18/09, ColinFine  wrote:
>
>
>
> On Aug 13, 2:53 pm, Jeztah  wrote:
>> What is the correct Cross browser way to observe a checkbox being
>> checked or not
>>
>> I am using
>>
>> $('hidenonlive').observe('change',function() {
>>
>>                                 if($('hidenonlive').checked!==true) {
>>                                         alert('Showing');
>>
>>                                 } else {
>>
>> $$('.dead-vacancy').invoke('hide');
>>
>>                                 }
>>
>>                         });
>>
>> But it doesnt seem to want to work in IE8 and it doesnt throw an
>> error SHoudl i just use "click" instead?
>>
> You are tabbing to a different field after clicking, yes?
>
> The definition of 'onChange' in the HTML spec (http://www.w3.org/TR/
> html401/interact/scripts.html#adef-onchange) is "The onchange event
> occurs when a control loses the input focus and its value has been
> modified since gaining focus".
>
> >
>

-- 
Sent from my mobile device

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Automatically Converting HTML to DOM (e.g. new Element ...)

2009-08-18 Thread DJ Mangus

I can't help with the solution but since you need serverside
processing anyway why not just do it all serverside?

On 8/18/09, drewB  wrote:
>
> Yes, by "javascript" I mean Prototype API.
>
> A simplified use case is as follows:
>
> A user has selected X pieces of furniture.  On a single page, they are
> shown a list of the furniture items with specific info about each
> piece.  For example, name, dimensions, manufacture, list of parts
> etc.  Much of this info wouldn't be shown by default but is
> expandable.  The user can delete furniture items or add new ones. When
> they add a new one it is immediately added to the page.  In order to
> add it to the page (without reloading the whole page), I either need
> to dynamically build the new furniture item block using javascript or
> use AJAX, build the block server-side and then add it to the page.
>
> At first glance, doing it server side might seem easier but I am
> playing with moving as much of the presentation code client-side as
> possible.  So, the server-side job would just be to build a js array
> with name, dimensions, manufacture, list of parts, etc for each piece
> of furniture and use javascript to build the whole page.
>
> I hope that is clear.
>
>
> On Aug 18, 8:40 am, "T.J. Crowder"  wrote:
>> Hi,
>>
>> I don't think I'm clear on what the use case is and why you're
>> converting it from HTML to "JavaScript" (by which I take it you mean
>> DOM API or Prototype API or Builder code).  What's the goal of the
>> conversion?
>> --
>> T.J. Crowder
>> tj / crowder software / com
>> Independent Software Engineer, consulting services available
>>
>> On Aug 18, 4:28 pm, drewB  wrote:
>>
>> > Interesting suggestion.  Unfortunately, the content is more dynamic
>> > them just text replacements.  For example, there is a list of varying
>> > length.  Also just using template for 200 lines of text doesn't seem
>> > very "tidy" to me.
>>
>> > On Aug 18, 3:19 am, Richard Quadling  wrote:
>>
>> > > 2009/8/18 drewB :
>>
>> > > > I have 200 lines of an HTML snippet that I plan to convert to
>> > > > javascript using Prototypes Elements.  Instead of doing this by
>> > > > hand,
>> > > > I figure I could write some code that would take any block of HTML
>> > > > and
>> > > > convert it to javascript.  Then it occurs to me that I couldn't be
>> > > > the
>> > > > first one to think of this.  Does anyone have some code that will do
>> > > > this or know of a tool?  I am looking for something like
>> > > >http://www.smelzo.it/html2js/butusingPrototype Elements instead of
>> > > > basic javascript (something that uses Builder would be ok also).
>>
>> > > > Thanks!
>>
>> > > Once you've converted it to JS, what do you intend to do with it?
>>
>> > > If you are going to re-use it (say with different content), then maybe
>> > > the Template mechanism within Prototype [1] would be what you are
>> > > looking for.
>>
>> > > Richard.
>>
>> > > [1]http://prototypejs.org/api/template
>>
>> > > --
>> > > -
>> > > Richard Quadling
>> > > "Standing on the shoulders of some very clever giants!"
>> > > EE :http://www.experts-exchange.com/M_248814.html
>> > > Zend Certified Engineer
>> > > :http://zend.com/zce.php?c=ZEND002498&r=213474731
>> > > ZOPA :http://uk.zopa.com/member/RQuadling
> >
>

-- 
Sent from my mobile device

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Automatically Converting HTML to DOM (e.g. new Element ...)

2009-08-20 Thread DJ Mangus

Yes if your roundtrip is slow then doing it clientside can make it
seem more responsive. There is the issue though of what happens if the
server save fails?  Revert your changes?  Overall using serverside
output is less troublesome, easier to code, and more robust.

On 8/20/09, drewB  wrote:
>
>>Unlikely. There is very little difference in computation effort
>>between generating JSON, XML, HTML or delimited text at the server.
>
> I will have to take your word for this.  I assumed it to be different.
>
>>So why put it in two places? Why turn data into say JSON just so you
>>can later turn it into HTML? Just create HTML in the first place using
>>a template on the server.
>
> It would only really only be in one place - client side scripting.
> The JSON would be a single line.
>
>>The greatest time taken is in getting the data from the server, which
>>will be (pretty much) the same regardless of how the data is
>>formatted.
>
> If it takes place client-side, the client doesn't need to wait for
> data to come back from the server before the new items are displayed.
> They are displayed right away while data is sent back to the server to
> be saved.
> >
>

-- 
Sent from my mobile device

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: scope of "this" in anonymous functions

2009-08-22 Thread DJ Mangus

Everything in js is an object. Even function literals.

On 8/22/09, JoJo  wrote:
>
> How do I use bind? Doesn't the bind function take an object as an
> argument? I'm doing this stuff inside a class, not an object.
>
> On Aug 22, 6:15 pm, Gareth Evans  wrote:
>> Use bind (method on the function object)
>> see the typewriter example i wrote for syntax
>>
>> On Sun, Aug 23, 2009 at 9:06 AM, Mojito  wrote:
>>
>> > MyClass = Class.create({
>> >   initialize: function() {
>> >      this.myField = null;
>> >      Event.observe(window, 'load', function() {
>> >         this.myField = new Field();
>> >      });
>> >   },
>> >   myMethod: function() {
>> >      alert(this.myField);
>> >   }
>> > });
>>
>> > +++
>>
>> > Field's constructor uses Scriptaculous's sliders, which require an
>> > element to be already loaded.  That's why I'm only setting
>> > this.myField when the window has loaded.  I see that my sliders get
>> > initialized properly, but this.myField is still null when I call
>> > myMethod().  I suspect this has something to do with the "this" scope
>> > in my anonymous function.  How do I fix this to do what I intended?
> >
>

-- 
Sent from my mobile device

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: yes, but Mootoolls do that -ImageMenu-

2009-08-25 Thread DJ Mangus
Would be doable with script.aculo.us though I do not think anyone has done
it yet.

On Tue, Aug 25, 2009 at 9:41 AM, lvdesign  wrote:

>
> Hello people,
>
> I find a very fancy animation, but i am not sure that we can
> transpose it with prototype.
> this is the file: http://www.phatfusion.net/imagemenu/
>
> I don't find the coresponding's effects in scriptaculous lib.
> Or perhaps it's a combination.
>
> If someone has an idea, it will be great, meme if a piste...
>
> thanks a lot
>
> LV
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: $H need help

2009-08-25 Thread DJ Mangus
what you want to do is h.set(input.id, input.getValue())
See http://www.prototypejs.org/api/hash/set

2009/8/25 Kevin Porter 

>
> Same:
>
> var h = $H({});
> h[input.id] = input.getValue();
>
> - Kev
>
>
> buda wrote:
> > Thanks for replay, but
> > I Do need to add it to a $H object 
> >
> > how to do it? Thanks )
> >
> > On 26 авг, 00:14, Kevin Porter  wrote:
> >
> >> var h = {};
> >> h[input.id] = input.getValue();
> >>
> >> Doesn't even need to be a $H(), just a regular JS object/hash.
> >>
> >> - Kev
> >>
> >>
> >>
> >>
> >>
> >> buda wrote:
> >>
> >>> I need to add to a hash id of an input and its value
> >>> when I try to do
> >>>
> >>>  var h = $H({});
> >>>  h.update({ input.id: input.getValue() });
> >>>
> >>> an error of bad syntax is generated
> >>>
> >>> how can I add an element to a hash which key is an input.id and value
> >>> is an input.getValue()?
> >>>
> >>> Thanks
> >>>
> >> --
> >> Kevin Porter
> >> Advanced Web Construction
> Ltdhttp://webutils.co.ukhttp://billiardsearch.nethttp://9ballpool.co.uk
> >>
> >> AJAX Blackjack - real-time multi-player blackjack game with no flash,
> java or software downloads required -http://blackjack.webutils.co.uk-Скрыть 
> цитируемый текст -
> >>
> >> - Показать цитируемый текст -
> >>
> > >
> >
> >
> >
> >
>
>
> --
> Kevin Porter
> Advanced Web Construction Ltd
> http://webutils.co.uk
> http://billiardsearch.net
> http://9ballpool.co.uk
>
> AJAX Blackjack - real-time multi-player blackjack game with no flash, java
> or software downloads required - http://blackjack.webutils.co.uk
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: $H need help

2009-08-25 Thread DJ Mangus
oh, forgot to mention instead of input.id you might want to use
input.identify() as it will return the id, or if the element is missing an
id, assign one and then return the assignment.

On Tue, Aug 25, 2009 at 2:55 PM, DJ Mangus  wrote:

> what you want to do is h.set(input.id, input.getValue())
> See http://www.prototypejs.org/api/hash/set
>
> 2009/8/25 Kevin Porter 
>
>
>> Same:
>>
>> var h = $H({});
>> h[input.id] = input.getValue();
>>
>> - Kev
>>
>>
>> buda wrote:
>> > Thanks for replay, but
>> > I Do need to add it to a $H object 
>> >
>> > how to do it? Thanks )
>> >
>> > On 26 авг, 00:14, Kevin Porter  wrote:
>> >
>> >> var h = {};
>> >> h[input.id] = input.getValue();
>> >>
>> >> Doesn't even need to be a $H(), just a regular JS object/hash.
>> >>
>> >> - Kev
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> buda wrote:
>> >>
>> >>> I need to add to a hash id of an input and its value
>> >>> when I try to do
>> >>>
>> >>>  var h = $H({});
>> >>>  h.update({ input.id: input.getValue() });
>> >>>
>> >>> an error of bad syntax is generated
>> >>>
>> >>> how can I add an element to a hash which key is an input.id and value
>> >>> is an input.getValue()?
>> >>>
>> >>> Thanks
>> >>>
>> >> --
>> >> Kevin Porter
>> >> Advanced Web Construction
>> Ltdhttp://webutils.co.ukhttp://billiardsearch.nethttp://9ballpool.co.uk
>> >>
>> >> AJAX Blackjack - real-time multi-player blackjack game with no flash,
>> java or software downloads required -http://blackjack.webutils.co.uk-Скрыть 
>> цитируемый текст -
>> >>
>> >> - Показать цитируемый текст -
>> >>
>> > >
>> >
>> >
>> >
>> >
>>
>>
>> --
>> Kevin Porter
>> Advanced Web Construction Ltd
>> http://webutils.co.uk
>> http://billiardsearch.net
>> http://9ballpool.co.uk
>>
>> AJAX Blackjack - real-time multi-player blackjack game with no flash, java
>> or software downloads required - http://blackjack.webutils.co.uk
>>
>>
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: $H need help

2009-08-25 Thread DJ Mangus
gah, just looked at the source, I was wrong about that, ignore the last
message I sent.

On Tue, Aug 25, 2009 at 4:41 PM, DJ Mangus  wrote:

> if you feed set() an object it should set multiple key/value pairs at once.
>
>
> On Tue, Aug 25, 2009 at 4:32 PM, Kevin Porter  wrote:
>
>>
>>
>> What do you mean by 'some pairs'?
>>
>> Looks like set() is what you want.
>>
>> What do you want your hash to look like before and after?
>>
>> - Kev
>>
>> buda wrote:
>> > Sorry for not full description of my task - I need to add some pairs
>> > to a hash - so set() doesnt hepl me :(
>> >
>> > On 26 авг, 01:18, Kevin Porter  wrote:
>> >
>> >> Oops sorry! Posted without testing, I didn't realise you lost that
>> >> assignment notation with a $H() hash.
>> >>
>> >> - Kev
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> DJ Mangus wrote:
>> >>
>> >>> what you want to do is h.set(input.id <http://input.id>,
>> >>> input.getValue())
>> >>>
>> >>> Seehttp://www.prototypejs.org/api/hash/set
>> >>>
>> >>> 2009/8/25 Kevin Porter > k...@9ballpool.co.uk>>
>> >>>
>> >>> Same:
>> >>>
>> >>> var h = $H({});
>> >>> h[input.id <http://input.id>] = input.getValue();
>> >>>
>> >>> - Kev
>> >>>
>> >>> buda wrote:
>> >>> > Thanks for replay, but
>> >>> > I Do need to add it to a $H object 
>> >>>
>> >>> > how to do it? Thanks )
>> >>>
>> >>> > On 26 авг, 00:14, Kevin Porter > >>> <mailto:k...@9ballpool.co.uk>> wrote:
>> >>>
>> >>> >> var h = {};
>> >>> >> h[input.id <http://input.id>] = input.getValue();
>> >>>
>> >>> >> Doesn't even need to be a $H(), just a regular JS object/hash.
>> >>>
>> >>> >> - Kev
>> >>>
>> >>> >> buda wrote:
>> >>>
>> >>> >>> I need to add to a hash id of an input and its value
>> >>> >>> when I try to do
>> >>>
>> >>> >>>  var h = $H({});
>> >>> >>>  h.update({ input.id <http://input.id>: input.getValue() });
>> >>>
>> >>> >>> an error of bad syntax is generated
>> >>>
>> >>> >>> how can I add an element to a hash which key is an input.id
>> >>> <http://input.id> and value
>> >>> >>> is an input.getValue()?
>> >>>
>> >>> >>> Thanks
>> >>>
>> >>> >> --
>> >>> >> Kevin Porter
>> >>> >> Advanced Web Construction
>> >>> Ltdhttp://webutils.co.ukhttp://billiardsearch.nethttp://
>> 9ballpool.co.uk
>> >>> <http://9ballpool.co.uk>
>> >>>
>> >>> >> AJAX Blackjack - real-time multi-player blackjack game with no
>> >>> flash, java or software downloads required
>> >>> 
>> >>> -http://blackjack.webutils.co.uk-Скрыть<http://blackjack.webutils.co.xn--uk--eed4aej5ek>цитируемый
>> >>>  текст -
>> >>>
>> >>> >> - Показать цитируемый текст -
>> >>>
>> >>> --
>> >>> Kevin Porter
>> >>> Advanced Web Construction Ltd
>> >>>http://webutils.co.uk
>> >>>http://billiardsearch.net
>> >>>http://9ballpool.co.uk
>> >>>
>> >>> AJAX Blackjack - real-time multi-player blackjack game with no
>> >>> flash, java or software downloads required -
>> >>>http://blackjack.webutils.co.uk
>> >>>
>> >> --
>> >> Kevin Porter
>> >> Advanced Web Construction
>> Ltdhttp://webutils.co.ukhttp://billiardsearch.nethttp://9ballpool.co.uk
>> >>
>> >> AJAX Blackjack - real-time multi-player blackjack game with no flash,
>> java or software downloads required -http://blackjack.webutils.co.uk-Скрыть 
>> цитируемый текст -
>> >>
>> >> - Показать цитируемый текст -
>> >>
>> > >
>> >
>> >
>> >
>> >
>>
>>
>> --
>> Kevin Porter
>> Advanced Web Construction Ltd
>> http://webutils.co.uk
>> http://billiardsearch.net
>> http://9ballpool.co.uk
>>
>> AJAX Blackjack - real-time multi-player blackjack game with no flash, java
>> or software downloads required - http://blackjack.webutils.co.uk
>>
>>
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: $H need help

2009-08-25 Thread DJ Mangus

ok, h.update is correct if you want to send it multiple values at
once, if you do not know exactly how many items you will be adding at
once until runtime, you'd have to loop anyway to build the object to
send to h.update.

In that case just loop over them once and add to the hash

Something like:

$$('#contents').each(function(s) {  h.set(s.identify(), s.getValue() ) });

On Tue, Aug 25, 2009 at 5:09 PM, buda  wrote:
>
> I need to put into hash pairs:
>
> input1.id : input1.getValue
>    
> inputN.id : inputN.getValue
>
> where N may be from 5 to 25
>
>
> On 26 авг, 02:46, DJ Mangus  wrote:
> > gah, just looked at the source, I was wrong about that, ignore the last
> > message I sent.
> >
> >
> >
> > On Tue, Aug 25, 2009 at 4:41 PM, DJ Mangus  wrote:
> > > if you feed set() an object it should set multiple key/value pairs at 
> > > once.
> >
> > > On Tue, Aug 25, 2009 at 4:32 PM, Kevin Porter  
> > > wrote:
> >
> > >> What do you mean by 'some pairs'?
> >
> > >> Looks like set() is what you want.
> >
> > >> What do you want your hash to look like before and after?
> >
> > >> - Kev
> >
> > >> buda wrote:
> > >> > Sorry for not full description of my task - I need to add some pairs
> > >> > to a hash - so set() doesnt hepl me :(
> >
> > >> > On 26 авг, 01:18, Kevin Porter  wrote:
> >
> > >> >> Oops sorry! Posted without testing, I didn't realise you lost that
> > >> >> assignment notation with a $H() hash.
> >
> > >> >> - Kev
> >
> > >> >> DJ Mangus wrote:
> >
> > >> >>> what you want to do is h.set(input.id <http://input.id>,
> > >> >>> input.getValue())
> >
> > >> >>> Seehttp://www.prototypejs.org/api/hash/set
> >
> > >> >>> 2009/8/25 Kevin Porter  > >> k...@9ballpool.co.uk>>
> >
> > >> >>>     Same:
> >
> > >> >>>     var h = $H({});
> > >> >>>     h[input.id <http://input.id>] = input.getValue();
> >
> > >> >>>     - Kev
> >
> > >> >>>     buda wrote:
> > >> >>>     > Thanks for replay, but
> > >> >>>     > I Do need to add it to a $H object 
> >
> > >> >>>     > how to do it? Thanks )
> >
> > >> >>>     > On 26 авг, 00:14, Kevin Porter  > >> >>>     <mailto:k...@9ballpool.co.uk>> wrote:
> >
> > >> >>>     >> var h = {};
> > >> >>>     >> h[input.id <http://input.id>] = input.getValue();
> >
> > >> >>>     >> Doesn't even need to be a $H(), just a regular JS object/hash.
> >
> > >> >>>     >> - Kev
> >
> > >> >>>     >> buda wrote:
> >
> > >> >>>     >>> I need to add to a hash id of an input and its value
> > >> >>>     >>> when I try to do
> >
> > >> >>>     >>>  var h = $H({});
> > >> >>>     >>>  h.update({ input.id <http://input.id>: input.getValue() });
> >
> > >> >>>     >>> an error of bad syntax is generated
> >
> > >> >>>     >>> how can I add an element to a hash which key is an input.id
> > >> >>>     <http://input.id> and value
> > >> >>>     >>> is an input.getValue()?
> >
> > >> >>>     >>> Thanks
> >
> > >> >>>     >> --
> > >> >>>     >> Kevin Porter
> > >> >>>     >> Advanced Web Construction
> > >> >>>     Ltdhttp://webutils.co.ukhttp://billiardsearch.nethttp://
> > >> 9ballpool.co.uk
> > >> >>>     <http://9ballpool.co.uk>
> >
> > >> >>>     >> AJAX Blackjack - real-time multi-player blackjack game with no
> > >> >>>     flash, java or software downloads required
> > >> >>>     
> > >> >>> -http://blackjack.webutils.co.uk-Скрыть<http://blackjack.webutils.co.xn--uk--eed4aej5ek>цитируемый
> > >> >>>  текст -
> >
> > >> >>>     >> - Показать цитируемый текст -
>

[Proto-Scripty] Re: $H need help

2009-08-25 Thread DJ Mangus
if you feed set() an object it should set multiple key/value pairs at once.

On Tue, Aug 25, 2009 at 4:32 PM, Kevin Porter  wrote:

>
>
> What do you mean by 'some pairs'?
>
> Looks like set() is what you want.
>
> What do you want your hash to look like before and after?
>
> - Kev
>
> buda wrote:
> > Sorry for not full description of my task - I need to add some pairs
> > to a hash - so set() doesnt hepl me :(
> >
> > On 26 авг, 01:18, Kevin Porter  wrote:
> >
> >> Oops sorry! Posted without testing, I didn't realise you lost that
> >> assignment notation with a $H() hash.
> >>
> >> - Kev
> >>
> >>
> >>
> >>
> >>
> >> DJ Mangus wrote:
> >>
> >>> what you want to do is h.set(input.id <http://input.id>,
> >>> input.getValue())
> >>>
> >>> Seehttp://www.prototypejs.org/api/hash/set
> >>>
> >>> 2009/8/25 Kevin Porter  k...@9ballpool.co.uk>>
> >>>
> >>> Same:
> >>>
> >>> var h = $H({});
> >>> h[input.id <http://input.id>] = input.getValue();
> >>>
> >>> - Kev
> >>>
> >>> buda wrote:
> >>> > Thanks for replay, but
> >>> > I Do need to add it to a $H object 
> >>>
> >>> > how to do it? Thanks )
> >>>
> >>> > On 26 авг, 00:14, Kevin Porter  >>> <mailto:k...@9ballpool.co.uk>> wrote:
> >>>
> >>> >> var h = {};
> >>> >> h[input.id <http://input.id>] = input.getValue();
> >>>
> >>> >> Doesn't even need to be a $H(), just a regular JS object/hash.
> >>>
> >>> >> - Kev
> >>>
> >>> >> buda wrote:
> >>>
> >>> >>> I need to add to a hash id of an input and its value
> >>> >>> when I try to do
> >>>
> >>> >>>  var h = $H({});
> >>> >>>  h.update({ input.id <http://input.id>: input.getValue() });
> >>>
> >>> >>> an error of bad syntax is generated
> >>>
> >>> >>> how can I add an element to a hash which key is an input.id
> >>> <http://input.id> and value
> >>> >>> is an input.getValue()?
> >>>
> >>> >>> Thanks
> >>>
> >>> >> --
> >>> >> Kevin Porter
> >>> >> Advanced Web Construction
> >>> Ltdhttp://webutils.co.ukhttp://billiardsearch.nethttp://
> 9ballpool.co.uk
> >>> <http://9ballpool.co.uk>
> >>>
> >>> >> AJAX Blackjack - real-time multi-player blackjack game with no
> >>> flash, java or software downloads required
> >>> 
> >>> -http://blackjack.webutils.co.uk-Скрыть<http://blackjack.webutils.co.xn--uk--eed4aej5ek>цитируемый
> >>>  текст -
> >>>
> >>> >> - Показать цитируемый текст -
> >>>
> >>> --
> >>> Kevin Porter
> >>> Advanced Web Construction Ltd
> >>>http://webutils.co.uk
> >>>http://billiardsearch.net
> >>>http://9ballpool.co.uk
> >>>
> >>> AJAX Blackjack - real-time multi-player blackjack game with no
> >>> flash, java or software downloads required -
> >>>http://blackjack.webutils.co.uk
> >>>
> >> --
> >> Kevin Porter
> >> Advanced Web Construction
> Ltdhttp://webutils.co.ukhttp://billiardsearch.nethttp://9ballpool.co.uk
> >>
> >> AJAX Blackjack - real-time multi-player blackjack game with no flash,
> java or software downloads required -http://blackjack.webutils.co.uk-Скрыть 
> цитируемый текст -
> >>
> >> - Показать цитируемый текст -
> >>
> > >
> >
> >
> >
> >
>
>
> --
> Kevin Porter
> Advanced Web Construction Ltd
> http://webutils.co.uk
> http://billiardsearch.net
> http://9ballpool.co.uk
>
> AJAX Blackjack - real-time multi-player blackjack game with no flash, java
> or software downloads required - http://blackjack.webutils.co.uk
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Nested, Sortable lists

2009-09-01 Thread DJ Mangus
Methinks some code would help us figure out what you are doing and if we can
help.

On Mon, Aug 31, 2009 at 6:08 AM, Mike  wrote:

>
> Hello community,
>
> I'm new here, and any help anyone can provide will be greatly
> appreciated.
>
> I am trying to build a set of nested lists, each set of which will be
> sortable.  I don't want to drag items between lists, only allow each
> list to be reordered.
>
> I am getting no errors in my code, but the rendering result is
> strange.  In some cases, no lists will reorder, in others only the
> first item in the list can be moved, and others work like normal.  I
> haven't been able to identify a pattern.
>
> My guess is that the problem is being caused by the sequence in which
> the sortables are created.  I tried inverting the sequence (child
> lists created first) but that doesn't seem to help.
>
> Does anybody have any suggestions?
>
> Thanks!
>
> Mike
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Ajax.updater - after text has been inserted into element

2009-09-02 Thread DJ Mangus
I don't think there is one that fires afterward.  If you function#defer a
function onsuccess it should have been completed after the defer timeout.

On Wed, Sep 2, 2009 at 3:11 PM, Mojito  wrote:

>
> I'm using the Ajax.Updater.  I'm looking for the callback that is
> executed after the server response text has been inserted into an
> element.  The server is inserting some form elements and I want to
> apply Scriptaculous's inPlaceEditor to them.  Which callback would
> this be?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: execution order in IE

2009-09-03 Thread DJ Mangus
See this article:
http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynamically

On Thu, Sep 3, 2009 at 9:25 AM, JoJo  wrote:

>
> Instead of loading JS in the , how do I do includes like
> virtually all other languages?  Isn't Scriptaculous loading Effects.js
> and other files?  How is it doing that?
>
> On Sep 2, 11:36 pm, "Alex McAuley" 
> wrote:
> > If you need to garuntee that a variable,function or method exists i would
> > always wait until the dom is ready or in each function that gets called
> test
> > the function,variable or method exists else timeout untill it does
> > Alex Mcauleyhttp://www.thevacancymarket.com
> >
> > - Original Message -
> > From: "JoJo" 
> > To: "Prototype & script.aculo.us" <
> prototype-scriptaculous@googlegroups.com>
> > Sent: Thursday, September 03, 2009 6:31 AM
> > Subject: [Proto-Scripty] execution order in IE
> >
> > > In my , I'm loading several JS files.  I'm expecting this to
> > > occur:
> >
> > > 1) script1.js is loaded
> > > 2) script1.js runs - it creates an object
> > > 3) script2.js is loaded
> > > 4) script2.js runs - it creates a different object that depends on
> > > script1's object.
> > > 5) and so on
> >
> > > This works perfectly in Firefox and Safari, but fails about 25% of the
> > > time in IE.  I've heard that IE will load JS files in the correct
> > > order, but will not guarantee that they are executed in the same
> > > order.  How can I restructure my code or use Prototype to fix my
> > > current code?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: how merge two json objects?

2009-09-11 Thread DJ Mangus
I've never done this but I'm pretty sure you can use object.extend.
http://api.prototypejs.org/language/object.html#extend-class_method

On Fri, Sep 11, 2009 at 4:23 PM, Miguel Beltran R. wrote:

> Hi list, I have no idea how do merge two json objects?
>
>
> If have
> switch(a){
>case:1
>   vId='plan';
>   vParametros= {parameters: {control:vId, ejercicio_id:
> $F('ejercicio_id')}, evalScripts: true};
>   break;
>case:2
>   vId='actividad';
>   vParametros= {parameters: {control:vId, proyecto: $F('proyecto'),
> ejercicio_id: $F('ejercicio_id')}, evalScripts: true};
>   break;
>case:3
>   vId='vale';
>   vParametros= {parameters: {control:vId, ejercicio_id:
> $F('ejercicio_id')}, evalScripts: true};
>   break;
>else
>   vId='plan';
>   vParametros= {parameters: {control:vId, ejercicio_id:
> $F('ejercicio_id')}, evalScripts: true};
> }
>
> //create a PWC window with name "win"
> errores = {on0: function{
>//soStuff
>}
>,onFailure: function{
>//soStuff
>},onException: function{
>//soStuff
>}
> }
>
>
> win.setAjaxContent("carga_datos.htm", vParametros + errores, true, true);
> <--this not work, not send any option
>
> I try use
> http://proto-scripty.wikidot.com/prototype:how-to-bulletproof-ajax-requestswith
> http://prototype-window.xilinus.com/documentation.html#setAjaxContent
> --
> 
> Lo bueno de vivir un dia mas
> es saber que nos queda un dia menos de vida
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: how merge two json objects?

2009-09-11 Thread DJ Mangus
It's explained in the link I gave.

On Fri, Sep 11, 2009 at 5:30 PM, Miguel Beltran R. wrote:

>
>
> 2009/9/11 DJ Mangus 
>
>> I've never done this but I'm pretty sure you can use object.extend.
>> http://api.prototypejs.org/language/object.html#extend-class_method
>>
>>
>> but how used?
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Sortable.create & reverteffect

2009-09-14 Thread DJ Mangus
Rather than hide it you could remove it completely from the DOM.  If your
element isn't recreated via ajax after a drop, move it yourself after a
successful drop by removing it from the DOM and reinserting it where it was
dropped (or wherever makes sense for that matter if the target is sorted
somehow.).

On Mon, Sep 14, 2009 at 8:51 AM, ColinFine  wrote:

>
>
>
> On Sep 11, 2:19 am, "Jon B."  wrote:
> > I'm trying to use the reverteffect option on a sortable and it's not
> > doing what I would expect. My expectation is that the reverteffect
> > would only be triggered if the object I'm dragging is dropped back
> > where it started. What I'm seeing is that the reverteffect is
> > triggered regardless of where I drop the object. I'm including a
> > simple example below.
> >
> I havent' used reverteffect or sortable, but I've used revert on
> draggable, with a similar result.
>
> It appears that it reverts irrespective of whether the drop succeeded
> or not.
>
> What I have done is to hide the dragged element when the drag
> succeeds, so that the revert is not visible. In my case, the dropsite
> is then regenerated in Ajax, so there is a brief moment when the
> element has disappeared, and then it appears again in its new home. I
> don't know if your instance could work that way.
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: YSlow's rule "JavaScript at the bottom" w/Prototype

2009-09-16 Thread DJ Mangus
They do but you'd need to cache each combination of scripts once each.
 That's a great way to go about it if you require the same scripts on each
page, or the landing page requires all of them (and then it'd cache the
concat'd and minified version) and you include the lot on each other page no
matter if that page needs all or just some of the scripts.

On Wed, Sep 16, 2009 at 11:57 AM, Alex McAuley <
webmas...@thecarmarketplace.com> wrote:

>
> The compressed versions i speak of do get cached
>
>
> Alex Mcauley
> http://www.thevacancymarket.com
> - Original Message -
> From: "skaiuoquer" 
> To: "Prototype & script.aculo.us" <
> prototype-scriptaculous@googlegroups.com>
> Sent: Wednesday, September 16, 2009 7:51 PM
> Subject: [Proto-Scripty] Re: YSlow's rule "JavaScript at the bottom"
> w/Prototype
>
>
>
> Hey, you and me both, brother.
>
> We are building the new framework, starting from scratch, so maybe you
> are right and I am just troubled by the ghosts of the past and this
> will not happen this time around when we'll be using sane logic to
> build our code.
>
> I hope you are right.
>
> *suspense*
>
> On Sep 16, 3:43 pm, Jim Higson  wrote:
> > On Wednesday 16 September 2009 14:43:32 skaiuoquer wrote:
> >
> > > A non-cached "medium" page on it takes above half a minute to load on
> > > T1...
> >
> > > That's half a minute where the user is pretty much waiting for the JS
> > > files to download one after the other.
> >
> > Concatenate all files into one in the order that you are loading them,
> use
> > yui
> > compressor, gzip. You'll see at least an 80% decrease in load time.
> >
> > Still, I'd question the sanity of any system that takes 30 seconds to
> > serve a
> > web page.
> >
> > Jim
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: newbie - form submit

2009-09-20 Thread DJ Mangus
Never rely on client side validation, that's for convenience for your users,
not security.First, make the functionality works (including security)
without javascript.
Then override the submit button with javascript by observing the submit.  In
that event code you submit the form via ajax, hide the div, display what you
want, etc. then use event.stop to keep the default submit behavior
from occurring.
Good luck with this.

Some links:
http://api.prototypejs.org/dom/event.html#stop-class_method

http://api.prototypejs.org/dom/document.html#observe-class_method
and
http://api.prototypejs.org/ajax/ajax/updater.html

On Sun, Sep 20, 2009 at 9:47 AM, MEM  wrote:

>
> Hello all,
>
> I'd love to create a contact form using prototype and php.
> However, I want to make sure that, if the javascript is disable,
> the submission should be server side validated and submitted as well.
>
> If javascript is enable, the onclick event will trigger, hence, the js
> validation
> Will occur.
> If the javascript isn't enable, the onclick event will not trigger,
> so the submit button will get called, and the server side validation will
> occur.
>
> I don't know if it's precise, however, it works.
>
>
> Now what I'd like to do is, without leaving the same page,
> when the form is submitted, the div that contains the form gets hidden, and
> it should
> be replaced by a div telling: "The contact was send".
>
> I'm so newbie, that I've found a validation class called:
> "Really easy field validation with Prototype" and it seems to be very nice.
>
> Can anyone summarize the steps to accomplish this without losing the server
> side submission if, js
> Is disable somehow?
>
> Should I try to edit (I really don't like this idea) the validation class
> for doing this?
> Or can this be done otherwise?
>
>
> Thanks a lot to any feedback on this,
> Regards,
> MEM
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Dynamic test after ajax call

2009-09-21 Thread DJ Mangus
Sounds like your situation is very out of the norm.  Usually being able to
manipulate the DOM via JS is sufficient except in debugging situations (in
which case an extension is fine).  Good luck figuring out something
different to do.

On Mon, Sep 21, 2009 at 9:57 AM, Kumar  wrote:

>
> Thanks Bill. I am already using IE Developer Toolbar with Internet
> Explorer. I dont want to just see the DOM source, but indeed want to
> use. It was part of design to use it. Thanks for your reponse though.
>
> Thanks
>
> On Sep 21, 11:38 am, bill  wrote:
> > Kumar wrote:
> > > Hi Walter -
> >
> > > I completely understood what you meant. I have a strange situation
> > > here. My enitre design sits on top of the DOM for lateral processing.
> > > As soon as the DOM gets updated, there will be sequence of java script
> > > calls based on the elements generated on this DOM for form processing.
> > > After I heard that I cannot get the DOM state at the source code
> > > level, I will probably take a look at other design issue. This is
> > > something I never expected...
> >
> > You can look at the dom source code as it exists at any point in time,
> > just not by clicking "view source."  As was pointed out below, Firefox +
> > Firebug gives you a elegantly laid out picture (in source) of the dom.
> >
> >
> >
> >
> >
> > > Thanks
> >
> > > On Sep 21, 9:48 am, Walter Lee Davis  wrote:
> >
> > >> There's a fundamental difference between the source code and the
> > >> current state of the DOM. The former is fixed at the time that your
> > >> server sends it. And once that source is sent to the browser, the
> > >> browser interprets it and generates the DOM, which it uses to create
> > >> the on-screen display of the **current** state of the DOM.
> >
> > >> Anything you do later to modify the DOM causes the DOM itself to
> > >> change, and thus the screen to update, but does not update the source
>
> > >> you see in your browser. Think of the source as the score, and the DOM
>
> > >> as the orchestral performance. The conductor and orchestra is
> > >> JavaScript, then, to stretch the metaphor.
> >
> > >> When you request an element by its ID, you are "asking" the DOM, not
> > >> the source. When you modify an element on screen, or update it to
> > >> contain entirely new content, you are modifying the DOM, not the page
>
> > >> source.
> >
> > >> HTML:
> > >> something here
> >
> > >> JavaScript:
> > >> $('foo').addClassName('bar');
> > >> console.log($('foo').hasClassName('bar')) //=> true
> >
> > >> $$('.bar').invoke('insert',' with classname bar');
> > >> console.log($('foo').innerHTML) //=> something here with classname bar
> >
> > >> At no point above, if you looked in the source, would you see that
> > >> #foo now was #foo.bar, or that its content had changed, unless you
> > >> were using a tool such as Firebug to inspect the current state of the
>
> > >> DOM.
> >
> > >> Walter
> >
> > >> On Sep 21, 2009, at 9:22 AM, Kumar wrote:
> >
> > >>> Hi Tj -
> >
> > >>> Thanks for the prompt response. It really amazed me, when I heard
> that
> > >>> I can see source code of the original document and not the later
> > >>> things that got updated through the Ajax updater. We have this
> > >>> dependency where we need to make series of Java script calls based on
> > >>> the dynamic response created by the Ajax updater. That includes the
> > >>> dynamically generated element id's and stuff. If these are not going
> > >>> to be visible in generated source, how am I supposed to make
> > >>> advantage. Is there a way, though prorotype Ajax ?
> >
> > >>> Thanks
> >
> > >>> On Sep 19, 8:21 am, "T.J. Crowder"  wrote:
> >
> >  Hi,
> >
> >  "View source" will only show you the original source of the
> document,
> >  not any later modifications you make to the DOM (e.g., via
> >  Ajax.Updater or any of several other means).  Why does it matter?
> >  What is it you're trying to achieve looking at the source?  If it's
> >  just that you're trying to debug the markup or something, you can
> use
> >  Firefox with the Firebug[1] add-on, which will show you the current
> >  DOM tree rather than the original source.
> >
> >  [1]http://getfirebug.com/
> >
> >  HTH,
> >  --
> >  T.J. Crowder
> >  tj / crowder software / comwww.crowdersoftware.com
> >
> >  On Sep 18, 11:27 pm,Kumar wrote:
> >
> > > Hi All -
> >
> > > I am using prototype Ajax updater. The main intenntion of using
> > > updater is to show users a loading icon, but in background we are
> > > making a series webservice calls to wide variety of systems, then
> > > collabarate all the data to users at one go.
> >
> > > The page loads and calls ajax updater. Updater inturn updates a div
> > > tag with a search results. (results are processed in another jsp
> > > page). Here is the problem. After the entire page gets loaded with
> > > results, when I see the source I do not see the results grid in the
> >

[Proto-Scripty] Re: newbie - form submit and validation using really easy validation

2009-09-22 Thread DJ Mangus
OK, before you do anything with javascript, get the page working without it
first.  That code you wrote there will output a div inside the head when
it's submitted.Seriously, do that otherwise you will be troubleshooting 2
things at once.  Get it working without javascript first, always.

Also what is the source or documentation on validation.js?


On Tue, Sep 22, 2009 at 4:45 AM, MEM  wrote:

>  DJ Mangus, I’m really newbie here. :( I will server side validate. But
> right now, I just like to make this working.
>
>
>
> I'm trying to do the following:
>
> When the form data is send to an e-mail, the form disappears, and a div
> with new contents will appear.
>
>
>
> However, I'm unable to do so:
>
>
>
>
>
> Here is the full relevant code:
>
>
>
> 
>
>
>
> 
>
> 
>
>
>
> 
>
>
>if(isset($_POST['submit']))
>
>{
>
>   //recipients
>
>   $to  = 'sendt...@gmail.com';
>
>
>
>   $from = $_POST['contact_email'];
>
>
>
>   // subject
>
>   $subject = 'Some subject';
>
>
>
>   // message
>
>   $message = '
>
>   
>
> 
>
>   test
>
> 
>
>
>
> 
>
>   the subject was:' .
> $subject. '
>
> 
>
>   
>
>   ';
>
>
>
>   // To send HTML mail, the Content-type
> header must be set
>
>   $headers  = 'MIME-Version: 1.0' . "\r\n";
>
>   $headers .= 'Content-type: text/html;
> charset=UTF-8' . "\r\n";
>
>
>
>   // Additional headers
>
>   $headers .= 'From: Testingfrom <'.$from.'>'
> . "\r\n";
>
>
>
>   // Mail it
>
>   mail($to, $subject, $message, $headers);
>
>
>
>   echo "Thanks for your contact.";
>
>
>
>}
>
>
>
> ?>
>
>
>
> 
>
>
>
> 
>
> 
>
>
>
> Please fill in :
>
> 
>
>  method="post">
>
>
>
>
>
>
>
>   Form
>
>
>
>   
>
>
>
> 
>
>E-mail:
>
> 
>
>
>
> 
>
> title="Insert e-mail." />
>
> 
>
>
>
>   
>
>
>
>   
>
>
>
> 
>
>URL:
>
> 
>
>
>
> 
>
>
>
> 
>
>
>
>   
>
>
>
>
>
>
>
>
>
>
>
> 
>
>
>
>  
>
>
>
>
>
>   function formCallback(result, sendData)
>
>   {
>
>if(result == true)
>
>
>
> $('formWrapper').innerHTML=
> 'Your form was successfully submitted!';
>
>   }
>
>
>
>   new Validation(sendData,{immediate:true,
> useTitles:true, onFormValidate:formCallback});
>
>
>
>
>
>
>
>
>
> 
>
>
>
> 
>
>
>
> 
>
>
>
>
>
> Thanks in advance,
>
> MEM
>
>
>
> *From:* prototype-scriptaculous@googlegroups.com 

[Proto-Scripty] Re: Event.pointerX() Different Between IE and FF?

2009-09-24 Thread DJ Mangus

Not sure about the major browsers but just read about iPhone
optimiation of pages and viewport is certainly odd in mobile Safari.

Sent from my phone so pardon the spelling errors.

On Sep 24, 2009, at 6:34 AM, KammylandSoftware 
wrote:

>
> Does it perhaps have anything to do with whether the measurements are
> taken relative to the Page or Viewport? I'm not quite clear on the
> difference between the Page and Viewport. Does anyone know if there is
> a difference?
>
> Thanks.
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Setting focus after Ajax.Updater complete?

2009-09-27 Thread DJ Mangus

If the id 'editdescription' is added to the DOM it won't have been
processed by the browser OnComplete. You will have to delay the
function.

Sent from my phone so pardon the spelling errors.

On Sep 27, 2009, at 10:59 PM, Steve Marshall 
wrote:

>
> Hi all.  I'm brand-new to Prototype - just discovered it yesterday,
> and I must say it feels like I have come home. It seems to be at just
> the right level, and it just works (so far).  I'm a happy camper!
>
> One minor thing - I tried using an Ajax.Updater, and when it completes
> I want to set the focus to an entry field, but it isn't working.
> Here's my Ajax.Updater:
>
>  new Ajax.Updater('row'+code, 'svc/ajax.php', {
>  parameters: {action: 'editlibcat', code: catcode},
>  onComplete: function() {$('editdescription').focus();}
>  });
>
> This call sets a row in a table into editable form, and there's
> another Updater that does the update - pretty standard stuff I'd
> reckon.  There definitely IS an element with ID='editdescription' -
> it's in the HTML that is returned from the Ajax call.  But focus never
> gets set.  Everything else is perfect.  It must be me - what do I have
> wrong?
>
> Thanks again for Prototype - it's great!
>
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: New API Doc

2009-10-08 Thread DJ Mangus

No. You aren't.

Sent from my phone so pardon the spelling errors.

On Oct 8, 2009, at 10:22 AM, louis w  wrote:

>
> Am I the only one that missed the old online api docs? This new one
> seems hard to use.
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Major frustrations with Effect.Morph

2009-10-13 Thread DJ Mangus

I seem to remember that morph can only handle properties that can be
tweened. The solution in my experience is to morph between classes
where the non tweenable properies are applied at the end of the
effect.  I haven't worked with morph for over a year so take that with
a grain of salt.

Sent from my phone so pardon the spelling errors.

On Oct 13, 2009, at 10:18 AM, patrick  wrote:

>
> Because I posted this topic twice by mistake, it seems this is a
> confusing thread.  I replied to the other, but no one answered-- and
> people are replying to this one, so I am going to repost my last reply
> from the other thread.
>
>> Patrick double posted and i replied to the
>> second post - perhaps thats in a different group ?
>
> Sorry about that--  I clicked on my post to view it after I submitted
> it, and I got a message saying my post had been removed-- so I posted
> it a 2nd time, and then the 1st one was there after all.. So I deleted
> it..
>
> Anyway, after many hours of trying to figure this thing out, I finally
> figured out what the deal is.  Apparently, for whatever reason, there
> are many css attributes that are simply not accessible by getStyle.
>
> I will prove this with the firebug console.
>
> In my html document, I have:
>
> hello
> hello again
>
> ... in my external css file, I have:
>
> #test {
>  padding: 25px;
>
> }
>
> #test2 {
>  padding: 25px;
>  display: inline;
>
> }
>
> In firebug:
>
 $('test')
> 
 $('test2')
>
> 
>
> .. ok, so both test and test2 are there..
>
 $('test').getStyle('padding')
>
> ""
>
 $('test2').getStyle('display')
>
> "inline"
>
> ...  so it can read the display, but not padding (for whatever
> reason).
>
 $('test2').getStyle('padding')
> ""
 new Effect.Morph($('test2'), {style: {'padding': '100px'}});
>
> Object element=p#test2 style=Object options=Object
 $('test2').getStyle('padding')
>
> "100px 100px 100px 100px"
>
> ...  And that is why I would have to initiate the morph call several
> times before the changes would actually take effect.  So I found that
> if I put in my dom:loaded observer setStyle{'padding': '50px'} -- then
> it works because it can see the padding.  But I do not understand why
> it can't see it to begin with... sooo frustrating and I wasted so many
> hours on something that seems so dumb.
>
> ...  And then there are other attributes that morph just will not
> change at all, no matter what...
>
 $('test2').getStyle('display')
> "inline"
 new Effect.Morph(('test2'), {style: {'display': 'block'}});
>
> Object element=p#test2 style=Object options=Object
 $('test2').getStyle('display')
>
> "inline"
>
> ... ?!??!?!?!
>
> So.. I have to manually do setStyle to change the display evidently.
> nonsense
>
> -patrick
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



Re: [Proto-Scripty] Event.element

2010-01-10 Thread DJ Mangus
What is returned is the same thing you'd get if you used $('id').
Chain on .identify to get the Id from a DOM node.

On Sunday, January 10, 2010, bill  wrote:
>
>
>
>
>
> The docs say:
>
>
>
> Event.element(event) -> Element
> Returns the DOM element on which the event occurred.
>
> But, what is actually returned ?
> If not the ID, what do I do to get the id of the div in which the click
> occurred ?
>
>
>
> --
> Bill Drescher
> william {at} TechServSys {dot} com
>
>
>
-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.




Re: [Proto-Scripty] Event.element

2010-01-10 Thread DJ Mangus
Either should work fine.  No need for a variable though. It's what
makes prototype so nice.

Sent from my phone so please pardon any spelling errors.

On Jan 10, 2010, at 11:08 AM, bill  wrote:

> DJ Mangus wrote:
>>
>> What is returned is the same thing you'd get if you used $('id').
>> Chain on .identify to get the Id from a DOM node.
> Thank you.
> as in:
>
> function clickHander (event) {
> var id = event.element().identify ?
>
> or rather:
> function clickHander (event) {
> var element= event.element()
> var id = element.identify()
>
> ?
> ...
>
> --
> Bill Drescher
> william {at} TechServSys {dot} com
> --
> You received this message because you are subscribed to the Google
> Groups "Prototype & script.aculo.us" group.
> To post to this group, send email to prototype-scriptaculous@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com
> .
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en
> .
-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.




Re: [Proto-Scripty] Event.element

2010-01-10 Thread DJ Mangus
Oh. Missed the fact that identify is a method. Not a variable. So You
are close.

Sent from my phone so please pardon any spelling errors.

On Jan 10, 2010, at 11:08 AM, bill  wrote:

> DJ Mangus wrote:
>>
>> What is returned is the same thing you'd get if you used $('id').
>> Chain on .identify to get the Id from a DOM node.
> Thank you.
> as in:
>
> function clickHander (event) {
> var id = event.element().identify ?
>
> or rather:
> function clickHander (event) {
> var element= event.element()
> var id = element.identify()
>
> ?
> ...
>
> --
> Bill Drescher
> william {at} TechServSys {dot} com
> --
> You received this message because you are subscribed to the Google
> Groups "Prototype & script.aculo.us" group.
> To post to this group, send email to prototype-scriptaculous@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com
> .
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en
> .
-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.




Re: [Proto-Scripty] divide one long table into multiple 40 rows

2010-02-09 Thread DJ Mangus
That really should be handled serverside IMO. Otherwise all the data
is downloaded upon initial page call when all you need is one page
worth at that point.

Sent from my phone so please pardon any spelling errors.

On Feb 9, 2010, at 10:20 AM, albert kao  wrote:

> Instead of displaying one long table with many rows and use the scroll
> bar to look at the data.
> Is it possible to divide the table so that each screen will display at
> most 40 rows?
> The user click the "Next", "Previous" buttons to go to the next or
> previous page.
> or the "1", "2", "3", ... to go to any page directly
> Any sample code available?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Prototype & script.aculo.us" group.
> To post to this group, send email to prototype-scriptaculous@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com
> .
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] get a file from intranet server

2010-02-09 Thread DJ Mangus
I'm confused. Are you wanting to call up a local file? Or are you
running a webserver on that vista machine?

You really should install a webserver on the machine first and then
ask in the place where they support your server rather than hereas
this question isn't really about prototype.

Sent from my phone so please pardon any spelling errors.

On Feb 9, 2010, at 8:02 AM, albert kao  wrote:

> How to get (download) a file from intranet server with Prototype ?
> e.g. the file is C:\dir1\data.txt and the Windows Vista server IP
> address is 192.168.0.112.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Prototype & script.aculo.us" group.
> To post to this group, send email to prototype-scriptaculous@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com
> .
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] Re: get a file from intranet server

2010-02-10 Thread DJ Mangus
Prototype runs on the client (ie webbrowser) rather than the server.

I wish we could help you but the answer depends on the webserver you
are running and it's configuration. You really should go through the
support channels for your server.

Sent from my phone so please pardon any spelling errors.

On Feb 10, 2010, at 12:23 PM, albert kao  wrote:

> On Feb 9, 4:13 pm, DJ Mangus  wrote:
>> I'm confused. Are you wanting to call up a local file? Or are you
>> running a webserver on that vista machine?
>>
>> You really should install a webserver on the machine first and then
>> ask in the place where they support your server rather than hereas
>> this question isn't really about prototype.
>>
>> Sent from my phone so please pardon any spelling errors.
>>
>> On Feb 9, 2010, at 8:02 AM, albert kao  wrote:
>>
>>> How to get (download) a file from intranet server with Prototype ?
>>> e.g. the file is C:\dir1\data.txt and the Windows Vista server IP
>>> address is 192.168.0.112.
>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Prototype & script.aculo.us" group.
>>> To post to this group, send email to 
>>> prototype-scriptaculous@googlegroups.com
>>> .
>>> To unsubscribe from this group, send email to 
>>> prototype-scriptaculous+unsubscr...@googlegroups.com
>>> .
>>> For more options, visit this group athttp://groups.google.com/
>>> group/prototype-scriptaculous?hl=en
>>> .
> I apologize for the confusion.
> I like to download a file (C:\dir1\data.txt) from server (IP address
> 192.168.0.112) to my local machine which is running a Prototype
> javascript.
> How to do that?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Prototype & script.aculo.us" group.
> To post to this group, send email to prototype-scriptaculous@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com
> .
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] can Request be used to track navigation clicks asynchronously?

2010-02-16 Thread DJ Mangus
Don't see why not though it'd slow down the user experience a bit (not
necessarily a good thing).

Have the onclick block, send data to server, server responds, then in
the Ajax callback send user to the destination via window.location

Note: I haven't done this, it's just an off the top of my head
suggestion.

Sent from my phone so please pardon any spelling errors.

On Feb 15, 2010, at 8:28 PM, manfmnantucket 
wrote:

> Hi all,
>
> I'm trying to use Prototype to do asynchronous click-tracking... that
> is, to
> log a server record each time a user clicks a link to navigate to
> another page.
>
> I've set the link onclick up to call a simple function which makes an
> Ajax.Request to send the data
> without blocking.
>
> However usually the server never gets the data, I think because the
> current page Unloads before
> Request can complete.
>
> What's the correct way to accomplish this? Is there a way to make page
> Unload wait until the
> Request is sent (but not until the server responds)??
>
> thanks!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Prototype & script.aculo.us" group.
> To post to this group, send email to prototype-scriptaculous@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com
> .
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] The Unofficial Wiki

2010-04-08 Thread DJ Mangus
If it becomes easy to contribute to the official page then yes, that's
the ideal answer as it's easier to find.  If it wasn't for this group,
I wouldn't have known about your wiki.

On Apr 8, 2010, at 6:23 AM, "T.J. Crowder"  wrote:

> Hi folks,
>
> As many of you know, we've had an unofficial Prototype &
> script.aculo.us wiki for about 18 months:
> http://proto-scripty.wikidot.com/
>
> I have a question for the community, but first a preamble.
>
> Preamble:
>
> In the last year (more, actually), there's been precisely one edit by
> someone other than me. :-) (Doug Reeder added an on0 handler to the
> bulletproof ajax page.) I wrote the vast majority of the articles and
> have been very nearly the only person maintaining them, not that
> there's been a lot to do on that front. (Don't get the impression I
> mind; I don't.) This suggests to me that -
>
> 1. We don't need a wiki
>
> or
>
> 2. We do, but it's too hard to contribute to that one because you have
> to request access and wait for it to be granted
>
> As a side note: Tobie and the core team are working on moving the main
> Prototype website to GitHub (don't worry, the URL doesn't change) from
> the current CMS it's on (Mephisto), and Tobie says that it will be a
> lot easier for people to contribute official content to the website
> once that's done.
>
> Question:
>
> Do we need a wiki with user-generated content? Or should we just move
> all of the relevant content to the Prototype website and make sure the
> process for contributing to the website is well-publicized, easy, and
> efficient?
>
> Thanks,
> --
> T.J. Crowder
> Independent Software Consultant
> tj / crowder software / com
> www.crowdersoftware.com
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Prototype & script.aculo.us" group.
> To post to this group, send email to prototype-scriptacul...@googlegroups.com.
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] Re: Effect.Morph applied to background image

2010-04-11 Thread DJ Mangus
That is all i can think of.  Quite heavy handed to have such a
transition, but doable.  Possibly always have a clone behind the
transitioning element and just morph the opacity of the one on top
anytime you want to change the background.

Btw, the reason morph only effects what it does is that the only
things that can easily calculate in between stages are effected.  Ie,
you cannot 'tween' the change of typesets, either.

On Apr 11, 2010, at 1:20 PM, Jinsa  wrote:

> Hey Junkshops :)
>
> First I would thank you for your answer. The setStyle may solve the
> problem linked to the background image (what a shame that morph don't
> work with bgimage :/) but the problem is that I won't get the "morph"
> effect between the bakground change which is what I am searching for.
> I'm thinking of a clone appearing as the same time the real one
> disappears but it seems very complicated to solve a "tiny" problem
> right?
>
> The size change is just a fact I've put in order to check the
> effect.morph was running, in real case I don't need it.
>
> That sounds quite a deal to do some bgimage morphing, do you have some
> idea in order to make it?
>
> Enjoy your night,
>
> Jinsa ;)
>
> On 11 avr, 17:18, Junkshops  wrote:
>> According to the 
>> wiki:http://wiki.github.com/madrobby/scriptaculous/effect-morph
>> ...morph only works on length and color based attributes, so it won't
>> switch the background image for you. Why don't you just use setStyle
>> on the containing element and then use morph to change the size?
>>
>> Cheers, Junk
>>
>> On Apr 11, 7:48 am, Jinsa  wrote:
>>
>>> Anyone may have a clue? :(
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Prototype & script.aculo.us" group.
> To post to this group, send email to prototype-scriptacul...@googlegroups.com.
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] Return From Each Loop

2010-04-14 Thread DJ Mangus
What you probably want is other enumerable methods, such as
http://www.prototypejs.org/api/enumerable/any


On Apr 13, 2010, at 11:53 AM, sporkit  wrote:

> I'm trying to validate that at least one checkbox of 4 has been
> selected.  The code seems simple enough to me.
>
> function testRecipient() {
>   var required = ["dir", "dev", "pub", "web"];
>   required.each( function (name) {
>   if ( $(name).checked == true )
>   return true;
>   });
>
>   alert('Please select at least one recpipient for your email.');
>   return false;
> }
>
> Shouldn't returning true exit directly from the function?  Even if I
> reach the return true statement, the function keeps looping until it
> reaches the alert and returns false.  I could probably throw $break,
> but I feel as if I'm missing something really important here...
>
> Thanks!!!
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Prototype & script.aculo.us" group.
> To post to this group, send email to prototype-scriptacul...@googlegroups.com.
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] Another help with $$ needed

2010-04-19 Thread DJ Mangus
What you are looking for is
http://api.prototypejs.org/language/enumerable/prototype/invoke/

Sent from my iPad

On Apr 19, 2010, at 10:23 PM, Ran Berenfeld  wrote:

> Hello
> Is there a way to do something like $$("xxx").hide()  ?
> (instead of iteration over the array)
> i.e "extend" the Array JS object with some more functions ? I have
> many places
> that are doing the same thing (iterating on the array to call a
> method)
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Prototype & script.aculo.us" group.
> To post to this group, send email to prototype-scriptacul...@googlegroups.com.
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.