[Proto-Scripty] Re: New Script.aculo.us combination effect: Fisheye (beta), I need help with callback

2008-12-02 Thread julien Devouassoud
i was not being sarcastic... your version was quite nice, just needed a lil
smoothing.

for a scripta version i'll check it out

On Mon, Dec 1, 2008 at 8:12 PM, Diodeus [EMAIL PROTECTED] wrote:


 It was more about solving the problem of how to do it, and getting a
 little more practice in OO programming, than being the first to do it.
 Regardless, there isn't a scriptaculous version floating around yet.

 Based on the links you posted I have discovered room for improvement.
 It's turning out to be a good exercise for a slow day.

 On Dec 1, 12:29 pm, julien Devouassoud [EMAIL PROTECTED] wrote:
  yeah much, but good effort man.. reinventing the wheel is cool, i love to
 do
  it.. and then realize thing existed all along :)
 
  On Mon, Dec 1, 2008 at 6:11 PM, Diodeus [EMAIL PROTECTED] wrote:
 
   That's very nice. Smoother than the one I've put together.
 
   On Dec 1, 9:49 am, julien Devouassoud [EMAIL PROTECTED] wrote:
check this out :
 
  http://www.ndesign-studio.com/blog/design/css-dock-menu/http://www.ja.
 ..
 
On Mon, Dec 1, 2008 at 2:42 PM, Diodeus [EMAIL PROTECTED] wrote:
 
 options.mouseClick(evt);
 
 That's the piece I needed. Thank you.
 
 On Nov 28, 9:35 pm, Jerod Venema [EMAIL PROTECTED] wrote:
  You probably want to do something like:
 
  mouseClick:. arguments[1].onClick || function(){}
 
  and then, in your code, you hook up the click like so:
 
  myelement.on(click, options.mouseClick);
 
  which hooks the click event to the passed in function. If you
 need to
   do
  other processing first, try:
 
  myelement.on(click, function(evt){
dostuff();
options.mouseClick(evt);
 
  });
 
  Jerod Venema
  Frozen Mountain Softwarehttp://www.frozenmountain.com/
  919-368-5105
 
  On Fri, Nov 28, 2008 at 4:32 PM, Diodeus [EMAIL PROTECTED]
 wrote:
 
   I am building a Scriptaculous-based fisheye menu, which is
 coming
   along well. The thing I can't figure out is how to fire what is
 in
   the
   onClick callback I created.
 
   new Effect.FishEye('demo',{onClick:function(){alert(##)}})
 
   In the initialization I have:
 
   options = Object.extend({
  mouseClick: arguments[1].onClick || '' ...
   })
 
   ...which then goes to this method:
 
   mouseClick: function(event) {
  alert(u...I dunno)
   },
 
   I've been looking at other effects code to try and figure it
 out,
   but
   I'm not getting anywhere.
 
   Here's the demo: jameslab.moveable.com/fisheye
 
   Thank you.
 
   - James.
 
  --
  Jerod Venema
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Function expected err when doing instanceof in IE

2008-12-02 Thread kangax

On Dec 2, 12:11 am, yoshi [EMAIL PROTECTED] wrote:
 but it is defined globally? cuz i open up the js debugger console in
 IE8 beta, i type 'Element' and the debugger returns {...} so it is
 defined?  And y is only Element not globally defined and not the
 Template or Hash object ? I think prototype define them on global
 scope?

 what i m trying to do is write a function that loops through all
 functions of an obj, do some AOP.  But i m excluding Prototype defined
 objects because it causes too much recursion; to do that i m manually
 saying if obj is instance of Element, Hash and Array do nothing, and
 Element is causing problem in IE.

I might be missing something, but an object that is an `instanceof
Element` is not necessarily Prototype defined object; It's the one
that has `Element`'s [[Prototype]] somewhere in its prototype chain.
Afaik IE8 does not ensure such inheritance in most of its DOM
elements. If you need to check whether an object is an element, this
naive solution should do it most of the time:

function isElement(o) {
  return (!!o  o.nodeType === 1)
}

Also, don't forget that `instanceof` is not cross-frame safe, so you
might want to use Prototype's `Object.isArray` and `Object.isHash`.


 things works in firefox of course

 thanks again for the help

[...]

--
kangax
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Ajax.updater - data get merged in content when running many updaters

2008-12-02 Thread Stucture_Ulf

you're right, data doesn't get merged by using the updater. my problem
is that the data get merged in a div while a user clicks and activates
an update during page load, if so data get merged.

how can I fix this quick without rewriting a lot of scripts ... I'm
not using on dom:loaded...so I'm looking for a way to implement this
in the function below. any hint would be helpful.

function update(id,url) {
  if($(id)) {
new Ajax.Updater(id,url,{
   asynchronous:true,
   evalScripts:true,
   onFailure: function(obj) {$(id).update
('centerstrongerror...strong/center');   }
   });
  }
}

On Dec 1, 3:09 pm, T.J. Crowder [EMAIL PROTECTED] wrote:
  so what I'm looking for is a way to wait or halt the second request
  until the first one is finished...

 Lots of ways to do that.  You could maintain a queue, etc.  Prototype
 maintains a count of active Ajax requests in Ajax.activeRequestCount
 [1], you could query that before launching the second request.

 [1]http://www.prototypejs.org/api/ajax/responders

 But what I'm not getting is the merging:  Ajax.Updater *updates*, it
 doesn't merge, unless you specify an insertion.
 --
 T.J. Crowder
 tj / crowder software / com

 On Dec 1, 2:01 pm, Stucture_Ulf [EMAIL PROTECTED]
 wrote:

  the problem here is that if i run a second updater, targeted on the
  same div as the first one and before the first one is complete...the
  result of the second gets on top of the first request. i do not want
  to merge the data, only display the latest updater.

  so what I'm looking for is a way to wait or halt the second request
  until the first one is finished or kill the first one when the second
  gets activated.

  On Nov 30, 11:33 pm, T.J. Crowder [EMAIL PROTECTED] wrote:

   Hi,

   Not immediately seeing a problem, can you create a complete page that
   demonstrates what you're seeing?
   --
   T.J. Crowder
   tj / crowder softare / com

   On Nov 30, 8:07 pm, Stucture_Ulf [EMAIL PROTECTED]
   wrote:

thanks for your answer. here is a short code snippet i'm using. i do
not want to place the second call on top or under the first content, i
just want to make sure the second request stop the first one so that
only the content from the second updater get's displayed.

function update(id,url) {
  if($(id)) {
    new Ajax.Updater(id,url,{
           asynchronous:true,
           evalScripts:true,
           onFailure: function(obj) {$(id).update
('centerstrongerror...strong/center');   }
   });
  }

}

On Nov 30, 10:47 am, T.J. Crowder [EMAIL PROTECTED] wrote:

 Hi,

 I assume you're not using the insertion option on your Ajax.Updater
 calls[1]?  If so, there's your answer.  If not, can you put together a
 small, self-contained example that demonstrates the prblem?

 [1]http://www.prototypejs.org/api/ajax/updater

 HTH,
 --
 T.J. Crowder
 tj / crowder software / com

 On Nov 27, 11:10 am, Stucture_Ulf [EMAIL PROTECTED]
 wrote:

  hi all!

  i have a problem with Ajax.updater.

  When i run the Ajax.updater in one div and then if a user clicks on
  link and activates another Ajax.updater in the same div before the
  first one is finished the data get merged in the same div. The top 
  is
  showing the new content, underneath is showing the data that was not
  yet loaded from the first call.

  how can I fix this? can i stop/kill the first updater before running
  the second one? or should i wait until the first is finished before
  triggering the next one...and how do I do that?

  grateful for help and advice
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: slide effect problem

2008-12-02 Thread Walter Lee Davis

As you've found, setting the display property in a CSS sheet will not  
work with the Scripty effects. Try hiding the things you want to hide  
after the DOM loads. Set an empty class on all your to-be-hidden bits,  
and then do this:

document.observe('dom:loaded',function(){
$$('.hideme').invoke('hide');
});

This will have everything hanging out there and visible from Google's  
POV, but will hide it and prepare for your effect from everyone else  
with a pulse and a JavaScript interpreter. Because you are doing it at  
the dom:loaded point rather than the window.load point, there will be  
no flash of unhidden content.

Walter

On Dec 2, 2008, at 2:27 AM, shafir wrote:


 hey,

 im using the slide effect in my website and to do so im using on the
 div i want to slide the style=display:none i know that google do
 not index text that under this style, because of that im using a class
 name that have inside - 'display:none'.

 but then i noticed that the slide effect doesnt work with the
 class :-(

 any suggestions?!?

 thanks, shafir.


 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: autocompleter.local

2008-12-02 Thread Walter Lee Davis

Make sure that the script containing the autocomplete stuff is at the  
bottom of your page (or at least lower in the source order than the  
element you are trying to apply the effect to) and it should work as  
written. Otherwise, wrap the new Autocompleter.Local part inside of a  
window.load or document.dom:loaded listener.

Walter

On Dec 2, 2008, at 6:25 AM, charliem wrote:


 I was looking for on the web for a way of autocompleting and found
 this. I have looked over the wiki at Github and used the example lines
 there to put it in my htmlas below.

 I have loaded the .js scripts to /javascripts but nothing is working.
 Am I missing something very obvious?
 Is this dependent on AJAX or something? Please forgive the ignorance
 but I have had absolutley no experience of AJAX or such like.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: analogue clock?

2008-12-02 Thread Diodeus

This one's a classic and does it using native JavaScript.

http://rainbow.arch.scriptmania.com/scripts/mouse_clock3.html


On Dec 1, 5:55 pm, geoffcox [EMAIL PROTECTED] wrote:
 Hello,

 Is it possible to construct a javascript analogue clock using
 prototype/scriptaculous?

 In particular I want one where the speed of the hours/minutes/seconds
 hands can be increased/decreased.

 Cheers,

 Geoff
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: $$(css-class).invoke('observe', 'mouseover', function) on the fly

2008-12-02 Thread Geoffroy Gomet

Thanks a lot for the quick response. Exactly what I was looking for.

You saved me  loads of work. Your wiki is really usefull, I'm going to
consult it more often.

Geoffroy

On Dec 2, 7:12 am, T.J. Crowder [EMAIL PROTECTED] wrote:
 Hi,

 Check out this article on the unofficial Prototype  script.aculo.us
 wiki:

 http://proto-scripty.wikidot.com/prototype:tip-scripting-dynamically-...

 HTH,
 --
 T.J. Crowder
 tj / crowder software / com

 On Dec 1, 7:31 pm, Geoffroy Gomet [EMAIL PROTECTED] wrote:

  Hello,

  I create new ojects  from an ajax request (via Class.create(),
  initialize,...) , then add them to the dom via insert.
  How could I use invoque method on a collection of those objects. Using the
  invoque method on existing elements works really well but it doesn't work on
  dynamically created element.
  Do I have add this behavior to the created Class ?

  Any help or suggestion is welcome.

  Thanks a lot in advance.

  --
  Geoffroy Gomet
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Class extendsion question

2008-12-02 Thread K.C.Leung

How can I create a class extends from Element ?

var SubElement = Class.create ( Element, {
initialize: function ( $super ) {
$super ( div ) ;
}
} ) ; // error: 'subclasses' is null or not an object
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: IE6 Error: Object doesn't support this property or method

2008-12-02 Thread T.J. Crowder

Hi,

  1. 90% of the time, you'll figure out what's wrong in the process of
  doing it -- instant help!

 Bingo!

Cool. :-)

 So I worked out that it is because of this:
 ...
 Though, changing to what I logically would have thought it should be
 hasn't worked

IE is not tolerant of trailing commas in object and array literals
(e.g., [1, 2, ] instead of [1, 2]), so it won't like the original
addBehavior code you quoted.  Other browsers' JavaScript parsers are
more forgiving (although technically the trailing comma is wrong in
the current version of JavaScript; Crockford and others are trying to
get it put in the next ECMAScript spec though[1], and I think they've
succeeded as of the latest 3.1 draft[2]).

[1] http://javascript.crockford.com/recommend.html
[2] http://wiki.ecmascript.org/doku.php?id=es3.1:es3.1_proposal_working_draft

So just drop the comma after the function definition:

Event.addBehavior({
'.collapse:click' : function(e) {
var div = this.id;
new Effect.toggle(div + '-block','blind', {queue:
'end', duration: 0.5});
} // == No comma

});

The problem with the replacement code you listed is that you're
calling observe() on an array [the return value of $$()].  observe()
is a method Prototype adds to elements, not arrays.  You could get
what you were looking for via Enumerable#invoke()[3] (Enumerable is
mixed into arrays), but just deleting the comma should be all you
need.

[3] http://www.prototypejs.org/api/enumerable/invoke

HTH,
--
T.J. Crowder
tj / crowder software / com

On Dec 1, 11:39 pm, Grant Newton [EMAIL PROTECTED] wrote:
  1. 90% of the time, you'll figure out what's wrong in the process of  
  doing it -- instant help!

 Bingo!

 So I worked out that it is because of this:

 Event.addBehavior({
         '.collapse:click' : function(e) {
                 var div = this.id;
                 new Effect.toggle(div + '-block','blind', {queue: 'end', 
 duration:  
 0.5});
         },

 });

 Though, changing to what I logically would have thought it should be  
 hasn't worked:

         $$('.collapse').observe('click', function() {
                 var div = this.id;
                 new Effect.toggle(div + '-block','blind', {queue: 'end', 
 duration:  
 0.5});
         });

 Suggestions?

 Grant

 On 01/12/2008, at 9:06 PM, T.J. Crowder wrote:



  Hi Grant,

  And even after copy/paste of your code, I still get the error.

  You would do; as I said, the problem isn't in the code you quoted, so
  my changes to it don't matter other than removing an unnecessary call.

  An example of where I have it in use is:

  Sorry, it's just not practical for other people to go digging around
  the full version.  Again:  Can you create a _small, self-contained
  page_ that demonstrates the problem.  There are two reasons for doing
  this:  1. 90% of the time, you'll figure out what's wrong in the
  process of doing it -- instant help!  2. If not, it gives people
  trying to help you out a small, simple example of the problem.
  --
  T.J. Crowder
  tj / crowder software / com

  On Dec 1, 5:51 am, Grant Newton [EMAIL PROTECTED] wrote:
  Thanks TJ

  An example of where I have it in use is:

         http://www.sydneycommunitycollege.com.au/courses/sport/dance

  And even after copy/paste of your code, I still get the error.

  Thanks

  Grant

  On 01/12/2008, at 4:35 PM, T.J. Crowder wrote:

  Hi Grant,

  You only need $() to extend elements that have not already been
  extended.  $$() extends the elements it returns[1].  Also, the only
  reason to call $() is if you're doing something with the return  
  value,
  which in the given code you're not.

  [1]http://prototypejs.org/api/utility/dollar

  Your code doesn't cause an error at my end in IE6 (and does hide the
  relevant bits), but again, you dont need the $() call, so you can do
  this instead:

  document.observe('dom:loaded', function() {
     $$('.blockbody').invoke('hide');
     $$('.hint').invoke('hide');
     $$('.reason').invoke('hide');
  });

  The problem must lie elsewhere.  Can you create a small, self-
  contained page that demonstrates the problem and poast it to Pastie?
  Along the way you may figure out the problem, and if not, it'll give
  the folks here something complete to help you with.

  HTH,
  --
  T.J. Crowder
  tj / crowder software / com

  On Dec 1, 12:33 am, grant [EMAIL PROTECTED] wrote:
  Hello all

  I am having a little trouble with IE6 and this snippet of code:

          document.observe('dom:loaded', function() {
                  $(
                          $$('.blockbody').invoke('hide'),
                          $$('.hint').invoke('hide'),
                          $$('.reason').invoke('hide')
                  );
          });

  I've done some searching to try and work out why I am receiving the
  error:

          Object doesn't support this property or method

  Wiki docs suggest wrapping with $(), though I don't think I have  
  done
  that 

[Proto-Scripty] opposite effects

2008-12-02 Thread Yaffle

Sorry for newbies question,
how opposite effects works?

if Effect.SlideDown and Effect.SlideUp was called for one element, why
call for Effect.SlideUp don't cancel ( stop ) Effect.SlideDown ?
Is there easy way to do it?

Thanks.


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



[Proto-Scripty] Re: slide effect problem

2008-12-02 Thread shafir

thanks,

but im not sure i understood

my javascript function looks like that:

function openClose(divId)
{
  new Effect.toggle(divId, 'Slide', {duration: 0.5});
}


my html looks like that:

table border=0 align=center cellpadding=0 cellspacing=0
trtdspan  onclick=openClose('advancedSearchBox')/span/td/
tr
tr
td align=center colspan=3
div style=display:none id=advancedSearchBox
 table border=0 align=center cellpadding=0 cellspacing=0
 trtd height=10/td/tr
 tr
   td valign=top
inside the td comes all the info i want to hid
   /td
 /tr
 /table
/div
/td
/tr
/table


i do not understand how to implement your suggestion

i will appreciate your help with that issue.

shafir m



On Dec 2, 3:37 pm, Walter Lee Davis [EMAIL PROTECTED] wrote:
 As you've found, setting the display property in a CSS sheet will not  
 work with the Scripty effects. Try hiding the things you want to hide  
 after the DOM loads. Set an empty class on all your to-be-hidden bits,  
 and then do this:

 document.observe('dom:loaded',function(){
         $$('.hideme').invoke('hide');

 });

 This will have everything hanging out there and visible from Google's  
 POV, but will hide it and prepare for your effect from everyone else  
 with a pulse and a JavaScript interpreter. Because you are doing it at  
 the dom:loaded point rather than the window.load point, there will be  
 no flash of unhidden content.

 Walter

 On Dec 2, 2008, at 2:27 AM, shafir wrote:





  hey,

  im using theslideeffect in my website and to do so im using on the
  div i want to slide the style=display:none i know that google do
  not index text that under this style, because of that im using a class
  name that have inside - 'display:none'.

  but then i noticed that theslideeffect doesnt work with the
  class :-(

  any suggestions?!?

  thanks, shafir.- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Something like namespaces problem

2008-12-02 Thread PROM

Thanks for the answer but I finally decided to reorganize the page and
now I just once load the modified script and another time load the
clean script

On Nov 26, 9:44 pm, Brian Williams [EMAIL PROTECTED] wrote:
 link to non-working sample or send the changed code please.

 On Wed, Nov 26, 2008 at 12:51 PM, PROM [EMAIL PROTECTED] wrote:

  Any ideas?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: slide effect problem

2008-12-02 Thread Walter Lee Davis

On Dec 2, 2008, at 12:15 PM, shafir wrote:

 div style=display:none id=advancedSearchBox

Change this to:

div class=hideme id=advancedSearchBox

Don't do anything special to define hideme in your CSS, or at least,  
don't do anything to define the visibility of that class.

Then somewhere in the head of your page after prototype loads, paste  
the following in a script block:

document.observe('dom:loaded',function(){
$$('.hideme}.invoke('hide');
);

That's the simplest way I can think of to do this. Anything that you  
mark on the page with the hideme class will disappear, and before the  
page even gets around to displaying in a browser.

Walter



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



[Proto-Scripty] Re: slide effect problem

2008-12-02 Thread Walter Lee Davis

Sorry, typo below:

On Dec 2, 2008, at 12:32 PM, Walter Lee Davis wrote:


 document.observe('dom:loaded',function(){
   $$('.hideme}.invoke('hide');
 );


document.observe('dom:loaded',function(){
$$('.hideme).invoke('hide');
);

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Very performant list filter

2008-12-02 Thread Matt Foster

By using the keyup event you can avoid the conditions to check for
change, if the user has pressed and released a key on the input then
the value has changed.  Also it is very wise to add the timeout, your
users will thank you.


document.observe(dom:loaded, function() {

  var list = $$(#listAll li);
  var lastValue = $F(filter);
  var timeout = false;

  $('filter').observe('keyup', function(e) {
 var value = this.value;
 clearTimeout(timeout);

  timeout = setTimeout(function(){
  list.each(function(ele){ filterElement(ele, value) });
  }, 500);
  })

})

On Dec 2, 9:11 am, Walter Lee Davis [EMAIL PROTECTED] wrote:
 On Dec 1, 2008, at 11:01 PM, kangax wrote:



  This behaves the way you would want it to -- so fast that the change
  doesn't register until the list starts getting very short.

  I think something along these lines could be faster:

  document.observe(dom:loaded, function() {

   var list = $$(#listAll li);
   var lastValue = $F(filter);

   $('filter').observe('keyup', function(e) {
     var value = this.value;
     if (value !== lastValue) {
       value = value.toLowerCase();
       list.each(function(el) {
         if (el.innerHTML.toLowerCase().include(value)) {
           Element.show(el);
         }
         else {
           Element.hide(el);
         }
       })
       lastValue = value;
     }
   })
  })

 Thanks very much, I'll give this a try. I can see where your shortcuts  
 are, and they make a lot of sense.

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



[Proto-Scripty] Re: slide effect problem

2008-12-02 Thread shafir mishal
thank u very much'
i'll try it and let u know

thanks again

On Tue, Dec 2, 2008 at 7:32 PM, Walter Lee Davis [EMAIL PROTECTED] wrote:


 On Dec 2, 2008, at 12:15 PM, shafir wrote:

  div style=display:none id=advancedSearchBox

 Change this to:

 div class=hideme id=advancedSearchBox

 Don't do anything special to define hideme in your CSS, or at least,
 don't do anything to define the visibility of that class.

 Then somewhere in the head of your page after prototype loads, paste
 the following in a script block:

 document.observe('dom:loaded',function(){
$$('.hideme}.invoke('hide');
 );

 That's the simplest way I can think of to do this. Anything that you
 mark on the page with the hideme class will disappear, and before the
 page even gets around to displaying in a browser.

 Walter



 



-- 
Shafir M

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: analogue clock?

2008-12-02 Thread geoffcox

This is beautifully done!

Cheers

Geoff

On Dec 2, 2:42 pm, Diodeus [EMAIL PROTECTED] wrote:
 This one's a classic and does it using native JavaScript.

 http://rainbow.arch.scriptmania.com/scripts/mouse_clock3.html

 On Dec 1, 5:55 pm, geoffcox [EMAIL PROTECTED] wrote:

  Hello,

  Is it possible to construct a javascript analogue clock using
  prototype/scriptaculous?

  In particular I want one where the speed of the hours/minutes/seconds
  hands can be increased/decreased.

  Cheers,

  Geoff
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Stop submit post to div

2008-12-02 Thread knal

Hi there,

I'm using  'Really Easy Field Validation' to handle my validation.
Now i wish to submit the form to a div with Ajax, therefore i need to
stop the original form submit and post it to contact.php 'in the
div'.
Then i'd like to return the contact.php page's response, e.g. 'Your
message has been sent!'

I seem to be unable to stop the submitting on if(result)
I know i can use a callback function, but Event.stop(ev) doesn't seem
to work.

I have the newest Prototype, Really Easy Field Validation and
Scriptaculous

My code looks like this:

 script language=javascript
var valid = new Validation('myForm', { immediate : false,
onFormValidate : HandleForm });

Validation.addAllThese([
['name', 'Custom name messae, 2 to 75 chars', { minLength : 2,
maxLength : 75, include : ['required validate-alphanum'] }],
['email', 'Custom email message', { minLength : 1, include :
['validate-email'] }],
]);

function HandleForm( result, form ){
if ( result ) {
new Ajax.Updater('contact', 'contact.php', 
{asynchronous:true,
evalScripts:true, parameters:Form.serialize(this)});
}
}
 /script

Thanks for any help,

Knal

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] double play with sound.js

2008-12-02 Thread Bill Walton
Greetings all!

I'm adding simple sounds (beep and burp) to a Rails app with sound.js.  I'm 
having a really wierd problem with it though.  I call Sound.play(good_sound) or 
Sound.play(bad_sound) depending on whether or not a search succeeds. First time 
it works correctly, playing the correct sound.  Second time, it plays the last 
sound, then the correct sound.  Works that way from then on. I'm logging the 
calls to Sound.play in FireFox and, according to the console, it's only getting 
called once per request/response.  But the sound's getting played twice.  I've 
scratched my head raw.  Any idea what I might be doing wrong?

Thanks in advance,
Bill

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---