[Proto-Scripty] Re: Pulse effect sometimes stopping on darkened version

2010-01-01 Thread evilC
Thanks for that walter. I played around and it seemed that even if you
queue pulstes, you can run into issues. The solution I found in the
end is instead of queueing pulsates, queue an opacity effect of 0.1
duration, from 1 to 1. Queueing the pulsate is annoying anyway, as if
you spam the link, it queues and goes on for ages.

Cheers anyway

On Dec 25 2009, 6:11 am, Walter Lee Davis wa...@wdstudio.com wrote:
 Identify assigns an ID to the element if none exists, and that ID will  
 persist until the page is done processing. Basically, it's a throw-
 away line to ensure that if the element that fired the event doesn't  
 have an ID, the rest of your code doesn't go sproing. You could just  
 as easily throw in an outer if(elm.id) test wrapped around the inner  
 parts.

 Queue works by allowing you to define as many different queues as you  
 like, and for each queue, stacking up the effects that are fired  
 within it so that they have to complete before another effect can  
 begin. By passing the ID of the element as the queue name, you give  
 each element its own stack of effects, keeping another effect from  
 messing with it and giving each effect time to complete fully.

 Walter

 On Dec 24, 2009, at 3:00 PM, evilC wrote:

  Thanks walter, though I am not sure I understand that code.
  if the identify command assigns and ID, it returns it, but the code
  throws it away then does a switch on the id on the next line.
  It also appears that maybe I missed something about how queue works if
  you are passing it the id of the element.
  I will have to look into it, thanks muchly for your input.

  On Dec 24, 4:16 pm, Walter Lee Davis wa...@wdstudio.com wrote:
  You might find it easier to set up queues if you don't use inline
  code. Create an observer in the head of your page, and then you can
  keep all your code in one place and integrate the effects so they are
  aware of each other's existence and state.

  document.observe('dom:loaded', function(){
          Element.addMethods({
                  attractAttention: function(obj){
                          new Effect.Pulsate(obj, { pulses: 3,  
  duration: 1, queue: this.id});
                  }
          });
          $('parentDiv').observe('mouseover',function(evt){
                  var elm = evt.element();
                  elm.identify(); //patch anything you didn't ID
                  switch(elm.id){
                          case 'foo':
                                  $('foo_target').attractAttention();
                          break;
                          case 'bar':
                                  $('bar_target').attractAttention();
                          break;
                          case 'baz':
                                  $('baz_target').attractAttention();
                          break;
                          default:
                          break;
                  }
          });

  });

  Hope this helps,

  Walter

  On Dec 24, 2009, at 2:19 AM, evilC wrote:

  As an afterthought, I guess it is by design.
  If you trigger it, it probably uses the current state as a starting
  point. I guess what is needed is a way to tell it to stop the  
  current
  animation if triggered again before it finishes, or ignore  
  subsequent
  requests until the current animation is complete.

  I tried queueing effects, but had no luck.

  --

  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 
  athttp://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 
  athttp://groups.google.com/group/prototype-scriptaculous?hl=en
  .

--

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




[Proto-Scripty] Re: Pulse effect sometimes stopping on darkened version

2009-12-24 Thread evilC
Thanks walter, though I am not sure I understand that code.
if the identify command assigns and ID, it returns it, but the code
throws it away then does a switch on the id on the next line.
It also appears that maybe I missed something about how queue works if
you are passing it the id of the element.
I will have to look into it, thanks muchly for your input.

On Dec 24, 4:16 pm, Walter Lee Davis wa...@wdstudio.com wrote:
 You might find it easier to set up queues if you don't use inline  
 code. Create an observer in the head of your page, and then you can  
 keep all your code in one place and integrate the effects so they are  
 aware of each other's existence and state.

 document.observe('dom:loaded', function(){
         Element.addMethods({
                 attractAttention: function(obj){
                         new Effect.Pulsate(obj, { pulses: 3, duration: 1, 
 queue: this.id});
                 }
         });
         $('parentDiv').observe('mouseover',function(evt){
                 var elm = evt.element();
                 elm.identify(); //patch anything you didn't ID
                 switch(elm.id){
                         case 'foo':
                                 $('foo_target').attractAttention();
                         break;
                         case 'bar':
                                 $('bar_target').attractAttention();
                         break;
                         case 'baz':
                                 $('baz_target').attractAttention();
                         break;
                         default:
                         break;
                 }
         });

 });

 Hope this helps,

 Walter

 On Dec 24, 2009, at 2:19 AM, evilC wrote:

  As an afterthought, I guess it is by design.
  If you trigger it, it probably uses the current state as a starting
  point. I guess what is needed is a way to tell it to stop the current
  animation if triggered again before it finishes, or ignore subsequent
  requests until the current animation is complete.

  I tried queueing effects, but had no luck.

  --

  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 
  athttp://groups.google.com/group/prototype-scriptaculous?hl=en
  .

--

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




[Proto-Scripty] Re: Pulse effect sometimes stopping on darkened version

2009-12-23 Thread evilC
Hmm.
'twas prototype that mis-identified, not me. It's a very simple
Prototype.browser.x check.
Whatever, I have changed it to a choice box now, so you dont have to
redirect.
Unfortunately, my site seems down at the moment, so I will have to
upload the new version.

On Dec 23, 12:26 pm, Walter Lee Davis wa...@wdstudio.com wrote:
 I'd love to help, but your browser detection scheme mis-identified my  
 Safari as Chrome, then redirected me to getfirefox.com. I already have  
 Firefox, thanks.

 Walter

 On Dec 22, 2009, at 3:48 PM, evilC wrote:

  I am using pulse effects in my app to highlight UI components on
  mouseover of some help text. Sometimes, however, the animation gets
  stuck or something and you are stuck with a greyed out DIV. Any ideas
  on what I may be doing wrong or how I may work around it?

 http://placebook.tv- hover the links in the instructions panel on the
  left repeatedly.

  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-scriptaculous@googlegroups.com
  .
  To unsubscribe from this group, send email to 
  prototype-scriptaculous+unsubscr...@googlegroups.com
  .
  For more options, visit this group 
  athttp://groups.google.com/group/prototype-scriptaculous?hl=en
  .

--

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




[Proto-Scripty] Re: Pulse effect sometimes stopping on darkened version

2009-12-23 Thread evilC
OK, I have largely fixed browser compatibility. I was using a firefox
method to get the window size and it was breaking things for everyone
else.
I have now removed the browser check, so you should be able to access
the site.

Tthanks!

On Dec 23, 3:09 pm, evilC ev...@evilc.com wrote:
 Hmm.
 'twas prototype that mis-identified, not me. It's a very simple
 Prototype.browser.x check.
 Whatever, I have changed it to a choice box now, so you dont have to
 redirect.
 Unfortunately, my site seems down at the moment, so I will have to
 upload the new version.

 On Dec 23, 12:26 pm, Walter Lee Davis wa...@wdstudio.com wrote:

  I'd love to help, but your browser detection scheme mis-identified my  
  Safari as Chrome, then redirected me to getfirefox.com. I already have  
  Firefox, thanks.

  Walter

  On Dec 22, 2009, at 3:48 PM, evilC wrote:

   I am using pulse effects in my app to highlight UI components on
   mouseover of some help text. Sometimes, however, the animation gets
   stuck or something and you are stuck with a greyed out DIV. Any ideas
   on what I may be doing wrong or how I may work around it?

  http://placebook.tv-hover the links in the instructions panel on the
   left repeatedly.

   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-scriptaculous@googlegroups.com
   .
   To unsubscribe from this group, send email to 
   prototype-scriptaculous+unsubscr...@googlegroups.com
   .
   For more options, visit this group 
   athttp://groups.google.com/group/prototype-scriptaculous?hl=en
   .

--

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




[Proto-Scripty] Re: Pulse effect sometimes stopping on darkened version

2009-12-23 Thread evilC
The app as a whole is complicated, but what is driving the effects
isnt.
It's simply html with a plain old link:

a [...] onmouseover=attractAttention
('pb_user_mylocs_button');link/a

and the attractAttention function is a one-liner:

function attractAttention(obj){
new Effect.Pulsate(obj, { pulses: 3, duration: 1});
}

Apart from the Click a Location Marker link, which also moves the
map etc.

Basically, for a demo, rollover just the last link (My Locations)
repeatedly.
As I said, that effectively executes one line:
new Effect.Pulsate($('pb_user_mylocs_button'), { pulses: 3, duration:
1});

It's clearly not my code. If you go to 
http://wiki.github.com/madrobby/scriptaculous/effect-pulsate
and click the demo repeatedly, you get the same problem.

On Dec 23, 8:54 pm, Walter Lee Davis wa...@wdstudio.com wrote:
 Can you make a cut-down example that shows only the trigger element  
 and the effect element? I tried looking at the source, and there's  
 just so much else going on in there that I don't know where to start.  
 Is that big lump of code in the middle (begins with unescape) what you  
 are using to drive any of these effects?

 Walter

 On Dec 22, 2009, at 3:48 PM, evilC wrote:

  I am using pulse effects in my app to highlight UI components on
  mouseover of some help text. Sometimes, however, the animation gets
  stuck or something and you are stuck with a greyed out DIV. Any ideas
  on what I may be doing wrong or how I may work around it?

 http://placebook.tv- hover the links in the instructions panel on the
  left repeatedly.

  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-scriptaculous@googlegroups.com
  .
  To unsubscribe from this group, send email to 
  prototype-scriptaculous+unsubscr...@googlegroups.com
  .
  For more options, visit this group 
  athttp://groups.google.com/group/prototype-scriptaculous?hl=en
  .

--

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




[Proto-Scripty] Re: Pulse effect sometimes stopping on darkened version

2009-12-23 Thread evilC
As an afterthought, I guess it is by design.
If you trigger it, it probably uses the current state as a starting
point. I guess what is needed is a way to tell it to stop the current
animation if triggered again before it finishes, or ignore subsequent
requests until the current animation is complete.

I tried queueing effects, but had no luck.

--

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] Pulse effect sometimes stopping on darkened version

2009-12-22 Thread evilC
I am using pulse effects in my app to highlight UI components on
mouseover of some help text. Sometimes, however, the animation gets
stuck or something and you are stuck with a greyed out DIV. Any ideas
on what I may be doing wrong or how I may work around it?

http://placebook.tv - hover the links in the instructions panel on the
left repeatedly.

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




[Proto-Scripty] Re: Ajax functions not working inside classes.

2009-12-07 Thread evilC
Great, that worked. I didn't realise this could be something else...

Also, bear in mind that I only started using prototype for this
project yesterday. Hell, I ripped it out and put it back in since I
made the first post - hence a lot of the code does not use prototype
properly (Though a search and replace for document.getElementsByID( to
$( is quick and easy...)

I have firebug installed already, though I have only ever used it for
CSS inspection, I will have to investigate how to use it to debug JS.

Many thanks for taking the time to download my code and help set me
straight. Now for another marathon coding session - hopefully I can
get line editing done tonight...

--

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




[Proto-Scripty] Re: Ajax functions not working inside classes.

2009-12-07 Thread evilC
The idea of Placebook is social networking for places. Sort of like if
you could have a facebook or twitter account for a place. People can
log in and add locations, then people can make posts on it's wall, or
add tags to the location to denote activies and social groups
associated with that place (eg a cafe may have a food tag and a tag
that linked to a book club that met there on tuesdays).
As my uni project I wish to develop basic functionality, but this is
something I will likely be persuing even I leave university, though
not really as a profit making venture, more as one of those things you
just want to use yourself ;)
Ultimately, I want to write a mobile interface (This may happen as a
uni project) and allow import / export of GPS trails, interfacing with
TomTom and other mobile navigation systems etc etc.
I managed to buy placebook.tv and placebook.mobi, so keep an eye out
there!

Thanks for the kind words

Clive

--

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




[Proto-Scripty] Re: Ajax functions not working inside classes.

2009-12-07 Thread evilC
For future reference,

document.observe('resize',winResize);

Never fires. Maybe because the document as a whole has not been
extended?

However,

Event.observe(window, 'resize', winResize);

worked fine.

--

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] Ajax functions not working inside classes.

2009-12-06 Thread evilC
The following code works:

new Ajax.Request('somefile.php',{
method:'get',
onSuccess: function(transport){
var response = transport.responseText || no response text;
alert(Success! \n\n + response);
},
onFailure: function(){
alert('Something went wrong...')
}
});

however, if you encapsulate the code inside a class:

var myclass = Class.create({
cut and paste exact same code into here
});

var thisclass = new myclass();
thisclass.submit();

The code ALWAYS comes back with an empty response when you encapsulate
the AJAX call :(

Any ideas what I am doing wrong? is prototype broken?

--

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




[Proto-Scripty] Re: Ajax functions not working inside classes.

2009-12-06 Thread evilC
Thanks TJ, I tried to make a self-contained version, so I ripped out
prototype and did the same thing with object literals, and I still had
issues, so clearly it wasnt prototype.
In the end I figured out that the button which fired off the AJAX
request (ie the Submit button) was inside a form (I did not want it
to actually do an HTTP POST submission of the form, just call JS code)
and I had not disabled the form with onsubmit='return false', so when
I clicked submit, it was submitting the form, thus destroying the
button that made the AJAX call before the reply came back.

I had noticed that putting an alert or delay into the script caused it
to work and was tearing my hair out - obviously the delay stopped the
button being destroyed long enough for the AJAX request to come back.

Oh the joys of Asynchronous web coding.

I now have a slightly different problem, with the same button...

Once the AJAX reply comes back that the data was updated, I want to
destroy the form. But it won't let me. I guess for a similar reason to
my explanation above - the button started the call, and it is in the
response code that I wish to destroy it, so it technically hasn't
finished yet. I hope that all makes sense. If not, I will try and rig
some self contained code using the system you linked - I guess for the
ajax request I could just get it to grab a css file or something off
the server?

--

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




[Proto-Scripty] Re: Ajax functions not working inside classes.

2009-12-06 Thread evilC
I have put up a version on my web server.

http://www.evilc.com/pb

The JS file is at http://www.evilc.com/pb/placebook.js - the code you
are interested in will be in the pb_editloc object near the end.
The HTML of the form is at 
http://www.evilc.com/pb/templates/pb_add_location.html
(the php grabs this and passes it to the JS in the templates[] array)

Here is how to replicate:

1. Click Add Location in the top right of the map window - This
calls pb_editloc.add
2. Click the Point radio button in the form that appears.

You are now in the form where the problem lies - with the submit/
cancel buttons at the bottom.

Click on the map to place a marker and type a name in the name box to
make the submit button light up. Once you click submit, it adds the
location to the back end database fine, but when it calls
pb_editloc.deleteform in the AJAX callback function (in
pb_editloc.submit), it fails.

Notice if you click Cancel, it kills the form fine. This ultimately
calls pb_editloc.deleteform just like submit does, but I am presuming
as there is no AJAX call still running that the button started, the
button can be deleted.

Thanks in advance for any 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.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.




[Proto-Scripty] Re: Ajax functions not working inside classes.

2009-12-06 Thread evilC
Just tried onComplete - no joy

I uploaded a copy to http://www.evilc.com/pb/pb.zip, should anyone be
so kind as to be inclined to take a look at it.

If you have a localhost LAMP server (I use XAMPP) with default sql
account of root/blank , it will work without any modifications -
just create a database called placebook and inject the sql from the
install folder. Else you may need to edit config.php if you have
different db settings.

--

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.