[Proto-Scripty] Re: Observer problem

2009-12-15 Thread david
Hi rui,

Your problem could be resolved using event delegation, you set the
event on the body of you document.
Whne the observed event is fired, you can know on which element it is
applied. If the element is the element you *really*  want to observe,
just launch your code that handle that event.

In that case, element could be removed (no more event could be fired)
and can be re-inserted. In that last case, the element have changed,
but for the event delegation, the only important thing is that the
element.id exist, and the event is well fired without anything to do.

--
david

On 14 déc, 01:15, Rui Campos ruirccam...@gmail.com wrote:
 Thanks for the reply, it solved my problem  :)

 I moved the input box away from the part that I want to update and it
 worked.

 Thanks again,
 Rui Campos.

 On Dec 13, 10:03 pm, T.J. Crowder t...@crowdersoftware.com wrote:

  Hi,

  If you're replacing the element you're observing, that's your problem
  -- events are observed on instances. Even if you replace an element
  with the ID X with another element with the ID X, they're
  different elements.

  From your description, it sounds like you're replacing more than you
  really should be, but it's hard to tell without code. If it's not that
  you're replacing the element you're observing, I'd suggest replicating
  the problem in a small, self-contained example[1].

  [1]http://proto-scripty.wikidot.com/self-contained-test-page

  HTH,
  --
  T.J. Crowder
  Independent Software Consultant
  tj / crowder software / comwww.crowdersoftware.com

  On Dec 13, 5:27 pm, Rui Campos ruirccam...@gmail.com wrote:

   Hello,

   I'm currently doing a college project on ruby on rails and I have to
   do a common Tag system for wiki pages. I have an observer observing
   a input field to check if a tag that the user is trying to add already
   has a similar one on the system, if there is one, a text box appears
   asking if the user wants to replace the tag introduced by the already
   in the system. The tag adding is made with ajax.

   The problem is that after the user adds a tag, meaning he clicks the
   add button and the ajax call refreshes the tag box, the observer stops
   working and i have to refresh the page. I'm not sure if this is a bug
   with my code or if it is intended. If it is intended, is there a work
   around?

   If there is already a discussion about a similar issue, I was unable
   to find it. Please direct me to it if possible : )

   Thanks,
   Rui Campos.

--

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.




[Proto-Scripty] callback decoration

2009-12-15 Thread Sergio Fernández
In a experiment, I'm trying to decorate the callbacks, but I didn't
find the way to make the bind...

What I'd like to do is to firstly get the control over response's
callback, do some common stuff, and then invoke the callback set by
the user.

Anyone has any idea how can I do something like that?

Thanks in advance.

Best

--

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.




[Proto-Scripty] Re: Prototype conflict solution

2009-12-15 Thread anatoly techtonik
+1 on Prototype.noconflict

I wonder if there was .noconflict option - would it be possible to use
two prototype versions on the same page? (need for old legacy code in
new layout)


On Nov 30, 2:01 pm, Rafal Zarajczyk rzarajc...@gmail.com wrote:
 As far as I know there is no such thing in prototype, but definitely
 it would be usefull sometimes! When I need a single method from
 Prototype in a jQuery-driven site (let's say I want to use unescapeHTML
 ()) I just copy-paste implementation... which is sometimes easy,
 sometimes hard.

 I'm looking forward to this feature!

 Rafał Zarajczyk

 Ps. The solution switch everything do Prototype is not always
 possible :-P

 On 24 Lis, 14:58, markojakic jakicmeis...@gmail.com wrote:



  I am working on some site, which has jquery support, but I added
  Prototype (autocomplete component with xml loading) and it's not
  working when JQuery is loaded.
  I know that JQuery has that support with JQuery.noconflictbut it's
  hard to change ALL the .js files and ALL the $ functions.
  So, does Prototype have such support? I'd only need to change a little
  one .js file which handles with autocompleter.

  Regards

--

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.




[Proto-Scripty] Re: callback decoration

2009-12-15 Thread Sergio Fernández
Using Ajax.Request(), I forgot to say it, sorry.

On Dec 15, 3:45 pm, Sergio Fernández wik...@wikier.org wrote:
 In a experiment, I'm trying to decorate the callbacks, but I didn't
 find the way to make the bind...

 What I'd like to do is to firstly get the control over response's
 callback, do some common stuff, and then invoke the callback set by
 the user.

 Anyone has any idea how can I do something like that?

 Thanks in advance.

 Best

--

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.




[Proto-Scripty] Using cropping on images and affects

2009-12-15 Thread Topsoft Design Studio
I want to cause a few images of text to slide around within a colored box
div region. When these images slide across the bounding box I want them to
crop to that back to give the affect they are contained inside the region.

 

Does anyone know a good way to set that up so I can use New
Affect.Move('image'.) and it will auto-crop?

 

Ralph Brickley
Owner

 

logo-small
435 NE Evans St Ste 115 
P.O. Box 510  McMinnville, OR 97128

(503) 583-1830 Cell  |  (503) 472-7914 Office  |  (800) 986-0276 Fax

 http://www.topsoftweb.com/ www.topsoftdesignstudio.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.


image001.png

RE: [Proto-Scripty] Using cropping on images and affects

2009-12-15 Thread Topsoft Design Studio
On example I can give of what I mean is found here on the home page of this
site:

http://www.carlsonveit.com/

 

Ralph Brickley
Owner

 

logo-small
435 NE Evans St Ste 115 
P.O. Box 510  McMinnville, OR 97128

(503) 583-1830 Cell  |  (503) 472-7914 Office  |  (800) 986-0276 Fax

 http://www.topsoftweb.com/ www.topsoftdesignstudio.com

From: Topsoft Design Studio [mailto:i...@topsoftweb.com] 
Sent: Tuesday, December 15, 2009 11:44 AM
To: prototype-scriptaculous@googlegroups.com
Subject: [Proto-Scripty] Using cropping on images and affects

 

I want to cause a few images of text to slide around within a colored box
div region. When these images slide across the bounding box I want them to
crop to that back to give the affect they are contained inside the region.

 

Does anyone know a good way to set that up so I can use New
Affect.Move('image'.) and it will auto-crop?

 

Ralph Brickley
Owner

 

logo-small
435 NE Evans St Ste 115 
P.O. Box 510  McMinnville, OR 97128

(503) 583-1830 Cell  |  (503) 472-7914 Office  |  (800) 986-0276 Fax

 http://www.topsoftweb.com/ www.topsoftdesignstudio.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.


image001.png

[Proto-Scripty] Issues selecting checkboxes in FF

2009-12-15 Thread smartcookie
Hey there:

Does anyone know a good way to programmably select or click on a
checkbox input in FF?

I have tried :
el.down('input').checked = 'checked';

and
el.down('input').onclick();

In the first code, I can see the checkboxes being checked, but when I
submit, my error validation alerts that nothing is selected...

Does anyone know another method..

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.




RE: [Proto-Scripty] Issues selecting checkboxes in FF

2009-12-15 Thread Topsoft Design Studio
You need to also set a value for the checkbox also.

el.down('input').checked = 'checked';
el.down('input').value = '1';






-Original Message-
From: smartcookie [mailto:dpell.h...@gmail.com] 
Sent: Tuesday, December 15, 2009 12:18 PM
To: Prototype  script.aculo.us
Subject: [Proto-Scripty] Issues selecting checkboxes in FF

Hey there:

Does anyone know a good way to programmably select or click on a
checkbox input in FF?

I have tried :
el.down('input').checked = 'checked';

and
el.down('input').onclick();

In the first code, I can see the checkboxes being checked, but when I
submit, my error validation alerts that nothing is selected...

Does anyone know another method..

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] Issues selecting checkboxes in FF

2009-12-15 Thread Rick . Wellman
Um,... I am pretty sure if you see that a checkbox is checked then it is
checked.  You gotta suspect your validation code ('cause it sounds like
your validation code is checking a group of checkboxes to make sure that
at least one is checked).

-Original Message-
From: prototype-scriptaculous@googlegroups.com
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of
smartcookie
Sent: Tuesday, December 15, 2009 2:18 PM
To: Prototype  script.aculo.us
Subject: [Proto-Scripty] Issues selecting checkboxes in FF

Hey there:

Does anyone know a good way to programmably select or click on a
checkbox input in FF?

I have tried :
el.down('input').checked = 'checked';

and
el.down('input').onclick();

In the first code, I can see the checkboxes being checked, but when I
submit, my error validation alerts that nothing is selected...

Does anyone know another method..

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.




[Proto-Scripty] Firefox's inline JS execution order

2009-12-15 Thread JoJo
I'm creating a widget where I tell people to copy and paste this code
onto their site:

   script type=text/javscript src=http://www.site.com/script.js;/
script
   div class=widget/div

Script.js looks for all the widget divs on the page by using $$ and
dynamically fills them up.  Now, I'm not catering to nerd programmers
who know that it's better to do this when they need to embed multiple
widgets:

   head
  script
   /head
   body
  div class=widget/div
  div class=widget/div
  div class=widget/div
   /body

Instead, I'm expecting stupid people to be doing this:

   body
  script
  div class=widget/div
  script
  div class=widget/div
  script
  div class=widget/div
   /body

So I've tried to only execute my script once using:

   if (typeof(RAN_ONCE) === 'undefined') {
  RAN_ONCE = true;
  // minified Prototype code here
  // minified my widget code here
   }

This code works well in IE, but not in FF. FF always reports an error
saying $A is undefined. I'm guessing that FF actually ran my code in
parellel and thus Prototype got redefined and screwed up?  Does anyone
know how execution order is different in IE and FF with inline JS?

--

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.




[Proto-Scripty] Re: Prototype conflict solution

2009-12-15 Thread Tobie Langel
 I wonder if there was .noconflict option - would it be possible to use
 two prototype versions on the same page? (need for old legacy code in
 new layout)

Unfortunately not, because of native object extensions.

--

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.




[Proto-Scripty] Re: Issues selecting checkboxes in FF

2009-12-15 Thread Al C
I've got an AJAX page which dynamically refreshes... this is what I
use... seems to work well enough for our purposes...
(NB - I'm using prototype for most of my stuff)

var fin = document.forms[name of form];  // replace name of form
with the id of your form
var SetCheckBox = function ( w, s0 ){
// 'w' is the id of the checkbox;
// 's0' is the state - i.e., 1==checked; 0==not checked
fin[ w ].checked = s0;
}

SetCheckBox( 'item_notchecked', 0 );
SetCheckBox( 'item_checked', 1 );

Hope this helps,

Al

On Dec 15, 3:18 pm, smartcookie dpell.h...@gmail.com wrote:
 Hey there:

 Does anyone know a good way to programmably select or click on a
 checkbox input in FF?

 I have tried :
 el.down('input').checked = 'checked';

 and
 el.down('input').onclick();

 In the first code, I can see the checkboxes being checked, but when I
 submit, my error validation alerts that nothing is selected...

 Does anyone know another method..

 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.




Re: [Proto-Scripty] Issues selecting checkboxes in FF

2009-12-15 Thread Alex McAuley
iirc
$(element).checked==true;


Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Rick.Wellman rick.well...@kiewit.com
To: prototype-scriptaculous@googlegroups.com
Sent: Tuesday, December 15, 2009 8:26 PM
Subject: RE: [Proto-Scripty] Issues selecting checkboxes in FF


 Um,... I am pretty sure if you see that a checkbox is checked then it is
 checked.  You gotta suspect your validation code ('cause it sounds like
 your validation code is checking a group of checkboxes to make sure that
 at least one is checked).

 -Original Message-
 From: prototype-scriptaculous@googlegroups.com
 [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of
 smartcookie
 Sent: Tuesday, December 15, 2009 2:18 PM
 To: Prototype  script.aculo.us
 Subject: [Proto-Scripty] Issues selecting checkboxes in FF

 Hey there:

 Does anyone know a good way to programmably select or click on a
 checkbox input in FF?

 I have tried :
 el.down('input').checked = 'checked';

 and
 el.down('input').onclick();

 In the first code, I can see the checkboxes being checked, but when I
 submit, my error validation alerts that nothing is selected...

 Does anyone know another method..

 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.


 

--

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.