Re: [Proto-Scripty] Event.on bound to element only

2011-12-20 Thread Guillaume Lepicard
Hi Karl

You should have a look to Element.observe
With this method you can bind the listener to the object you want

The main difference is that you don't have the selector. Nevertheless,
thanks to $$ and invoke, you should get what you want

Guillaume
Le 21 déc. 2011 08:39, kstubs kst...@gmail.com a écrit :

 Api reads:

 callback (Function http://api.prototypejs.org/language/Function/) – The
 event handler function. Should expect two arguments: the event object *and
 * the element that received the event. (If selector was given, this
 element will be the one that satisfies the criteria described just above;
 if not, it will be the one specified in the element argument). This
 function is *always* bound to element.

 So this means there is no way to bind to a class, to *this* class?  Most
 of the time it makes sense that the event listener is bound to the class
 and not the element.  Are there any possibilities of allowing you to pass
 context to the on function?

 Karl..

 --
 You received this message because you are subscribed to the Google Groups
 Prototype  script.aculo.us group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/prototype-scriptaculous/-/DawaWjvEe6gJ.
 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.



Re: [Proto-Scripty] prototype 1.7 : using 'invoke' method with a Hash

2011-03-11 Thread Guillaume Lepicard
Hi François

You should use
h.values().invoke(draw);
As specified in the Has#each method, the iterator's first argument is an
object with two properties : key and value
http://api.prototypejs.org/language/Hash/prototype/each/

On Thu, Mar 10, 2011 at 8:17 PM, Francois francois.schnei...@gmail.comwrote:

 Hi!
 I had problems using the 'invoke' method with an Hash :
 the Enumerable API says about 'invoke' : Invokes the same method,
 with the same arguments, for all items in a collection. Returns the
 results of the method calls.
 so I expected the following code to work :

 function A() {};
 A.prototype.draw = function()  {
console.log('A.draw');
 };
 var h = new Hash({ a: new A});
 console.log('h.size = ', h.size());
 h.invoke('draw');

 but the last call to invoke throws an exception.
 What is wrong with my code? any suggestion ?
 Thanks in advance!


 ps: I did this to work around the problem :
 h.each( function(e) { e[1].draw(); } );

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



Re: [Proto-Scripty] Ajax.Updater only works in IE

2011-03-09 Thread Guillaume Lepicard
Hi,

I believe this is because you only gave a name to the select event. $F()
is expecting an ID or an element as a parameter.
Try putting an id=event to the select.

Guillaume


On Wed, Mar 9, 2011 at 9:53 AM, Webhopper webhop...@gmail.com wrote:

 I create a small form-site for booking events.
 After select an event, Ajax.Updater should update the ammount-field.
 Site : http://www.lab.krueger-de.org/sam/default_ie.asp

 IE works correct, but Firefox, Chrome and ... dosn't update the second
 select.

 Is here a bug in my source or a crossbrowser problem from prototype ?

 (i have fix it temorary with json. see :
 http://www.lab.krueger-de.org/sam/default.asp)

 --
 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] Handling form and input events with Event.Handler

2011-03-01 Thread Guillaume Lepicard
Hi all,

After some tests, I found that on IE, forms and inputs specific events
(change, submit, focus...) can not be handled with the on method nore with
Event.Handler using a parent object :

$(some_div_id).on(change, input, doSomething);

works fine on Firefox and webkit browsers but not on IE(8) : doSomething is
not called.

Am I missing something ? Is there a way to get it work ?

Thanks
Guillaume

-- 
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] Effect.toggle is by default queue limited

2010-11-25 Thread Guillaume Lepicard
Hi all,

I've noticed that if I wanted to use Effect.toggle on multiple elements, I
had to specify a queue parameter to override the default scriptaculous
behaviour on Effect.toggle (the limit default value is set to 1 for the
queue). I was wondering why this limit had been set, if the code coming next
was a good walkthrough, or if a better solution existed.

$$(.someClass).each( function(elem) {
  Effect.toggle(elem, blind, {queue:{scope:global}});
});

Any way, I can imagine that you guys have many things to do, but I think
that this information (default queue limit) should be documented.

BR

Guillaume

-- 
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] scriptaculous causes body background to fail on safari and chrome

2010-08-17 Thread Guillaume Lepicard
Hi all,

i have a very simple document:
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
head
titleBG fail/title
style type=text/css
body {
background-color: #00;
color:#ff;
}
/style
script type=text/javascript src=lib/prototype.js/script
script type=text/javascript src=lib/scriptaculous.js/script
/head
body
h1Hello/h1
/body
/html

On chrome and safari, the black background stops right after the h1 hello.
On safari, if i ask for the page source code, right after the code window
appeared, the background gets back to normal.

If i remove scriptaculous inclusion, no more problem.
If i move the style declaration after the script tags, no more problem (it
took really long to figure out what went wrong...).

Am i missing something? is it recommended to move the style declarations (or
imports i tested with external css) after scripts? is it a safari and chrome
(webkit?) bug?

Thanks
Guillaume

-- 
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] Prototype Class, Event Listeners and Referencing Self

2010-07-21 Thread Guillaume Lepicard
Hi, you need to bind the listener function to your object:
 
$('box').addEventListener(click,this.takeAction.bindAsEventListener(this),false);

more details:
http://api.prototypejs.org/language/function/prototype/bindaseventlistener/

On Tue, Jul 20, 2010 at 7:13 PM, Doc Torbin mtor...@gmail.com wrote:

 I have the following snippet of code which illustrates a problem that
 I'm having.  I have an event listener within a class that I'd like to
 have be self aware.  I'd like it to be able to call another function
 within the Class but I haven't found the right method to have it do
 so.  Please advise:

 !DOCTYPE html
 html
head
script type=text/javascript
 src=../prototype.js/script
style type=text/css
#box{position:fixed;width:100px;border:3px solid
 #000;background-
 color:#00ff00;font-size:14pt;font-weight:bold;text-
 align:center;padding:50px 25px;cursor:pointer;}
/style
script type=text/javascript
var MyOBJ = new Class.create();
MyOBJ.prototype = {
initialize: function(){
try{

  $('box').addEventListener(click,this.takeAction,false);
}
catch(error){alert(error);}
},
takeAction: function(event){
alert(I got to this function
 without issue.);
this.anotherAction();
},
anotherAction: function(){
alert(I won't get here.);
}
}

document.observe(dom:loaded, function(){
var spriteOBJ = new MyOBJ();
});
/script
/head
body
div id=boxBOX/div
/body
 /html

 --
 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.comprototype-scriptaculous%2bunsubscr...@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: Prototype Class, Event Listeners and Referencing Self

2010-07-21 Thread Guillaume Lepicard
Hi TJ,
Thanks for pointing this !
When I first read the API doc (in the old format), explanations were not
that clear or i misunderstoos them ; but then looking in the new API doc,
it's much more clear ; and thanks for the
proto-scripty.wikidot.comhttp://proto-scripty.wikidot.com/prototype:tip-you-probably-don-t-need-bindaseventlistener
i
wasn't aware of !


On Wed, Jul 21, 2010 at 12:05 PM, T.J. Crowder t...@crowdersoftware.comwrote:

 Hi Guillaume,

 Just #bind is sufficient. You almost never need #bindAsEventListener:

 http://proto-scripty.wikidot.com/prototype:tip-you-probably-don-t-need-bindaseventlistener

 -- T.J. :-)

 On Jul 21, 10:18 am, Guillaume Lepicard guillaume.lepic...@gmail.com
 wrote:
  Hi, you need to bind the listener function to your object:
 
  $('box').addEventListener(click,this.takeAction.bindAsEventListener(this)
 ,false);
 
  more details:
 http://api.prototypejs.org/language/function/prototype/bindaseventlis...
 
 
 
  On Tue, Jul 20, 2010 at 7:13 PM, Doc Torbin mtor...@gmail.com wrote:
   I have the following snippet of code which illustrates a problem that
   I'm having.  I have an event listener within a class that I'd like to
   have be self aware.  I'd like it to be able to call another function
   within the Class but I haven't found the right method to have it do
   so.  Please advise:
 
   !DOCTYPE html
   html
  head
  script type=text/javascript
   src=../prototype.js/script
  style type=text/css
  #box{position:fixed;width:100px;border:3px solid
   #000;background-
   color:#00ff00;font-size:14pt;font-weight:bold;text-
   align:center;padding:50px 25px;cursor:pointer;}
  /style
  script type=text/javascript
  var MyOBJ = new Class.create();
  MyOBJ.prototype = {
  initialize: function(){
  try{
 
$('box').addEventListener(click,this.takeAction,false);
  }
  catch(error){alert(error);}
  },
  takeAction: function(event){
  alert(I got to this function
   without issue.);
  this.anotherAction();
  },
  anotherAction: function(){
  alert(I won't get here.);
  }
  }
 
  document.observe(dom:loaded, function(){
  var spriteOBJ = new MyOBJ();
  });
  /script
  /head
  body
  div id=boxBOX/div
  /body
   /html
 
   --
   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.comprototype-scriptaculous%2bunsubscr...@googlegroups.comprototype-scriptaculou
 s%2bunsubscr...@googlegroups.com s%252bunsubscr...@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.comprototype-scriptaculous%2bunsubscr...@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] BlindDown issue, won't work

2010-07-19 Thread Guillaume Lepicard
hi Silvershaft,

You're on the wrong list : you're obviously using jQuery...

On Mon, Jul 19, 2010 at 3:06 PM, Silvershaft
samppalehtonenle...@gmail.comwrote:

 Hey I got a little problem with my div what should appear if the login
 fails, the alert will show up meaning that the function works, but the
 blinddown doesn't work. Code for checkLogin function

 function checkLogin()
 {
var username = $('#name').attr('value');
var password = $('#password').attr('value');
alert(username);


 $.ajax({
  type: POST,
  url: check.php,
  data: username= + username + password= + password,

  success: function(data) {
alert('works!');
Effect.BlindDown('error');
  },

  error: function() {
alert('failure');
  }
 });

 Code for my DIV
   div id=error style=width:25%; height:40px; margin-left:38%;
 margin-top:1%; margin-right:auto; font-size:140%; background:#F33;
height:30px;
font-weight:bold;
color:#000;
background-color:#F30;
display:none;
Incorrect login!
 /div

 And finally the code for the button
pnbsp;
a href=# onclick=checkLogin()
 onmouseover=test(this)
img src=images/login2.png name=submitbtn border=0
 alt=Submit id=img1 style=width:25%; height:31px;  //a/p

 I can't seem to understand why it doesn't work, I think it's just a
 small problem but I don't get it.. Thanks in advance!

 --
 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.comprototype-scriptaculous%2bunsubscr...@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: BlindDown issue, won't work

2010-07-19 Thread Guillaume Lepicard
You must have conflicts using jQuery and prototype (used through
scriptaculous). have a look to the noconflict options of jquery
http://docs.jquery.com/Using_jQuery_with_Other_Libraries

On Mon, Jul 19, 2010 at 3:26 PM, Silvershaft
samppalehtonenle...@gmail.comwrote:

 Yes but I got the problem with the effect thing, why won't the
 BlindDown work, I even tried to make another function and called it
 from onClick but nothing.,. I thought scriptaculous issues come
 here :P

 On 19 heinä, 16:24, Guillaume Lepicard guillaume.lepic...@gmail.com
 wrote:
  hi Silvershaft,
 
  You're on the wrong list : you're obviously using jQuery...
 
  On Mon, Jul 19, 2010 at 3:06 PM, Silvershaft
  samppalehtonenle...@gmail.comwrote:
 
   Hey I got a little problem with my div what should appear if the login
   fails, the alert will show up meaning that the function works, but the
   blinddown doesn't work. Code for checkLogin function
 
   function checkLogin()
   {
  var username = $('#name').attr('value');
  var password = $('#password').attr('value');
  alert(username);
 
   $.ajax({
type: POST,
url: check.php,
data: username= + username + password= + password,
 
success: function(data) {
  alert('works!');
  Effect.BlindDown('error');
},
 
error: function() {
  alert('failure');
}
   });
 
   Code for my DIV
 div id=error style=width:25%; height:40px; margin-left:38%;
   margin-top:1%; margin-right:auto; font-size:140%; background:#F33;
  height:30px;
  font-weight:bold;
  color:#000;
  background-color:#F30;
  display:none;
  Incorrect login!
   /div
 
   And finally the code for the button
  pnbsp;
  a href=# onclick=checkLogin()
   onmouseover=test(this)
  img src=images/login2.png name=submitbtn border=0
   alt=Submit id=img1 style=width:25%; height:31px;  //a/p
 
   I can't seem to understand why it doesn't work, I think it's just a
   small problem but I don't get it.. Thanks in advance!
 
   --
   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.comprototype-scriptaculous%2bunsubscr...@googlegroups.com
 prototype-scriptaculous%2bunsubscr...@googlegroups.comprototype-scriptaculous%252bunsubscr...@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.comprototype-scriptaculous%2bunsubscr...@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: hash serialization problems

2010-05-06 Thread Guillaume Lepicard
hi,
The way an hash is serialized in json is the correct way i think, what you
want is more an array than an hash...

So you could either use an array

var a = $A();
a.push({name00: value00});
a.push({name01: value01});
and then serialize this array :
Object.toJSON(a);

or if it is too much work, you could serialize your hash this way

var h = $H();
h.set(name00, value00);
h.set(name01, value01);
Object.toJSON( h.inject([], function(acc, hashEntry) {
  var tmp = {};
  tmp[hashEntry.key] = hashEntry.value;
  acc.push(tmp);
  return acc;
}));

if you need this functionality at several places, you can add a method to
Hash to serialize the way you want :
Hash.addMethods( {
  myExpectedFormat : function() {
return this.inject([], function(acc, hashEntry) {
  var tmp = {};
  tmp[hashEntry.key] = hashEntry.value;
  acc.push(tmp);
  return acc;
   });
  }
} );
and then everywhere :
Object.toJSON( h.myExpectedFormat() );

On Thu, May 6, 2010 at 4:33 PM, chrysanthe m chrysant...@gmail.com wrote:

 Hi
 Can anyone help me understand this?  I can recreate a properly formatted
 JSONArray server-side, but I really want to know why Object.toJSON() didnt
 format it client-side correctly.

 On Thu, Apr 29, 2010 at 4:36 PM, chrysanthe m chrysant...@gmail.comwrote:

 Hi
 I have created a hash, added to it with set but when try
 Object.toJSON(myHash) it produces one large JSONObject and not the proper
 JSONArray format.  I would expect [{name00:value00},{name01:value01}...]
 What I get is {name00:value00,name01:value00...}.  How do/can I get what I
 expect?  tia.


  --
 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.comprototype-scriptaculous%2bunsubscr...@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] Issue with droppable and an element that has more than one class name

2010-04-28 Thread Guillaume Lepicard
hi,

as far as i can remember, the accept option has to be in a selector syntax:
try
new Draggable ('draggable', {revert: 'failure', accept: '.dropme'});
or
Droppables.add(audience-element-0, {accept: '.Social', onDrop:
this.dropElement});
On Tue, Apr 27, 2010 at 10:47 PM, Jangla jangla.m...@gmail.com wrote:

 If I have this code:

 div id=draggable class=dodrop dropmedrag me/div
 div id=droppabledrop here/div

 script
 new Draggable ('draggable', {revert: 'failure', accept: 'dropme'});
 Droppables.add ('droppable');
 /script

 I would expect the dropped element to be accpeted by the droppable but
 it's not for some reason. Can anyone help me out on this? I have some
 rather more complex code that results in a div element with the class
 names audience-element and  Social like so:

 div id=audience-element-0 class=audience-element Social
 style=top: 0pt; left: 0pt; z-index: 0;

 As far as I can tell, if I define my droppable like so:

 Droppables.add(audience-element-0, {accept: 'Social', onDrop:
 this.dropElement});

 ... then this should successfully drop onto the target element and
 stay therebut it doesn't :(

 Help!!! :)

 --
 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.comprototype-scriptaculous%2bunsubscr...@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] Adding new objects from old objects

2010-04-28 Thread Guillaume Lepicard
hi,

when you observe
Event.observe('button-' + this.id, 'click', this.add);
a new anonymous add fucntion is created.
To be sure it will be binded to this,
Event.observe('button-' + this.id, 'click',
this.add.bindAsEventListener(this));


On Wed, Apr 28, 2010 at 1:53 PM, Jangla jangla.m...@gmail.com wrote:

 Here's some castly cimplified code of what I'm trying to do:

 var myClass = Class.create({
  initialize : function() {
this.id = 0;
this.type = 'Undefined';
this.assignedAudienceTypes = [];
this.title = 'Untitled';
this.add();
return this;
  },
  add : function(renderTo) {
this.setId();
var containerDiv = document.createElement('div');
containerDiv.writeAttribute('class', 'element-container');
renderTo.appendChild(containerDiv);
containerDiv.writeAttribute('id', 'element-container-' + this.id);

var buttonDiv = document.createElement('div');
buttonDiv.writeAttribute('class', 'button-container');
renderTo.appendChild(buttonDiv);
buttonDiv.writeAttribute('id', 'button-' + this.id);

Event.observe('button-' + this.id, 'click', this.add);
  },
  setId : function(){
if ( $$('.element-container').length ) {
  this.id = $$('.element-container').length - 1;
}
  }
 });

 The basic idea is that I'm creating some html elements on the page
 which contain a button which will add another new one to the page.

 My code above is clearly wrong (I'm just setting out with full on
 prototype coding) but I'm struggling to understand how to correct it.
 For a start, while the setId function works first time round, second
 time around this doesn't refer to the object but to the button
 element that was clicked.

 Any pointers greatly appreciated :)

 --
 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.comprototype-scriptaculous%2bunsubscr...@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] script.aculo.us autocomplete on dynamically added form field?

2010-04-08 Thread Guillaume Lepicard
Hi,
You should use full dom creation for your new inputs instead of innerHTML,
and use prototype for manipulating Events and DOM


On Thu, Apr 8, 2010 at 2:04 AM, Albanach alban...@gmail.com wrote:

 Hi,

 I have a form where I dynamically add extra fields.

 Here's my example code:

 http://pastie.org/908497

 While I can use autocomplete on my first input field, I am unable to
 get it to work on any fields that I add after the page loads.

 Don't suppose anyone can offer any suggestions as to how I might
 achieve this?

 Thanks,

 Russell.

 --
 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.comprototype-scriptaculous%2bunsubscr...@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: Queues Effects

2010-04-07 Thread Guillaume Lepicard
Hi

How are you calling and defining the start function ? directly in your HTML
page or through an Ajax Request ? if it is defined through an ajax request,
you must use the syntax :
var start = function() {
...
};

is there some place where we can view the page ?

And I've seen a missing dot again
 Enumerable.invoke.curry(appear).bind($$('*.*solution'))

On Wed, Apr 7, 2010 at 10:06 AM, C_B i...@christian-baesler.de wrote:

 Thanks for your solution! Unfortunately, i am not able to get this
 work.
 Firefox Debug says: start is not defined - line 1. However, i have
 alredy checked all ;, ) and } but I am not able to troubleshoot.

 Here is my function:

   function start(area, choice) {
var effects = [];
$$(.solution).each( function(item) {
  effects.push( new Effect.Fade(item, {sync: true}));
});

new Effect.Parallel(effects, afterFinish:  function() {
  search(area, choice, Enumerable.invoke.curry(appear).bind($
 $('solution')));
});
}

 Any evidence?

 --
 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.comprototype-scriptaculous%2bunsubscr...@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: Queues Effects

2010-04-07 Thread Guillaume Lepicard
Yes it is !

new Effect.Parallel(effects,* {*
afterFinish:  function() {
search(area, choice,
Enumerable.invoke.curry(appear).bind($$('solution')));
}
*}* );

On Wed, Apr 7, 2010 at 11:54 AM, C_B i...@christian-baesler.de wrote:


 Unfortunately I am actually not able to get the site online.

 I call the function like this:
 div onclick=javascript:start('age', 6) id=age6
 class=entryComputer/div

 If I run the search() function directly in the onclick-handler it
 works. However, with no fade-  appear-effects.

 Maybe the following is an evidence:
 Sometimes Firefox Debug says, that one ) is missing after argument
 list on position new.Effect.Parallel(effects, afterFinish:**
 function()


 Cheers!



 On 7 Apr., 11:26, Guillaume Lepicard guillaume.lepic...@gmail.com
 wrote:
  Hi
 
  How are you calling and defining the start function ? directly in your
 HTML
  page or through an Ajax Request ? if it is defined through an ajax
 request,
  you must use the syntax :
  var start = function() {
  ...
 
  };
 
  is there some place where we can view the page ?
 
  And I've seen a missing dot again
   Enumerable.invoke.curry(appear).bind($$('*.*solution'))
 
  On Wed, Apr 7, 2010 at 10:06 AM, C_B i...@christian-baesler.de wrote:
   Thanks for your solution! Unfortunately, i am not able to get this
   work.
   Firefox Debug says: start is not defined - line 1. However, i have
   alredy checked all ;, ) and } but I am not able to troubleshoot.
 
   Here is my function:
 
 function start(area, choice) {
  var effects = [];
  $$(.solution).each( function(item) {
effects.push( new Effect.Fade(item, {sync: true}));
  });
 
  new Effect.Parallel(effects, afterFinish:  function() {
search(area, choice, Enumerable.invoke.curry(appear).bind($
   $('solution')));
  });
  }
 
   Any evidence?
 
   --
   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.comprototype-scriptaculous%2bunsubscr...@googlegroups.com
 prototype-scriptaculous%2bunsubscr...@googlegroups.comprototype-scriptaculous%252bunsubscr...@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.comprototype-scriptaculous%2bunsubscr...@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: Queues Effects

2010-04-07 Thread Guillaume Lepicard
you are still missing the . css class prefix .bind($$('.solution'))

On Wed, Apr 7, 2010 at 12:09 PM, C_B i...@christian-baesler.de wrote:

 Incredible! It works! Thanks!!! Fade out and search are sucessfully
 processed.

 There is only one thing left: it does not appear again softly, it
 seems like the effect would not run - the solution is there directly.

 On 7 Apr., 12:02, Guillaume Lepicard guillaume.lepic...@gmail.com
 wrote:
  Yes it is !
 
  new Effect.Parallel(effects,* {*
  afterFinish:  function() {
  search(area, choice,
  Enumerable.invoke.curry(appear).bind($$('solution')));
  }
  *}* );
 
  On Wed, Apr 7, 2010 at 11:54 AM, C_B i...@christian-baesler.de wrote:
 
   Unfortunately I am actually not able to get the site online.
 
   I call the function like this:
   div onclick=javascript:start('age', 6) id=age6
   class=entryComputer/div
 
   If I run the search() function directly in the onclick-handler it
   works. However, with no fade-  appear-effects.
 
   Maybe the following is an evidence:
   Sometimes Firefox Debug says, that one ) is missing after argument
   list on position new.Effect.Parallel(effects, afterFinish:**
   function()
 
   Cheers!
 
   On 7 Apr., 11:26, Guillaume Lepicard guillaume.lepic...@gmail.com
   wrote:
Hi
 
How are you calling and defining the start function ? directly in
 your
   HTML
page or through an Ajax Request ? if it is defined through an ajax
   request,
you must use the syntax :
var start = function() {
...
 
};
 
is there some place where we can view the page ?
 
And I've seen a missing dot again
 Enumerable.invoke.curry(appear).bind($$('*.*solution'))
 
On Wed, Apr 7, 2010 at 10:06 AM, C_B i...@christian-baesler.de
 wrote:
 Thanks for your solution! Unfortunately, i am not able to get this
 work.
 Firefox Debug says: start is not defined - line 1. However, i
 have
 alredy checked all ;, ) and } but I am not able to
 troubleshoot.
 
 Here is my function:
 
   function start(area, choice) {
var effects = [];
$$(.solution).each( function(item) {
  effects.push( new Effect.Fade(item, {sync: true}));
});
 
new Effect.Parallel(effects, afterFinish:  function() {
  search(area, choice,
 Enumerable.invoke.curry(appear).bind($
 $('solution')));
});
}
 
 Any evidence?
 
 --
 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.comprototype-scriptaculous%2bunsubscr...@googlegroups.com
 prototype-scriptaculous%2bunsubscr...@googlegroups.comprototype-scriptaculous%252bunsubscr...@googlegroups.com
 
   prototype-scriptaculous%2bunsubscr...@googlegroups.comprototype-scriptaculous%252bunsubscr...@googlegroups.com
 prototype-scriptaculous%252bunsubscr...@googlegroups.comprototype-scriptaculous%25252bunsubscr...@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.comprototype-scriptaculous%2bunsubscr...@googlegroups.com
 prototype-scriptaculous%2bunsubscr...@googlegroups.comprototype-scriptaculous%252bunsubscr...@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.comprototype-scriptaculous%2bunsubscr...@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] floating div

2010-04-07 Thread Guillaume Lepicard

Hi martin

This is a pure style issue... Try setting your div as positonned  
absolutely with a z-index


Guillaume


Le 7 avr. 2010 à 20:37, Martín Marqués martin.marq...@gmail.com a  
écrit :



OK, I know this isn't strictly prototype, but I'll through it here.

I have a div with id divsubmit which has an animated gif used when
prototype is waiting for a response. So I use $('divsubmit').show() in
onLoading: and $('divsubmit').hide in onComplete.

The thing is that I have this div on the top of the page and everytime
I .show() it, all the objects below it go down to make the div fit. I
want the div to show up on top of the other objects. How do I do this?

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




--
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: Queues Effects

2010-04-06 Thread Guillaume Lepicard
Hi,
I guess that you want to fade all items with class solution (you are missing
the dot class prefix) and on the afterFinish, you want to run a function
that has as third parameter a callback function ? Because the way you had
wrote it meant that your owned function *search* returned a function to be
used after effect finished...

It would have been something like
$$('.solution').invoke('fade',({afterFinish: function() {
  search(area,
choice, Enumerable.invoke.curry(appear).bind($$('solution')) }));

But i'm afraid it won't be good : by calling invoke, you will call the fade
method on each item of your $$('.solution'), and after each fade, the search
function will be run so the appear function will be runned on all
$$(.solution) items after each search of each fade...

Am i understandable :-/ ?


On Tue, Apr 6, 2010 at 3:20 PM, C_B i...@christian-baesler.de wrote:

 Thanks a lot! I used Guillaume's version and it works fine!
 If you are able to solve my following problem regarding the same
 matter, you are my hero.


 I want to realize the same functionality, however with all elements of
 the class solution. I read about invoke but I am not really sure
 regarding your solution.
 Here is my try which is not working:

 $$('solution').invoke('fade',({afterFinish: search(area, choice,
 Element.appear.curry($$('solution').invoke))}));


 (area and choice are parameters of a own function called search)


 Thanks in advance!

 --
 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.comprototype-scriptaculous%2bunsubscr...@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: Queues Effects

2010-04-06 Thread Guillaume Lepicard
Hi again,

I understand what you want, but the problem this time is that you
are dealing with several elements.
When calling invoke, it is just as if you were looping on each item of your
Enumerable and calling the invoked method for each of them, with all
parameters - that is to say with afterFinish callback for each of them. In
other words, afterFinish callback will be called for each item being fade.
your function will be called after each fade which is not what you want.

The only solution I can think about is to loop on your items, build an array
of effects with the sync option, then run the array of effects using an
Effect.Parallel which will be the only one with an afterFinish:

var effects = [];
$$(.solution).each( function(item) {
  effects.push( new Effect.Fade(item, {sync: true}));
});
new Effect.Parallel(effects, afterFinish:  function() {
  search( area, choice, Enumerable.invoke.curry(appear).bind(
$$('solution') ) )
});


On Tue, Apr 6, 2010 at 5:27 PM, C_B i...@christian-baesler.de wrote:

 Hi,

 yes you are. I already had the problem described.

 In fact, the following works fine:

a href=# onclick=$$('.solution').invoke('fade',{ duration:
 0.8, from: 1, to: 0 });Fade/a
a href=# onclick=$$('.solution').invoke('appear',{ delay:
 0.35 });return false;Appear/a

 All elements of the class solution fade and appear at the same time,
 not one after another.
 Now I want to do the following using a function:

 1. fade all elements of the class solution synchronously (like in the
 a href above)
 2. run owned function search(area, choice) which sets some cookies and
 does some AJAX changing content of all elements of the class
 solution
 3. appear all elements of the class solution synchronously (like in
 the a href above)

 I have alredy tried doing this by using queues but it does not work -
 as described in my first post, all tasks were done synchronously .
 Now, your version works fine with IDs. So i hope, it also fits to
 elements of classes.

 Hope you get me?


 Cheers!

 --
 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.comprototype-scriptaculous%2bunsubscr...@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] Using effects after AJAX

2010-04-02 Thread Guillaume Lepicard
hi,
you have to handle an extra parameter in your getdata function which should
be a
callback function to call when ajax request is complete.

your getdata should then look like :
function getdata(whatdata,whatdiv, callBack) {
  new Ajax.Updater(whatdiv, someURL, {
   parameters:whatdata,
   onComplete: callBack
});
}

you could then call it that way:

getdata(whatdata,whatdiv, function(){
  new Effect.Slidedown(whatdiv);
});


On Fri, Apr 2, 2010 at 3:21 AM, Barry Smyth smyt...@gmail.com wrote:

 I have a webpage that loads data into a DIV using the AJAX
 getdata(whatdata,whatdiv) function.

 Initially the DIV is hidden and I only want it displayed using the
 Effect.Slidedown function once the data has been loaded into the DIV.

 The problem is if I place the Effect.Slidedown function after the
 getdata call nothing happens. If I place the effect.slidedown before
 the getdata call it works in a way but the box jumps down (I'm
 guessing because when its called the size of the DIV isn't correct
 height as its having data loaded into it by the getdata call).

 The problem seems to be that the AJAX getdata call somehow changes the
 way javascript after the AJAX command works.

 I was wondering if anyone has had a similar problem and if they
 managed to find a solution.

 --
 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.comprototype-scriptaculous%2bunsubscr...@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] Queues Effects

2010-04-01 Thread Guillaume Lepicard
i would rather use the AjaxUpdater and have a wrapping function over it :

function ajaxUpdate(id, url, params, callback) {
new Ajax.Updater (id, url, {
  parameters: params,
  onComplete: callback
});
}

then use the afterFinish callbacks of effects with use of curry function
methods:

$('information').fade({afterFinish: ajaxUpdate.curry('information', url,  {
zeitschrift_id: zeitschrift}, Element.appear.curry($('information')))});



On Thu, Apr 1, 2010 at 4:14 PM, C_B i...@christian-baesler.de wrote:

 Hi,

 i want to realize the following szenario:

 1. fade div information
 2. change content of div information by using AJAX and innerhtml
 3. appear div information again

 Here is my version:
 --
 $('information').fade({
  queue: 'end'});

 new Ajax.Request(url, {
queue: 'end',
method: 'get',
parameters: { zeitschrift_id: zeitschrift},
onComplete: function(require) {$
 ('information').innerHTML = require.responseText;}});

 $('information').appear({
queue: 'end'});

 In fact, anything is still processed synchronous. Can you give me any
 advice for solving my problem?


 Thanks in advance!

 --
 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.comprototype-scriptaculous%2bunsubscr...@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] How to do this with Function.delay?

2010-03-30 Thread Guillaume Lepicard
hi,

you should try

Element.morph.delay(0.3, 'frame_index','left:' + origin)

On Tue, Mar 30, 2010 at 6:34 PM, Walter Lee Davis wa...@wdstudio.comwrote:

 I have this effect wrapped in a timeout:

  setTimeout(function(){
var elm = $('frame_index');
elm.morph('left:' + elm.origin);
  },300);

 I realize I could use the delay: attribute on the effect itself, but for
 reasons outside of this discussion, I need to use the Prototype delay method
 instead. How would you write this (effectively replacing setTimeout only)
 and have it work. When I tried the following:

  $('frame_index').morph.delay(0.3,'left:' + origin);

 I get a whole raft of rapidly escalating errors.  Is this possible? Or am I
 swimming up-stream?

 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-scriptacul...@googlegroups.com.
 To unsubscribe from this group, send email to
 prototype-scriptaculous+unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@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] $$() for a specific root.

2010-03-29 Thread Guillaume Lepicard
hi,

use the select method of elements :
$$('#tbl_Charges .dtl_Tyre, #tbl_Charges .dtl_Repair, #tbl_Charges
.dtl_Service, #tbl_Charges .dtl_Blank').each(function(el){
el.select('.rCharge, .rValue, .rDesc').each(...)
});


On Mon, Mar 29, 2010 at 5:23 PM, Richard Quadling
rquadl...@googlemail.comwrote:

 Hi,

 I can use ...

 $$('#tbl_Charges .dtl_Tyre, #tbl_Charges .dtl_Repair, #tbl_Charges
 .dtl_Service, #tbl_Charges .dtl_Blank').each(function(el){...});

 I now want to do a further $$ on el in for each...

 el.$$('.rCharge, .rValue, .rDesc').each(function(el2){...});

 but I don't know how to use $$ in this way.

 I think I need to use Selector, but I don't know the proper CSS rules
 in this instance.

 Regards,

 Richard.

 --
 -
 Richard Quadling
 Standing on the shoulders of some very clever giants!
 EE : http://www.experts-exchange.com/M_248814.html
 EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
 Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
 ZOPA : http://uk.zopa.com/member/RQuadling

 --
 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.comprototype-scriptaculous%2bunsubscr...@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] Table columns not sorted by Tablekit after AJAX call is added

2010-03-14 Thread Guillaume Lepicard


Hi albert,

In the tablekit library, there probably is a listener on window load  
event that will look for html table tags and perform actions on them.  
You should perform those actions when ajax updater succeed.


Guillaume


Le 13 mars 2010 à 17:19, albert kao albertk...@gmail.com a écrit :


I use the Tablekit library and Prototype javascript framework on
firefox, chrome  IE8.
The columns in this table can be sorted by the Tablekit library.
Code:
script type=text/javascript src=js/prototype.js/script
script type=text/javascript src=js/tablekit.js/script

body
 div id=mainmenu
  ...
 /div
 div id=content

 table class=sortable resizable
 theadtr
   th class=sortfirstdescID/th
   thDate/th
   thTime/th
 /tr/thead
 /table
 /div
/body

However, after adding the periodic refresh by AJAX (eventually I want
to refresh only the web page when there is new data available) and
div, then the columns in this table cannot be sorted by the Tablekit
library.
Code:
body onload=new Ajax.PeriodicalUpdater('topmenu', 'activity.htm',
{method: 'get', frequency: 10});
div id=topmenu
...
 div id=mainmenu
  ...
 /div
 div id=content

 table class=sortable resizable
 theadtr
   th class=sortfirstdescID/th
   thDate/th
   thTime/th
 /tr/thead
 /table
 /div
/body
/div

--
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] Ajax.Request - can't get to work in Firefox, Chrome

2010-03-13 Thread Guillaume Lepicard
hi ronen,
could it be a browser cache issue ? have you tried clearing cache before
running ajax ?

On Fri, Mar 12, 2010 at 3:53 PM, Ronen rrotst...@gmail.com wrote:

 I've downloaded the latest prototype (version 1.6.1) and tried to call
 a java servlet using Ajax.Request.  From IE, it works just fine
 (probably because it's using ActiveX rather than XMLHttpRequest), but
 I'm having no luck with Firefox (v3.6) and Chrome (4.0).

 The servlet that I'm calling performs a log operation right away so I
 can see whether it was called or not.  That's how I know that IE is
 successful but firefox and chrome aren't.

 I've used Firebug to try to debug firefox and I see that the line
 this.transport.send(this.body);
 is, in fact, being called by firefox.  But still, my servlet shows no
 log of being called.

 The exact javascript I'm using is below:
 var opts = {
  method: 'post',
  parameters : { key:value },
  onSuccess: function(transport)
  {
   var d = new Date();
   document.getElementById(location).value =
 d.getTime();
  }
 }
 var asyncReq = new Ajax.Request(http://localhost:8701/MyApp/
 MyServlet, opts);

 As you can see, in the success method, I just populate a textbox to
 have the current date/time, and this actually works in all browsers
 (IE, Firefox, Chrome).  Just that in Firefox and Chrome the servlet is
 not physically being called (yet the success method is).

 Any help in solving this issue is greatly appreciated.

 --Ronen

 --
 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.comprototype-scriptaculous%2bunsubscr...@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] multiselect combo plugin

2010-02-22 Thread Guillaume Lepicard
hi,
you might want to check
http://livepipe.net/control/selectmultiple
http://scripteka.com/

On Sun, Feb 21, 2010 at 10:04 PM, termi ivan.po...@f4s.sk wrote:

 Hi!

 please, is there any multi select combo plugin for prototype
 (script.aculo.us) like


 http://www.erichynds.com/jquery/jquery-multiselect-plugin-with-themeroller-support/

 thanks!

 termi

 --
 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.comprototype-scriptaculous%2bunsubscr...@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: Scope problem with prototype

2010-02-18 Thread Guillaume Lepicard
hi,
what about:
$$(.ddBox).each(function(ddbox){
  ddbox.setStyle({height: ddbox.select(ol).invoke('getHeight').max() +
px);
});



On Thu, Feb 18, 2010 at 1:33 PM, huckocs huck...@googlemail.com wrote:

 Thanks for the effort!

 The code is a much nicer way of replicating what I've done, however
 i'm still left with the original issue. That being that the max_Height
 is set to the highest ol in ALL of of the div.ddbox rather than in
 each individual .ddBox

 Any ideas?

 Thanks for the help!!

 On Feb 16, 3:38 am, greg g...@reservation-net.com wrote:
  This is my first attempt at answering a question here, so use with
  caution...
 
 var max_Height = 0;
 
  $$('.ddBox').each(function(dd) {
  max_Height = Math.max(max_Height,
  dd.select('ol').invoke('getHeight').max());
  });
 
  $$('.ddBox').invoke('setStyle', {height: (max_Height) + 'px'});
 
  There's probably a shorter way, and hopefully someone will post it,
  but this seems to work.
  Although, when running it some Divs overlap, so I'm not sure if the
  results are what you are looking for.
 
  On Feb 15, 8:43 am, huckocs huck...@googlemail.com wrote:
 
   Hi all,
 
   getting stuck with scope, I'm a bit new to javascript so would
   appreciate the help!
 
   I'm attempting to loop through each div class=ddBox and get the
   highest ol in each div class=ddBox, then set the height of the
   div class=ddBox to the highest ol. The problem is that its
   looping through and getting the highest ol in the window.object and
   applying this to each div. I'm sure its something simple but I'm
   banging my head on the table here!
 
   I've looked into binding but can't seem to get it right :(
 
   div class=ddBox
ol
 li
 a href=#/a
 /li
/ol
ol
 li
 a href=#/a
 /li
/ol
ol
 li
 a href=#/a
 /li
/ol
   /div
   div class=ddBox
ol
 li
 a href=#/a
 /li
/ol
ol
 li
 a href=#/a
 /li
/ol
ol
 li
 a href=#/a
 /li
/ol
   /div
   div class=ddBox
ol
 li
 a href=#/a
 /li
/ol
ol
 li
 a href=#/a
 /li
/ol
ol
 li
 a href=#/a
 /li
/ol
   /div
 
   $$('.ddBox').each(function(dropdown){
   var ddHeight = $$('ol', this);
   var ddBoxHeight = $$('.ddBox');
   var max_height = ddHeight.invoke('getHeight').max();
   ddBoxHeight.invoke('setStyle', {height: (max_height) + 'px'});
   console.log(max_height);
 
   },this);
 
   Any help appreciated!
   Cheers
 
   Huck

 --
 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.comprototype-scriptaculous%2bunsubscr...@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.