Re: [Proto-Scripty] Download

2011-12-30 Thread David Behler

Copy the code to a new text file and save it as prototype.js

Or instead of left-clicking the link, just right-click and select Save 
target (or whatever it is called in your browser/language).


David

Am 28.12.2011 00:46, schrieb Joey:

When i go to download the latest version of Prototypejs 1.7   it opens
a new browser window with code.

I am knew to this so bare with me.   but i thought it was supposed to
be a file template that i open with a web page developer..?

anyhelp would be 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-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] Textarea as a container

2011-11-22 Thread David Behler

From the top of my head and totally untested:

new Ajax.Request('http://url-you-want-to-request', {
onSuccess: function(transport) {
$('id-of-your-textarea').setValue(transport.responseText);
}
});

David

Am 22.11.2011 14:19, schrieb bill:

I tried using a textarea as the container for Ajax.updater without luck.
I presume I need to write the js to take the response and put it in 
the textarea, but the API just doesn't give me enough detail to use 
Ajax.request to do that.


The returned data is plain text.

A bit of assistance would be appreciated.
--
Bill Drescher
william {at} TechServSys {dot} com
--
You received this message because you are subscribed to the Google 
Groups Prototype  script.aculo.us group.
To post to this group, send email to 
prototype-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] Re: News Items List

2011-03-15 Thread David Behler

You might wanna try
document.observe();
instead of
document.observer();

David

Am 15.03.2011 10:34, schrieb PartisanEntity:

Sorry just to clarify:

Line 3 Char3 is the first line of your function. So it's the line
starting with: document.observer(.

On Mar 15, 10:04 am, PartisanEntitypartisanent...@gmail.com  wrote:

The link is currently behind a firewall so I can't post it. But here
is what IE says:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/
4.0; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; .NET CLR
3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR
3.5.30729; MS-RTC LM 8)
Timestamp: Tue, 15 Mar 2011 09:01:36 UTC

Message: Object doesn't support this property or method
Line: 3
Char: 3
Code: 0
URI:http://www.test.com/_includes/newseffect/slideeffect.js

On Mar 14, 5:46 pm, Walter Lee Daviswa...@wdstudio.com  wrote:

And you also loaded Prototype and Scriptaculous before that, in that  
order, right? Can you post a link? I have IE8 with a debugger enabled  
here on a VM, I could see if any errors suggest themselves.

Walter
On Mar 14, 2011, at 12:20 PM, PartisanEntity wrote:

The list is displayed in its entirety without animations.
It's almost as if the JavaScript it being ignored completely in IE8.
I pasted your JavaScript into a file which I called newslist.js.
I linked to it in the head section of my html file like so:
script type=text/javascript src=http://www.test.com/_includes/
newsbox/newslist.js/script
On Mar 14, 3:43 pm, Walter Lee Daviswa...@wdstudio.com  wrote:

No, but please define doesn't work. Does the animation fail, does the
text not change...?
Walter
On Mar 14, 2011, at 8:34 AM, PartisanEntity wrote:

Hi Walter,
Thanks so much for this. It is working perfectly.
There is only one issue I am having:
While it works in Firefox and Safari, I tried using IE8 and noticed
that it works on one computer, but not on another.
Do you have any experiences with this script and IE8, anything to
watch out for?
Thanks!
On Mar 12, 5:02 pm, Walter Lee Daviswa...@wdstudio.com  wrote:
Here's a cut-down version of the code generated by my NewsCycle  
plug-

in for Softpress Freeway.
document.observe('dom:loaded',function(){
 var newsSource = $('yourListId');
 var delayBetweenItems = 3;
 var effectSpeed = 0.6;
 var tag =  
newsSource.firstDescendant().tagName.toLowerCase();

 var data =
newsSource.select(tag).invoke('hide').pluck('innerHTML');
 var news = newsSource.down(tag).show();
 var index = 0;
 var newsCycle = function(){
 index = (++index= data.length ? 0 : index)
 new Effect.Fade(news,{
 delay:delayBetweenItems,
 duration:effectSpeed,
 afterFinish:function(){
 new Effect.BlindDown(news,{
 duration:effectSpeed,
 beforeStart:function(){
news.update(data[index]);
 },
 afterFinish:newsCycle
 });
 }
 });
 };
 newsCycle();
});
You need prototype and scriptaculous effects in the page first,
obviously, and you need to fill in the id of your list. My plug-in
has
extra code to make it list agnostic, so you could simplify this a
lot if you knew that your effect was only ever being applied to a
list. You could also use this as written on a DIV with a bunch of P
tags in it, or a DIV with a bunch of DIVs in it -- there's no end  
to

the possible combinations.
Walter
On Mar 11, 2011, at 11:35 AM, PartisanEntity wrote:

Hi all,
I am relatively new to scriptaculous and would like to know if the
following is possible.
I would like to create a list of news items on my website.
Instead of showing all items in myul  list, I would like for  
each

item to appear using the slide down effect, then for it to
disappear
and for the next item to appear by sliding down.
Is this possible?
Has this been done before, perhaps there is some code I could copy
as
I have no idea how to build something like this.
Thank you very much for you time and effort.
--
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 

Re: [Proto-Scripty] Selector onchange

2010-12-20 Thread David Behler

Try this instead:

$('pagePageSelector').observe('change', function(event) { alert('ding'); });

Am 20.12.2010 21:25, schrieb kstubs:
$('pagePageSelector').observe('onchange', function(event) { 
alert('ding'); });


--
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: Preventing Autocompleter

2010-07-05 Thread David Behler
 I don't think there is a built-in functionaltity for that. But you 
could edit the autocompleter class and add the check yourself right 
before the request is done.


David

Am 05.07.2010 18:54, schrieb infringer:

No takers?  I guess there is no way to do this?

On Jul 1, 6:51 pm, infringerinfrin...@gmail.com  wrote:

I have an autocompleter on a City field.  But I don't want it to send
the request UNLESS the state field is filled in?

Any suggestions on how to prevent it from sending the request?  No
need for the unnecessary requests going back and forth.

Thanks,
-David


--
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 JSON Request with Flickr URL response don't work in Firefox

2010-06-24 Thread David Behler

Hi Nahum,

as far as I know Firefox does not allow for cross-domain AJAX requests.

What you could to is to request a php file on your server and that php 
file does the call to the Flickr API.


David

Am 24.06.2010 19:47, schrieb ncubica:

Hi every body I have a weird issue I been working with the Flickr API,
in Flickr for make a connection with the server is through url format
in my case something like this

http://api.flickr.com/services/rest/?method=flickr.photosets.getListapi_key=10cb3dccaa050efebdc01540c1d4d227user_id=51390...@n07format=json

If your run into any browser you are going to get a flickr function
and is ok, but Im trying to obtain with Ajax Im doing something like

 new Ajax.Request('http://api.flickr.com/services/rest/?
method=flickr.photosets.getListapi_key=10cb3dccaa050efebdc01540c1d4d227user_id=51390...@n07format=json',
   {
 method:'get',
 onSuccess: function(transport){
 debugger;
   var response = transport.responseText || no response text;
   alert(Success! \n\n + response);
 },
 onFailure: function(){ alert('Something went wrong...') }
   });

And is working good in IE the response have what you can see in the
url of flickr but in Firefox I dont know why Im getting in the
responseText a blank string . does any have any clue what am I doing
wrong?

Thanks
Nahum

   


--
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: Cloning/moving an element!?

2010-06-21 Thread David Behler

Hi,

thansk for the explantation. Makes sense now.

I totally forgot about the new API docs and only looked at the old docs 
(http://www.prototypejs.org/api/element) where the method wasn't around yet.


David

Am 21.06.2010 08:37, schrieb T.J. Crowder:

Hi,

For cloning, there's always Element#clone[1]. That clones the node
using the underlying DOM cloneNode function, and also handles anything
Prototype might have stored on the node.

   

Apart from cloning an element I also needed to move an element from
one div to another and I came up with this function...
[snip]
I don't like the switch part very much and tried to use the position
variable directly but that somehow didn't work...anyone knows why?
[snip]
 newParent.insert({position: element});
 

Because that creates a property called position on the options
object, exactly the way your earlier code

   

 newParent.insert({top: element});
 

...creates a property called top on the options object. The left-
hand side of a property initializer (and for that matter an
assignment) is used as the name of the property (or variable) to
create, not as a variable _containing_ the name of the property/
variable.

It is possible to do what you want, though:

 Element.addMethods({
 appendTo: function(element, newParent, position) {
 var options;
 element = $(element);
 newParent = $(newParent);
 options = {};
 options[position] = element;
 newParent.insert(options);
 return element;
 }});

...because the bracketed notation for property access uses strings for
property names, and lets you get the property name string from a
variable.

[1] http://api.prototypejs.org/dom/element/clone/

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


On Jun 20, 11:48 pm, David Behlerd.beh...@gmail.com  wrote:
   

Hi guys,

while looking for a way to clone an element, I stumbled upon this
thread from 2007:

http://groups.google.com/group/prototype-core/browse_thread/thread/9e...

Any chance this is some when gonna end up in the core? I think this is
function might be pretty useful sometimes.

Apart from cloning an element I also needed to move an element from
one div to another and I came up with this function which is basically
a wrapper for the insert() function:

Element.addMethods({
 appendTo: function(element, newParent, position) {
 element = $(element);
 newParent = $(newParent);
 switch(position) {
 case 'top':
 newParent.insert({top: element});
 break;
 case 'bottom':
 newParent.insert({bottom: element});
 break;
 case 'before':
 newParent.insert({before: element});
 break;
 case 'after':
 newParent.insert({after: element});
 break;
 }
 return element;
 }

});

I don't like the switch part very much and tried to use the position
variable directly but that somehow didn't work...anyone knows why?

Element.addMethods({
 appendTo: function(element, newParent, position) {
 element = $(element);
 newParent = $(newParent);
 newParent.insert({position: element});
 return element;
 }});

$('test').appendTo('test2', 'top');

Using this function Firebug shows this error: insert is not a
function.

Anyway, maybe someone else finds this useful aswell :)

David
 
   


--
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] Cloning/moving an element!?

2010-06-20 Thread David Behler
Hi guys,

while looking for a way to clone an element, I stumbled upon this
thread from 2007:

http://groups.google.com/group/prototype-core/browse_thread/thread/9e943e4b54780d97

Any chance this is some when gonna end up in the core? I think this is
function might be pretty useful sometimes.

Apart from cloning an element I also needed to move an element from
one div to another and I came up with this function which is basically
a wrapper for the insert() function:

Element.addMethods({
appendTo: function(element, newParent, position) {
element = $(element);
newParent = $(newParent);
switch(position) {
case 'top':
newParent.insert({top: element});
break;
case 'bottom':
newParent.insert({bottom: element});
break;
case 'before':
newParent.insert({before: element});
break;
case 'after':
newParent.insert({after: element});
break;
}
return element;
}
});

I don't like the switch part very much and tried to use the position
variable directly but that somehow didn't work...anyone knows why?

Element.addMethods({
appendTo: function(element, newParent, position) {
element = $(element);
newParent = $(newParent);
newParent.insert({position: element});
return element;
}
});
$('test').appendTo('test2', 'top');

Using this function Firebug shows this error: insert is not a
function.

Anyway, maybe someone else finds this useful aswell :)

David

-- 
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.Updater not working in IE, works fine in FF Chrome and Safari

2010-03-16 Thread David Behler

Hey folks,
maybe you can help me out with this.

I got a simple function that I use to load sub-categories when clicking 
on a parent category:


function toggleSubCats(cat, id)
{
/* Vars and stuff */
catObj = $(cat);
var send=null;

/* Now figure out the status of the element and open or close based 
on what's found */

if( catObj.getStyle('display') == 'none') {
catObj.setStyle({display : 'block'});
} else {
catObj.setStyle({display : 'none'});
return;
}

/* Let's first dump a loading image in the target div then send the 
AJAX request */

catObj.update(img src=' + base_images + loading_small.gif' /);
var url= base + 'galleryback/showSubCat/'+id;

new Ajax.Updater(catObj,url);

/* Alternative to Ajax.Updater() call
new Ajax.Request(url, {
method: 'get',
onSuccess: function(transport) {
$(cat).update(transport.responseText);
}
});
*/
}

All it's supposed to do,  is to get the element (in this case a div) 
with the id submitted in the cat parameter and display/hide it. If 
display is set to block, then an loading image is shown and ajax.updater 
is called to load the sub-categories to the higher category (id parameter).


This works fine in FF3.6, Chrome and Safari, but in IE8 the loading 
image is not replaced with the loaded sub-categories. If I replace the 
Ajax.Updater call with an Ajax.Request call (see commented section below 
Ajax.Updater) it does not work either in IE8, but I can alert the 
responseText and the catObj.update() does not raise an error, it just 
doesn't have any effect.


Not sure this is important but here is another info that might help you 
solving this:
On intital loading of the page I display only the top categories, 
clicking on one of them calls the above shown function and displays the 
child categories. But clicking on one of the loaded child categories, 
it's where the problem starts and it does not work anymore in IE8. Do 
you think it's some weird problem caused by adding elements after the 
DOM was loaded?


I really hope you can help me with this!

Thanks in advance,

David

--
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.Updater not working in IE, works fine in FF Chrome and Safari

2010-03-16 Thread David Behler

Hi,
thanks for the quick answer.

1. I did not do that intentionally, it's some code I inherited from the 
former coder. I fixed that and now declare the variable inside the 
function, thanks for pointing it out.


2. As far as I can tell, there is no namespace conflict, the div has the 
id 'cat_1' and there is no other element with that id or name.


The strange thing is, that the update works the first time when the 
loading image is displayed:

catObj.update(img src=' + base_images + loading_small.gif' /);

Any other ideas?

David


Am 16.03.2010 12:37, schrieb T.J. Crowder:

Hi,

   

Do
you think it's some weird problem caused by adding elements after the
DOM was loaded?
 

No, people do that all the time.

I'm not immediately seeing the problem, I think it's probably in the
markup or code outside what you quoted. But some things to look for:

1. Unless you're intentionally using `catObj` as a global, you'll want
to declare it in the function (there's no `var` that I see). Otherwise
it becomes an implicit global, which is so high on my list of Bad
Things(tm) I blogged about it[1] (which I don't often do).

2. IE has issues with conflating the namespaces of the `id` and `name`
attributes, which should be separate. I see you're using IDs for the
things to show/hide (perfectly normal, that). Is there *anything* on
your page that has _either_ an `id` or a `name` with the value you're
providing to `toggleSubCats` other than the element you're trying to
show/hide? For instance, if you have a 'stuff' input field:

 input name='stuff' type='text'

and then later in the document a 'stuff' div:

 div id='stuff'/div

...on IE, document.getElementById('stuff') will get you the input
field element rather than the div, despite that being perfectly valid
HTML markup. It's wrong, but that's the way it is, so it's worth
looking whether that might be an issue.

[1] http://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html

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


On Mar 15, 11:28 pm, David Behlerd.beh...@gmail.com  wrote:
   

Hey folks,
maybe you can help me out with this.

I got a simple function that I use to load sub-categories when clicking
on a parent category:

function toggleSubCats(cat, id)
{
  /* Vars and stuff */
  catObj = $(cat);
  var send=null;

  /* Now figure out the status of the element and open or close based
on what's found */
  if( catObj.getStyle('display') == 'none') {
  catObj.setStyle({display : 'block'});
  } else {
  catObj.setStyle({display : 'none'});
  return;
  }

  /* Let's first dump a loading image in the target div then send the
AJAX request */
  catObj.update(img src=' + base_images + loading_small.gif' /);
  var url= base + 'galleryback/showSubCat/'+id;

  new Ajax.Updater(catObj,url);

  /* Alternative to Ajax.Updater() call
  new Ajax.Request(url, {
  method: 'get',
  onSuccess: function(transport) {
  $(cat).update(transport.responseText);
  }
  });
*/

}

All it's supposed to do,  is to get the element (in this case a div)
with the id submitted in the cat parameter and display/hide it. If
display is set to block, then an loading image is shown and ajax.updater
is called to load the sub-categories to the higher category (id parameter).

This works fine in FF3.6, Chrome and Safari, but in IE8 the loading
image is not replaced with the loaded sub-categories. If I replace the
Ajax.Updater call with an Ajax.Request call (see commented section below
Ajax.Updater) it does not work either in IE8, but I can alert the
responseText and the catObj.update() does not raise an error, it just
doesn't have any effect.

Not sure this is important but here is another info that might help you
solving this:
On intital loading of the page I display only the top categories,
clicking on one of them calls the above shown function and displays the
child categories. But clicking on one of the loaded child categories,
it's where the problem starts and it does not work anymore in IE8. Do
you think it's some weird problem caused by adding elements after the
DOM was loaded?

I really hope you can help me with this!

Thanks in advance,

David
 
   


--
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.Updater not working in IE, works fine in FF Chrome and Safari

2010-03-16 Thread David Behler

Hi,

I tried some more stuff and it's getting stranger and stranger:

Using the Ajax.Request approach, it still does not work calling

`$(cat).update(transport.responseText);`

But calling this

`$(cat).update('test');`

actually works and replaces the loading image with the string 'test'.

The returned responseText is a table with multiple rows and columns 
inside a div. The responseText was no valid html, but even after fixing 
that it does not work.


I have neither Visual Studio nor InterDev, all I can use to debug 
javascript in IE8 are the built in Developer Tools and stepping through 
it looks fine to me.


David


Am 16.03.2010 15:25, schrieb T.J. Crowder:

Hi,

   

Any other ideas?
 

 From what you're saying, you've already verified (in your version
using Ajax.Request) that:

1. `onSuccess` is getting triggered

2. The `response.responseText` has the correct markup

3. That `catObj.update(img ... /)` works (`catObj` having been set
via `catObj = $(cat);`)

4. But the `$(cat).update(response.responseText);` within `onSuccess`
doesn't work.

With the quoted code, I don't see how all four of those statements can
be true; I'd recommend double-checking (sorry! I know!). If they
really are, you'll have to walk through it with Visual Studio or
InterDev to see what's going wrong in the update call.

Very strange!

Good luck,
--
T.J. Crowder
Independent Software Consultant
tj / crowder software / com
www.crowdersoftware.com


On Mar 16, 11:53 am, David Behlerd.beh...@gmail.com  wrote:
   

Hi,
thanks for the quick answer.

1. I did not do that intentionally, it's some code I inherited from the
former coder. I fixed that and now declare the variable inside the
function, thanks for pointing it out.

2. As far as I can tell, there is no namespace conflict, the div has the
id 'cat_1' and there is no other element with that id or name.

The strange thing is, that the update works the first time when the
loading image is displayed:
catObj.update(img src=' + base_images + loading_small.gif' /);

Any other ideas?

David

Am 16.03.2010 12:37, schrieb T.J. Crowder:



 

Hi,
   
 

Do
you think it's some weird problem caused by adding elements after the
DOM was loaded?
 
 

No, people do that all the time.
   
 

I'm not immediately seeing the problem, I think it's probably in the
markup or code outside what you quoted. But some things to look for:
   
 

1. Unless you're intentionally using `catObj` as a global, you'll want
to declare it in the function (there's no `var` that I see). Otherwise
it becomes an implicit global, which is so high on my list of Bad
Things(tm) I blogged about it[1] (which I don't often do).
   
 

2. IE has issues with conflating the namespaces of the `id` and `name`
attributes, which should be separate. I see you're using IDs for the
things to show/hide (perfectly normal, that). Is there *anything* on
your page that has _either_ an `id` or a `name` with the value you're
providing to `toggleSubCats` other than the element you're trying to
show/hide? For instance, if you have a 'stuff' input field:
   
 

  input name='stuff' type='text'
   
 

and then later in the document a 'stuff' div:
   
 

  div id='stuff'/div
   
 

...on IE, document.getElementById('stuff') will get you the input
field element rather than the div, despite that being perfectly valid
HTML markup. It's wrong, but that's the way it is, so it's worth
looking whether that might be an issue.
   
 

[1]http://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html
   
 

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

On Mar 15, 11:28 pm, David Behlerd.beh...@gmail.comwrote:
   
 

Hey folks,
maybe you can help me out with this.
 
 

I got a simple function that I use to load sub-categories when clicking
on a parent category:
 
 

function toggleSubCats(cat, id)
{
   /* Vars and stuff */
   catObj = $(cat);
   var send=null;
 
 

   /* Now figure out the status of the element and open or close based
on what's found */
   if( catObj.getStyle('display') == 'none') {
   catObj.setStyle({display : 'block'});
   } else {
   catObj.setStyle({display : 'none'});
   return;
   }
 
 

   /* Let's first dump a loading image in the target div then send the
AJAX request */
   catObj.update(img src=' + base_images + loading_small.gif' /);
   var url= base + 'galleryback/showSubCat/'+id;
 
 

   new Ajax.Updater(catObj,url);
 
 

   /* Alternative to Ajax.Updater() call
   new Ajax.Request(url, {
   method: 'get',
   onSuccess: function(transport) {
   $(cat).update(transport.responseText);
   }
   });
*/
 
 

}
 
 

All it's 

[Proto-Scripty] Ajax.Updater not working in IE, works fine in FF Chrome and Safari

2010-03-15 Thread David Behler

Hey folks,
maybe you can help me out with this.

I got a simple function that I use to load sub-categories when clicking 
on a parent category:


function toggleSubCats(cat, id)
{
/* Vars and stuff */
catObj = $(cat);
var send=null;

/* Now figure out the status of the element and open or close based 
on what's found */

if( catObj.getStyle('display') == 'none') {
catObj.setStyle({display : 'block'});
} else {
catObj.setStyle({display : 'none'});
return;
}

/* Let's first dump a loading image in the target div then send the 
AJAX request */

catObj.update(img src=' + base_images + loading_small.gif' /);
var url= base + 'galleryback/showSubCat/'+id;

new Ajax.Updater(catObj,url);

/* Alternative to Ajax.Updater() call
new Ajax.Request(url, {
method: 'get',
onSuccess: function(transport) {
$(cat).update(transport.responseText);
}
});
*/
}

All it's supposed to do,  is to get the element (in this case a div) 
with the id submitted in the cat parameter and display/hide it. If 
display is set to block, then an loading image is shown and ajax.updater 
is called to load the sub-categories to the higher category (id parameter).


This works fine in FF3.6, Chrome and Safari, but in IE8 the loading 
image is not replaced with the loaded sub-categories. If I replace the 
Ajax.Updater call with an Ajax.Request call (see commented section below 
Ajax.Updater) it does not work either in IE8, but I can alert the 
responseText and the catObj.update() does not raise an error, it just 
doesn't have any effect.


Not sure this is important but here is another info that might help you 
solving this:
On intital loading of the page I display only the top categories, 
clicking on one of them calls the above shown function and displays the 
child categories. But clicking on one of the loaded child categories, 
it's where the problem starts and it does not work anymore in IE8. Do 
you think it's some weird problem caused by adding elements after the 
DOM was loaded?


I really hope you can help me with this!

Thanks in advance,

David

--
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] Only fire event once on mouseover

2010-02-17 Thread David Behler
Try onmouseenter instead. It should only fire when the mouse enters the 
element.


David

Am 17.02.2010 22:40, schrieb louis w:

Refer to the link below. I have a dropdown html element which has an
event observer looking for mouseover. It's working, but it
continuously fires mouseover events while you are mousing over the
other elements inside it. I am guessing this is because of bubbling.

Is there a way to only make it fire the event on the initial
mouseover? I want it to do an Effect and this is breaking the effect.
I am sure it's just something basic I am not doing.

Thanks for the help.

http://tinyurl.com/y88rcrz (open firebug)

   


--
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: Delete php

2009-07-20 Thread David Behler

Alex McAuley schrieb:
 Dude, firstly please stop topping the message and removing the code 
 and replies from your replies.
  
 secondly: try the below script and see what gets alerted (it should be 
 your numeric ID, if not then you have something wrong somewhere
  

 $('clones').observe('click',function(evt){

   var elm = evt.element();

   if (elm.hasClassName('remove')){

 evt.stop();

  

 var id = elm.id.split('_').last();



 alert(id);

 return;

 new Ajax.Request('remove_clone.php',{

   parameters:{clone:id},

   onSuccess:function(transport){

 elm.up('li').remove();

 pollSortable.defer();

   }

 });

 - Original Message -
 *From:* Yan Kovyakh mailto:maybe...@gmail.com
 *To:* prototype-scriptaculous@googlegroups.com
 mailto:prototype-scriptaculous@googlegroups.com
 *Sent:* Monday, July 20, 2009 7:35 PM
 *Subject:* [Proto-Scripty] Delete php

 They actualy have Item_numericalID

 Is this the problem?



 
I don't wanna advertise my works, but maybe you should try a different 
approach. I think it's cumbersome to get a numerical id of a database 
objects (that's what it is, right?) from an elements id by splitting it.
Maybe you should try my Deletr library, I guess it does pretty much what 
you need: Delete a row from a table and perform an ajax request to 
delete the row from the database.

Have a look at my post, maybe this is a solution for you:
http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/4fd6aab8f12aea95/07cbd61264f08a7a

Demo and download links can be found there.

Regards,
David

--~--~-~--~~~---~--~~
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] Re: problems with observe mouseover and mouseout

2009-07-17 Thread David Behler

Try this:
http://www.prototypejs.org/api/event/findElement

$$(.superlist li).invoke(observe, mouseover, function(event) {
alert(|Event.findElement(event, 'li')|.inspect().escapeHTML()
|);
|});

That should return the li element instead of a div.

David



 Hello everyone.

 I've basically got this HTML code:

 ul class=superlist
   li class=foo id=bar
 div class=foobarsome content/div
 div class=contentsome more content/div
 div class=actionssome actions/div
   /li
 /ul

 and this JS code:

 $$(.superlist li).invoke(observe, mouseover, function(event) {
 alert(event.element().inspect().escapeHTML());
 });

 So now the thing is, that the event.element() method does NOT (as I
 would expect) return the li element, but any of the nested elements
 instead. Which might be a div class=foobar or a div
 class=content.

 That results in two problems for me:
 1. I want to toggle the visibility of li.actions for the li hovered.
 It shall become visible on mouseover and unvisible on mouseout. That
 doesn't work since anytime I move over one of the li's nested
 elements, the mouse-events get triggered. Although (from my point of
 view) I'm never leaving that element, since they are indeed children
 of the li.

 2. (similar to the first one) I do always need to know which li
 element was hovered (so that I can determine which .actions div shall
 be toggled but don't know any good way to achieve this.

 I've run through similar problems like this several times but could
 never find a good solution.
 Hope anyone here can help me out :-)

 

   


--~--~-~--~~~---~--~~
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] Re: Any way to access class attributes when using 'each' to iterate over an array?

2009-07-08 Thread David Behler

Thanks alot! That worked!

I already guessed it had something to do with the context but didn't
know how to change it...
--~--~-~--~~~---~--~~
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] Re: Animated Ajax Record Deletion

2009-07-08 Thread David Behler

Thanks! That worked!

I'm still a beginner and trying to really get into Prototype...good to
know people here are willing to 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-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] Re: process further

2009-07-08 Thread David Behler

I guess you would have to use Ajax.Request to process the returned
value before updating the designated element.

But I'm beginner and could be wrong here.
--~--~-~--~~~---~--~~
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] Animated Ajax Record Deletion

2009-07-07 Thread David Behler

Some time ago I came across the blog of David Walsh and his article on
Animated Ajax Record Deletion Using MooTools (http://davidwalsh.name/
animated-ajax-record-deletion-mootools). Sadly he uses MooTools and
not Prototype. But as I'm more and more trying to create my own
classes based on Prototype I wanted to create this functionality
myself!

And now it's done: Deletr is born!

A demo can be viewed here: http://www.davidbehler.de/projects/deletr
You can download it from here: http://www.davidbehler.de/index.php/file/view/8

I would really like to know what you guys think of this!

You might notice this:
   if(!element.match('a')) {
  element = element.ancestors()[0];
   }
I did this in case it's not a link you click on but an image that's
wrapped in a link, e.g. a href=test.phpimg src=test.png //a
In this case var element = Event.findElement(ev); seems to return the
image and not the link. Any other way to fix this?

Greetz
Davd
--~--~-~--~~~---~--~~
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] Any way to access class attributes when using 'each' to iterate over an array?

2009-07-07 Thread David Behler

Why does this work:
var Deletr = Class.create({
initialize: function(options) {
var list = new Array();
$$('a.deletr').each(function(element) {
list.push(element);
});
}
});

But this does not?
var Deletr = Class.create({
initialize: function(options) {
this.list = new Array();
$$('a.deletr').each(function(element) {
this.list.push(element);
});
}
});

Firebug reports:
this.list is undefined
this.list.push(element);

Is there a way to access class attributes when I'm using each to
iterate over an array?
That would be really helpful!

Thanks
David
--~--~-~--~~~---~--~~
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] Layr - Handy class for controlling the status of elements dependant on values of form inputs

2009-07-05 Thread David Behler

Hey folks,
I think I got something for ya!

My newest projects had some quite huge forms with multiple inputs/
elements that needed to be hidden/disabled depending on values of
other inputs.

I did not want to add custom js to each onChange element whose value
might influence the visibility/status of another element. Therefore I
came up with a class that handles these dependecies quite easily:
Layr.

All you need to do is include the .js file and add something like this
to your website:
Event.observe(window, 'load',function(){ list.add('controllerInput',
'3', '!=', 'test', 'hidden'); }, false);

This provokes the following: If the change event of the element with
the id 'controllerInput' is invoked, it will be checked wether its
value equals 3 or not. If it does not equal 3, the element with the id
'test' will be hidden. If the condition is no longer met, the element
with the id 'test' will be reset to being visible and enabled, every
additional class that was added by Layr will be removed if the
condition that added the class is no longer met.

You can get the class from GitHub, I added a gist with the source
code: https://gist.github.com/91300492f82f2f399001
A simple example can be viewed here: http://davidbehler.de/projects/layr/
Try entering the numbers 1, 2 or 3 in the first input.

Please tell me if there is anything similar out there...I don't want
to reinvent the wheel ;)

I hope there is someone except me out there that might find this
handy.

Feel free to post comments and critics ... I really wanna know what
you think of this.

P.S.: This is my first post in this group, so please be gentle ;)


Thanks,
David

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