Re: [Proto-Scripty] Re: event on leaving page

2011-03-10 Thread Walter Lee Davis


On Mar 10, 2011, at 2:25 AM, T.J. Crowder wrote:


What you can do in those functions is severely limited by modern
browsers (for all the good reasons you can think of). You can't open
new windows, do alerts/confirms



Thanks. This is the part I was remembering -- someone wanted an Are  
You Sure to interrupt closing the window on a running process, and I  
mistook the answer to mean that onunload couldn't do much of anything,  
versus 'couldn't do much of anything to the current window'. That  
makes perfect sense now.


Walter

--
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] Ajax upload

2011-03-10 Thread Keith
I am new to prototype JS library feature.

I want to implement ajax upload feature in my web application. For
that,

1) I wrote a servlet which copies the file to a particular folder in
server.
2) HTML form, I have a upload control and a Button which fires an ajax
request. Below is the code on the button

new Ajax.Request('http://isgdev.synygy.net/servlet/
CommonsFileUploadServlet',
 {
method: post,
  onSuccess: function(transport){
  var response = transport.responseText || no response text;
  alert(Check-! \n\n + response);
},
onFailure: function(){ alert('Something went wrong...') }
  });

When I click the button, the servlet is called but the selected file
is not copied to server.

But, When I submit the form, through regular post method (without
using ajax). The servlet works properly and the file is copied to
server properly.

Can you please guide me on this.

-- 
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] Behavior of Element.select different in 1.7

2011-03-10 Thread Incero
Hi,
I'm using the following statement in Prototype 1.6.1 to hide an image:
$('MyContainerId').select('img[src=images/icons16/
btn_add.gif]').invoke('hide');
but after updating to 1.7 the select statement returns [] instead if
the image object.
Is this a problem of 1.7 or have I used the select function in a wrong
way?

I've tested this code in IE8 and Firefox 3.6. The html looks like
this:
img border=0 align=absmiddle title=Remove src=images/icons16/
btn_add.gif

Thanks
Incero

-- 
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: Behavior of Element.select different in 1.7

2011-03-10 Thread T.J. Crowder
Hi,

My suspicion is if you change your selector to use $= rather than =
(e.g., 'img[src$=images/icons16/btn_add.gif]'), it'll start working
again. The $= operator looks for an attribute _ending_ in the given
string rather than _equalling_ it.[1]

I haven't looked into it, but my guess offhand is that the selector
engine in 1.7 is matching against the image's fully-resolved URL,
whereas 1.6's old engine was using the relative URL in the attribute.

FWIW, it's easily replicated:
Using 1.6.1 and =, works: http://jsbin.com/ewire5/
Using 1.7 and =, doesn't work: http://jsbin.com/ewire5/2
Using 1.7 and $=, works: http://jsbin.com/ewire5/2

[1] http://www.w3.org/TR/css3-selectors/#attribute-substrings

HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com

On Mar 10, 2:35 pm, Incero helgeonthe...@googlemail.com wrote:
 Hi,
 I'm using the following statement in Prototype 1.6.1 to hide an image:
 $('MyContainerId').select('img[src=images/icons16/
 btn_add.gif]').invoke('hide');
 but after updating to 1.7 the select statement returns [] instead if
 the image object.
 Is this a problem of 1.7 or have I used the select function in a wrong
 way?

 I've tested this code in IE8 and Firefox 3.6. The html looks like
 this:
 img border=0 align=absmiddle title=Remove src=images/icons16/
 btn_add.gif

 Thanks
 Incero

-- 
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: Behavior of Element.select different in 1.7

2011-03-10 Thread T.J. Crowder
Hi,

Sorry, that list should have been:

Using 1.6.1 and =, works: http://jsbin.com/ewire5/
Using 1.7 and =, doesn't work: http://jsbin.com/ewire5/2
Using 1.7 and $=, works: http://jsbin.com/ewire5/3

I'm sure everyone figured that out.

And this may be of interest: http://jsbin.com/ewire5/4

My guess is that the old engine used `getAttribute('src')` and/or
`readAttribute('src')`, but the new engine uses `src` directly. The
old behavior is probably more correct; the new behavior may be more
useful though... ;-)

-- T.J.

On Mar 10, 3:00 pm, T.J. Crowder t...@crowdersoftware.com wrote:
 Hi,

 My suspicion is if you change your selector to use $= rather than =
 (e.g., 'img[src$=images/icons16/btn_add.gif]'), it'll start working
 again. The $= operator looks for an attribute _ending_ in the given
 string rather than _equalling_ it.[1]

 I haven't looked into it, but my guess offhand is that the selector
 engine in 1.7 is matching against the image's fully-resolved URL,
 whereas 1.6's old engine was using the relative URL in the attribute.

 FWIW, it's easily replicated:
 Using 1.6.1 and =, works:http://jsbin.com/ewire5/
 Using 1.7 and =, doesn't work:http://jsbin.com/ewire5/2
 Using 1.7 and $=, works:http://jsbin.com/ewire5/2

 [1]http://www.w3.org/TR/css3-selectors/#attribute-substrings

 HTH,
 --
 T.J. Crowder
 Independent Software Engineer
 tj / crowder software / com
 www / crowder software / com

 On Mar 10, 2:35 pm, Incero helgeonthe...@googlemail.com wrote:







  Hi,
  I'm using the following statement in Prototype 1.6.1 to hide an image:
  $('MyContainerId').select('img[src=images/icons16/
  btn_add.gif]').invoke('hide');
  but after updating to 1.7 the select statement returns [] instead if
  the image object.
  Is this a problem of 1.7 or have I used the select function in a wrong
  way?

  I've tested this code in IE8 and Firefox 3.6. The html looks like
  this:
  img border=0 align=absmiddle title=Remove src=images/icons16/
  btn_add.gif

  Thanks
  Incero

-- 
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] Ajax upload

2011-03-10 Thread Walter Lee Davis


On Mar 10, 2011, at 9:00 AM, Keith wrote:


I am new to prototype JS library feature.

I want to implement ajax upload feature in my web application. For
that,

1) I wrote a servlet which copies the file to a particular folder in
server.
2) HTML form, I have a upload control and a Button which fires an ajax
request. Below is the code on the button

new Ajax.Request('http://isgdev.synygy.net/servlet/
CommonsFileUploadServlet',
{
   method: post,
 onSuccess: function(transport){
 var response = transport.responseText || no response text;
 alert(Check-! \n\n + response);
   },
   onFailure: function(){ alert('Something went wrong...') }
 });

When I click the button, the servlet is called but the selected file
is not copied to server.

But, When I submit the form, through regular post method (without
using ajax). The servlet works properly and the file is copied to
server properly.

Can you please guide me on this.


Sure. With the exception of bleeding-edge browsers (WebKit nightlies,  
mostly), JavaScript is prevented from sending files over  
XMLHTTPRequest for security reasons. Most Ajax file uploads fake  
their way around this by using hidden iframe elements as the actual  
form target, and a callback from within that iframe to the parent page  
to handle the response from the server.


Walter



--
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-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: Effect.blindUp Disappears at End

2011-03-10 Thread Hook
No one ...

--
Jonathan

On Mar 8, 9:55 am, Jonathan Rosenberg j...@tabbysplace.org wrote:
 I am using Effect.blindUp like so:

            Effect.BlindUp('linda', {duration: 4, scaleTo: 50,
 scaleContent: false, scaleMode: 'box' });

 I was hoping the div would be visible at 50% when done, but it
 disappears.  How can I get it to just stop at the 50% point?

 --
 Jonathan Rosenberg
 Founder  Executive Director
 Tabby's Place, a Cat Sanctuaryhttp://www.tabbysplace.org/

-- 
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] Re: Effect.blindUp Disappears at End

2011-03-10 Thread Walter Lee Davis
The final step in any of the hiding Effects is to use Prototype  
hide() on the event, removing it from view with display:none. You  
might want to try Effect.Morph instead.


Walter

On Mar 10, 2011, at 11:04 AM, Hook wrote:


No one ...

--
Jonathan

On Mar 8, 9:55 am, Jonathan Rosenberg j...@tabbysplace.org wrote:

I am using Effect.blindUp like so:

   Effect.BlindUp('linda', {duration: 4, scaleTo: 50,
scaleContent: false, scaleMode: 'box' });

I was hoping the div would be visible at 50% when done, but it
disappears.  How can I get it to just stop at the 50% point?

--
Jonathan Rosenberg
Founder  Executive Director
Tabby's Place, a Cat Sanctuaryhttp://www.tabbysplace.org/


--
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-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: event on leaving page

2011-03-10 Thread joe t.
One note on TJ's post, hopefully helpful:

You cannot CANCEL the unload event. If i understand them correctly,
load and unload are the only native events that can't be canceled from
scripts. You can perform other actions, but unload means the browser
has been committed to unloading that page, regardless what else it's
told to do at that point. The point of no return to let the user
cancel the unload is beforeunload (handy, and a Microsoft creation,
ironically).

And to his point, he's correct: about the only other actions you can
take are cleanup/garbage collection. Not that it would matter anyway
if you create new content, the page is going bye-bye. :)

That all comes from a painful two weeks a few years ago before i knew
about beforeunload. Still bitter at myself over that.
-joe t.


On Mar 10, 9:31 am, Walter Lee Davis wa...@wdstudio.com wrote:
 On Mar 10, 2011, at 2:25 AM, T.J. Crowder wrote:

  What you can do in those functions is severely limited by modern
  browsers (for all the good reasons you can think of). You can't open
  new windows, do alerts/confirms

 Thanks. This is the part I was remembering -- someone wanted an Are  
 You Sure to interrupt closing the window on a running process, and I  
 mistook the answer to mean that onunload couldn't do much of anything,  
 versus 'couldn't do much of anything to the current window'. That  
 makes perfect sense now.

 Walter

-- 
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] Re: Effect.blindUp Disappears at End

2011-03-10 Thread Jonathan Rosenberg
Thanks for the explanation.

__
JR
 On Mar 10, 2011 12:52 PM, Walter Lee Davis wa...@wdstudio.com wrote:
 The final step in any of the hiding Effects is to use Prototype
 hide() on the event, removing it from view with display:none. You
 might want to try Effect.Morph instead.

 Walter

 On Mar 10, 2011, at 11:04 AM, Hook wrote:

 No one ...

 --
 Jonathan

 On Mar 8, 9:55 am, Jonathan Rosenberg j...@tabbysplace.org wrote:
 I am using Effect.blindUp like so:

 Effect.BlindUp('linda', {duration: 4, scaleTo: 50,
 scaleContent: false, scaleMode: 'box' });

 I was hoping the div would be visible at 50% when done, but it
 disappears. How can I get it to just stop at the 50% point?

 --
 Jonathan Rosenberg
 Founder  Executive Director
 Tabby's Place, a Cat Sanctuaryhttp://www.tabbysplace.org/

 --
 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-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-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.