Re: [Proto-Scripty] How can I observe elements with class=test_1, test_2, test_3 or first_test, second_test, third_test?

2009-12-31 Thread Frédéric
On jeudi 31 décembre 2009, kimbaudi wrote:

 Hi, I know how to observe elements with class=test. However, I would
 like to know how I would be able to observe elements with
 class=test_1, class=test_2 and class=test_3 or
 class=first_test, class=second_test and class=third_test. Here
 is my pastie url that observes elements with class=test and alerts
 the innerHTML of these elements: http://pastie.org/762352. Can someone
 please show me a code that will alert the innerHTML of elements that
 have classes test_1, test_2, test_3 and elements that have
 classes first_test, second_test, third_test? I am familiar w/
 Javascript to know that this is possible but unfamiliar w/ Javascript
 to know how to achieve this.

A simple-but-not-smart way is to parse all dom elements and observe all id 
containting 'test'...

-- 
Frédéric

--

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 can I observe elements with class=test_1, test_2, test_3 or first_test, second_test, third_test?

2009-12-31 Thread Frédéric
On jeudi 31 décembre 2009, Paul Kim wrote:

 Sorry, but I'm afraid your simple-but-not-smart way addresses the
  problem because I am observing elements with class, not id.

Oups, sorry. But I guess there is a way to parse all classes defined in 
CSS?

-- 
Frédéric

--

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: Passing the content of an array in a form

2009-12-22 Thread Frédéric
Le mardi 22 décembre 2009 05:11, joe t. a écrit :

 For most typical cases, JSON is easier, and more efficient. For one,
 by sending a Content-type header of application/json you can send an
 array down from the server, and Prototype automatically converts it
 into a JSON object you can utilize.

I'm switching to json, and you're right, it is much easier to handle!

-- 
   Frédéric

--

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: Ajax and json

2009-12-21 Thread Frédéric
Le lundi 21 décembre 2009 13:05, T.J. Crowder a écrit :

 You're just looking in the wrong place. The second parameter to the
 onSuccess callback is the value of the X-JSON *header*, if any. It's a
 means of sending back extra data alongside the main response. You're
 sending JSON back in the body, not a header. To access that, just look
 at the `responseJSON` property of the response object (the first
 parameter to the onSuccess). E.g.:

     new Ajax.Request(url, {
         onSuccess: function(response) {
             // The decoded JSON data is available from
             // the response.responseJSON property.
         }
     });

Ok, I got it. Thanks :o)

-- 
   Frédéric

--

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] Passing the content of an array in a form

2009-12-20 Thread Frédéric
Hi,

I have a little problem. I want to give the content of an array to a new 
page through a form. The javascript code is:

this._view.selectedPicts.setAttribute('value', picts);

I retreive the content using mod_python:

fields = util.FieldStorage(req)
selectedPicts = fields['selectedPicts'].split(',')

All works fine under Firefox and Safari/konqueror, but fails under IE8:

Firefox:

fields={'numAdherent': [Field('numAdherent', '20')], 'numEvenement': 
[Field('numEvenement', '2')], 'selectedPicts': [Field('selectedPicts', 
'P4052858.JPG,PB135158.JPG,photo20-08-03_DSC5719net_redimensionner.jpg,_DSC0222.jpg,p1010005.jpg')]}

IE8:

fields={'numAdherent': [Field('numAdherent', '20')], 'numEvenement': 
[Field('numEvenement', '2')], 'selectedPicts': [Field('selectedPicts', 
'[object]')]}

The strange thing is if I log 'picts' before sending the form, it is 
correct, even under IE8!

console.debug(OrderingController._submit(): picts= + picts);

Firefox:

2009-11-0 12:53:55,198::DEBUG::OrderingController._submit(): 
picts=P4052858.JPG,PB135158.JPG,photo20-08-03_DSC5719net_redimensionner.jpg,_DSC0222.jpg,p1010005.jpg

IE8:

JOURNAL : 2009-11-0 12:55:10,67::DEBUG::OrderingController._submit(): 
picts=P4052858.JPG,PB135158.JPG,photo20-08-03_DSC5719net_redimensionner.jpg,_DSC0222.jpg,p1010005.jpg

So, why do I get the wrong string in my form field under IE8? What should I 
use instead of just 'picts'?

Thanks,

-- 
Frédéric

--

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: Passing the content of an array in a form

2009-12-20 Thread Frédéric
On lundi 21 décembre 2009, joe t. wrote:

 i may be misunderstanding the problem you're describing, but typically
 when you submit an array of values with the same field name, you want
 to use [] on the end of the field name. It's possible IE is
 submitting the array in its object form, which the server is seeing as
 string [object] and sending back untouched. If the fields are in
 your HTML, they need an attribute like:
 input ... name=picts[] /
 or if the data is managed by your script, and passed in the
 Ajax.Request as part of the parameters option, you still need to wrap
 the name into a string:
 { parameters: { picts[] : picts ... } }
 
 Sorry if that's on the wrong track.

Thanks for the explanation.

I was wondering: a better solution is may be to use json? What do you 
sthink about?

-- 
Frédéric

--

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: Complete graphical toolkit in js

2009-12-19 Thread Frédéric
On samedi 19 décembre 2009, T.J. Crowder wrote:

  Is it some sort of reference in js world, like Qt is? Is it
  based on Prototype?
 
 No, and no. :-)

I found that Ext can use Prototype as an adapter. What does it mean?

-- 
Frédéric

--

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: Complete graphical toolkit in js

2009-12-19 Thread Frédéric
On samedi 19 décembre 2009, Peter De Berdt wrote:

  I found that Ext can use Prototype as an adapter. What does it mean?
 
 The underlying functions that build up the components use the adapter  
 you load. ExtJS uses its own Javascript framework by default, but by  
 loading a different adapter, it will use that framework instead  
 (Prototype, JQuery, ...). It's a bit like the database adapters in  
 Rails, CakePHP, Symphony etc that allow you to use whatever database  
 you prefer and abstracts it with a unified syntax layer on top of it.

Does it mean that it is possible to extend Ext classes using the Prototype 
way (Class.create)?

-- 
Frédéric

--

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: Complete graphical toolkit in js

2009-12-19 Thread Frédéric
On samedi 19 décembre 2009, Peter De Berdt wrote:

 I highly doubt it, ExtJS components inherit in a different way. It  
 does mean you can just continue using Prototype for everything else  
 (not ExtJS related) and don't have to load an extra framework on top  
 of Prototype if you're already using it. Extending ExtJS components is  
 very similar to Prototype's anyway, except for the Ext instead of  
 Class as the keyword
  (http://www.extjs.com/learn/Manual:Component:Extending_Ext_Components )

Ok, I see. Thanks.

-- 
Frédéric

--

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] Complete graphical toolkit in js

2009-12-18 Thread Frédéric
Hi,

I'm wondering: does it exist a complete graphical toolkit in javascript? 
Something like Qt or Gtk, which allows to build complex GUI?

I found several nice little projects, but they all use their own design...

Thanks,

-- 
   Frédéric

--

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] problem with arguments and class creation

2009-12-18 Thread Frédéric
Le vendredi 18 décembre 2009 13:16, Davide a écrit :

 var C = Class.create({
    initialize:function() {
      alert(ext:  + arguments.length)
       this.b(arguments);
    },
     b:function() {
       alert(int:  + arguments.length)
     }
 });

Try:

var C = Class.create({
   initialize:function() {
 alert(ext:  + arguments.length)
  b.apply(this, arguments); // 
   },
b:function() {
  alert(int:  + arguments.length)
}
});


-- 
   Frédéric

--

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: problem with arguments and class creation

2009-12-18 Thread Frédéric
Le vendredi 18 décembre 2009 13:34, Davide a écrit :

 I played a bit and your solution is giving me
 INT:2

 I implemented this now.

 var C = Class.create({
initialize:function() {
  alert(ext:  + arguments.length)
   b.apply(arguments);
},
 b:function() {
   alert(int:  + arguments[0].length)  ;
 }
 });

 which is giving correct INT / EXT values.

 It seems to me a bit overcomplicated.. is this the right way ?

 Can you please explain what would do the 'this' as you were
 suggesting ? I guess that there is something I am missing in the big
 picture...

I'm new to Prototype, so I'll let gurus explain the details ;o)
This is the solution I got for my Signal class, some days ago (see  
T.J. Crowder answer on 07/12/2009 for my post named 'Custom signal').

-- 
   Frédéric

--

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: problem with arguments and class creation

2009-12-18 Thread Frédéric
Le vendredi 18 décembre 2009 15:35, T.J. Crowder a écrit :

 Frédéric was just missing out the `this` keyword:

Oups, right! Sorry...

-- 
   Frédéric

--

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: Complete graphical toolkit in js

2009-12-18 Thread Frédéric
Le vendredi 18 décembre 2009 15:30, Matt Foster a écrit :

 Ext.js has a ton of UI stuff prebaked

 http://extjs.com

Looks great! Is it some sort of reference in js world, like Qt is? Is it 
based on Prototype?

-- 
   Frédéric

--

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: document.write() vs Element/appendChild()

2009-12-12 Thread Frédéric
On samedi 12 décembre 2009, disccomp wrote:

 A good reason to get out of the habit of using document.write, is that
 it is NOT supported by XHTML.[1]
 
 [1] http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite

When using document.write() in XHTML documents, it clears the entire page 
and writes the new stuff on a blank page...

-- 
Frédéric

--

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: Check a mouse button

2009-12-11 Thread Frédéric
Le vendredi 11 décembre 2009 12:48, david a écrit :

 You do well, but for the mouseup, it should not be set to any element
 other document, so when you release the mouse button, the document
 will see this event.
 And don't forget to create the mousemove  mouseup at mousedown event.
 And delete those two events when mouseup is launch.

Ok, I got it!

Thanks,

-- 
   Frédéric

--

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: Check a mouse button

2009-12-10 Thread Frédéric
On jeudi 10 décembre 2009, Alex McAuley wrote:

 MouseMove tracks the mouse. 
 
 
 A drag for example uses Left Mouse Click (down) plus Mouse Move
 
 Click simply detects the click on an element or page..
 
 If you want to observe mousemove into an element then setup an observer
  once  it has entered for click .. this seems a slight waste of time and
  memory to setup observers ad hoc..
 
 What exactly are you trying to acheive - perhaps one of us can point you
  in  the right direction...

I precisely wants to implement a drag'n'drop feature. I have a set of 
pictures, displayed in a table as thumbs, and I can move the thumbs in real 
time using the mouse.

For that, I have 3 callbacks:

'mousedown': I start the drag, by storing the src image
'mousemove': I move the thumbs, onlly if the src image has been set
'mouseup': I just reset the src image, so I know that the drag is over

But if I release the button outsideany thumbs, the drag remains active, 
because I can't detect that it ended.

There is maybe a better design to do that?

-- 
Frédéric

--

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: Problem using invoke()

2009-12-09 Thread Frédéric
Le mardi 8 décembre 2009 15:43, T.J. Crowder a écrit :

       this._navButtons.each(function(item) {
           _opacity(item, ...);
       });
 
  The problem is to give additionnal params (for Effect.Oppacity); it
  does not seem to be possible with each(). That's why I tried
  invoke()...

 Look again at my example. You'd fill in the ... with the parameters.

Thanks, I got it.

-- 
   Frédéric

--

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] Include scripts

2009-12-09 Thread Frédéric
Hi,

I'm looking for a import script code example, to be able to include parent 
class code (I write only 1 class per file). Is there something already 
available?

Thanks,

-- 
   Frédéric

--

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: Include scripts

2009-12-09 Thread Frédéric
Le mercredi 9 décembre 2009 11:25, T.J. Crowder a écrit :

 Your best bet for something like that is to have a build process that
 combines the scripts (and then minifies them), and then include the
 resulting single script with just one script tag. Reading lots of
 individual script files will be quite slow, because browsers typically
 will load only one or two at a time, and it takes very perceptible
 time to individually retrieve even three or four scripts in addition
 to the other resources on the page. Latency kills.

I see.

 I don't currently have a good recommendation of a build tool to use
 for this, but if it's just combining files and then running them
 through jsmin or something similar, any of the usual suspects (rake,
 ant, etc.) should be able to manage it.

I'm not looking for a minimizer, but only to solve dependencies... I guess 
it needs to introduce a specific tag in the code, like the Google Closure 
Compiler does. For example:

// @include another_script.js

Maybe this as already been discussed here? Did anyone already write such 
tool?

 Google's just released their Closure Compiler, which handles doing
 this (including dependency management, although it's a bit of a pain
 to configure dependencies at present based on comments in the
 discussion group) as well as handling removing unused code and various
 other optimisations. It's still very new:
 http://code.google.com/closure/compiler

Well, dependencies is the only thing I'm looking for :o/

If it does not yet exist, I will try to write my own tool (in python, as I'm 
familiar with this language).

Thanks for your help.

-- 
   Frédéric

--

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: Check a mouse button

2009-12-09 Thread Frédéric
On mercredi 09 décembre 2009, david wrote:

 When observing an event with:
 Event.observe('mousemove',function(evt){
   if(evt.isLeftClick) alert('left button clicked');
   if(evt.isMiddleClick) alert('middle button clicked');
   if(evt.isRightClick) alert('right button clicked');
 })
 
 there is inside the event object some shortcut to know at the moment
 the event is fired if a button is clicked. And the same existe in case
 of a key pressed.

I have to check again, but in my previous tests, the isLeftClick() always 
returned true, and other always returned false...

-- 
Frédéric

--

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: Include scripts

2009-12-09 Thread Frédéric
On mercredi 09 décembre 2009, Tobie Langel wrote:

 Prototype's using Sprockets[1] for this.
 
 You might want to give it a spin.

That's exactly what I was looking for! Simple and powerfull...

Thanks :o)

-- 
Frédéric

--

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: Problem using invoke()

2009-12-08 Thread Frédéric
Le mardi 8 décembre 2009 10:07, T.J. Crowder a écrit :

 I assume in your real code, that ends with `]`, not with `)` as above?
 As above, it's a syntax error.

  this._navButtons.invoke(_opacity, {'from': 0,
   'to': 1,
   'duration':1});

Oh, yes, my real code is correct...

 Do your button instances have a function called `_opacity` (with the
 underscore)? I'm not a scripty-head and maybe I shouldn't be posting,
 but the effect is called Effect.Opacity, and usually when scripty
 mixes effects in as element methods, it's the name of the effect with
 an initial lower case letter, so wouldn't that just be `opacity`?

Ok, I see the problem: here, _opacity() is a global function, not a 
this._navButtons element method...

I want to use the Effect.Opacity effect; what is the best way to implement 
this? Should I bind my _opacity() function to the buttons, using methodize?

-- 
   Frédéric

--

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: Problem using invoke()

2009-12-08 Thread Frédéric
Le mardi 8 décembre 2009 10:36, T.J. Crowder a écrit :

 First check that scripty hasn't already done that (without the
 underscore). Scripty methodizes effects (at least sometimes, I don't
 know the details), so that (for instance) Effect.Fade can be used as a
 #fade method on element instances.

It does not seem to be the case with the Opacity effect..

 If you want to call a global function on each entry in an array,
 that's easy:

     this._navButtons.each(function(item) {
         _opacity(item, ...);
     });

The problem is to give additionnal params (for Effect.Oppacity); it does not 
seem to be possible with each(). That's why I tried invoke()...

 You might consider the Effect.Parallel effect, though, if you're
 looking to do effects in parallel:
 http://wiki.github.com/madrobby/scriptaculous/effect-parallel

I only need 1 effect on several elements. I also tried Effect.multiple, but 
the effect is not synchronized on all objects. Neither with a simple loop, 
but the delay is very small in this last case (I can't see it)...

-- 
   Frédéric

--

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] Check a mouse button

2009-12-08 Thread Frédéric
Hi,

Is there a way to check if a mouse button is pressed in an 
Event.observe('mousemove') callback ?

Thanks,

-- 
   Frédéric

--

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] Check a mouse button

2009-12-08 Thread Frédéric
Le mardi 8 décembre 2009 13:54, Alex McAuley a écrit :

 ...observe('mousemove',function(e) {

 $('SomeElement').observe('click',function() {
     doSomethingWIthyourClick();

Ok, so I have to register both events...

Thanks :o)

-- 
   Frédéric

--

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: document.write() vs Element/appendChild()

2009-12-07 Thread Frédéric
Le lundi 7 décembre 2009 11:00, Alex McAuley a écrit :

 There is a known bug in IE8 regarding new Element and adding the class
 toit in the scope...

 To overcome it simply use addClassName('My-Class'); after or instead of
 the scope

Ok, thank you all for your help. I just added a call to addClassName, and 
wll works fine.

-- 
   Frédéric

--

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: Custom signal

2009-12-07 Thread Frédéric
Le lundi 7 décembre 2009 12:46, T.J. Crowder a écrit :

 Worth reading up on the `arguments` variable in the spec[1] (warning,
 multi-meg PDF). Also check out Function#apply, which is probably what
 you're looking for:

It works fine! Here is the code I now use:

var Signal = Class.create({
initialize: function () {
this._slots = new Array();
},

emit: function() {
for (i = 0; i  this._slots.length; i++) {
try {
this._slots[i].apply(this, arguments);
}
catch (e) {
}
}
},

connect: function(slot) {
if (!this._slots.include(slot)) {
this._slots.push(slot);
}
},

disconnect: function(slot) {
if (this._slots.include(slot)) {
this._slots.splice(this._slots.indexOf(slot, 1));
}
},

disconnectAll: function() {
this._slots = new Array();
},
});


Thanks for your help :o)

-- 
   Frédéric

--

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: Custom signal

2009-12-07 Thread Frédéric
On lundi 07 décembre 2009, Tobie Langel wrote:

 A couple suggestions:
 
 https://gist.github.com/bb3d40f6915118da4dec

Thanks!

You suggested to use:

a = []

instead of:

a = new Array()

What is the difference?

PS: about the try/catch, in my real code, I log the error on Firebug 
console...

-- 
Frédéric

--

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] Problem using invoke()

2009-12-07 Thread Frédéric
Hi,

I build an array with some DOM elements, and try to apply effects on them 
using invoke(). But it does not work.

Ie may be a problem with function defined as pesudo-methods, but I don't 
get any usefull error neither in Firebug, nor in IE debugger.

As I want to use Effect.Opacity(), I wrote a pure function as:

function _opacity(el, args) {
new Effect.Opacity(el, args);
}

then in my class:

this._navButtons = [this._view.prevButton,
this._view.nextButton,
this._view.hideButton);
this._navButtons.invoke(_opacity, {'from': 0,
 'to': 1,
 'duration':1});

In Firebug, I get:

reference to undefined property this[arguments[0]]
[Break on this error]

without any traceback or code line. In IE, I get:

'undefined' a la valeur null ou n'est pas un objet
('undefined' as null value or is not an object)

at line 713 of prototype.js; it is the call to my method:

return value[method].apply(value, args);

What I did wrong? Is it a problem with this context?

-- 
Frédéric

--

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.