[Proto-Scripty] Try.these deprecated?

2011-06-30 Thread Rick Witter
According to the documentation Try.these has been deprecated.  Is this
right?  It's still being used in the Ajax class.

The change was in this checkin:

https://github.com/sstephenson/prototype/commit/f12b83ef236a54306c7f686ae4c1c45910e2fc57#src/lang.js

rick

-- 
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: How to create a new DOM-element from a string?

2010-12-07 Thread Rick . Wellman
Is it just me,... I don't understand what you're even asking/trying to 
accomplish?
What kind of DOM object are you hoping to create?  Call it a potayto, or a 
potahto but any element you insert the HTML into is a wrapper.  

Apologies if this seems terse but I truly do not understand your question/goal.

-Original Message-
From: prototype-scriptaculous@googlegroups.com 
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Luke
Sent: Tuesday, December 07, 2010 9:59 AM
To: Prototype  script.aculo.us
Subject: [Proto-Scripty] Re: How to create a new DOM-element from a string?

Hm ok, hoped there would be a way I could generate a DOM object that
consists of just the HTML (without wrapper) and before I insert it.

On Dec 7, 4:52 pm, Walter Lee Davis wa...@wdstudio.com wrote:
 That's because I called innerHTML on it at the end, and that returns a  
 string. If you then want to create a new element out of that, you  
 could try inserting it into your page somewhere with

 $('someElementOnYourPage').insert({after: foo});

 Of you could just leave the innerHTML part off the end, which would  
 leave foo populated with the outer wrapper object created by new  
 Element...

 Walter

 On Dec 7, 2010, at 3:20 AM, Luke wrote:



  Hmm, damn. the returned value is still a string :(

  On Dec 7, 9:16 am, Luke kickingje...@gmail.com wrote:
  Thanks Walter!

  On Dec 6, 6:28 pm, Walter Lee Davis wa...@wdstudio.com wrote:

  On Dec 6, 2010, at 12:12 PM, Walter Lee Davis wrote:

  It's OT for this list, but have a look at Prototype.js. You can
  create a new DOM element in memory, and do all the things you want
  to it without ever showing it to the user.

  Sorry, this was completely bone-headed of me -- I thought I was on
  another list.

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

-- 
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: can't get queues to work right

2010-09-01 Thread Rick . Wellman
Glad you got it working but FWIW,
Your understanding of the queues seems to be ok but something must be lost in 
the translation... is the Appear beginning *before* the Fade finishes if you 
use the queue?  Your original message states that it Fades (and I read that to 
mean that the Fade completes) and then Appears.  Unless something has changed 
in the library, afterFinish is fine but the queues were written for exactly 
this case.

-Original Message-
From: prototype-scriptaculous@googlegroups.com 
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Raphael75
Sent: Wednesday, September 01, 2010 8:43 AM
To: Prototype  script.aculo.us
Subject: [Proto-Scripty] Re: can't get queues to work right

Thank you. I thought about trying that but I thought the queue was
supposed to do the same thing. It's ok, you solved it. :)

On Sep 1, 8:56 am, Peter De Berdt peter.de.be...@pandora.be wrote:
 On 01 Sep 2010, at 14:34, Raphael75 wrote:

  But isn't the queue supposed to handle that? I inserted the Fade first
  (queue: 'front') and then the Appear (queue: 'end'). Isn't that right?
  Or is there some other way to have the Appear wait to start until the
  Fade is finished?

 Use the afterFinish callback like so:

 var olstext = $('olstext');
 olstext.fade({duration: 0.35, afterFinish: function()  
 { olstext.update(Some new text); olstext.appear({duration: 0.5}); }});

 Best regards

 Peter De Berdt

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

-- 
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] invoke method update

2010-08-25 Thread Rick . Wellman
This is weird... when FF renders this HTML for me it is putting the divs
inside each other like the following.  I have never seen this behavior
before (but explains why the code is working like it is):
div id=OUT
div class=out out1
div class=out out2
...
/div
/div
/div

-Original Message-
From: prototype-scriptaculous@googlegroups.com
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of kstubs
Sent: Wednesday, August 25, 2010 12:48 PM
To: Prototype  script.aculo.us
Subject: [Proto-Scripty] invoke method update

I'd expect all div.out containers to be updated with the value
testing, but just getting the first one.  What is wrong with the
following code?

Expected:
testing
testing
testing
testing

Actual:
testing

The code:
ul
libutton onclick=$
('OUT').select('div.out').invoke('update','testing');Test/button/
li
/ul
div id=OUT
div class=out out1/
div class=out out2/
div class=out out3/
div class=out out4/
/div

-- 
You received this message because you are subscribed to the Google
Groups Prototype  script.aculo.us group.
To post to this group, send email to
prototype-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.

-- 
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] Morph and setTimeout

2010-07-20 Thread Rick . Wellman
I'm pretty sure Ralph's suggestion will work.  I prefer to write this in a way 
which will hopefully highlight the potential bug to a less-experienced 
maintenance developer after I have moved onto a 6-digit consulting career that 
I run two-hours a day from the Bahamas (boy, sure hope my idea works or that 
consulting career is a pipe-dream):

var elid = 'masinfo' + id;
setTimeout($(elid).show(),500,id);

-Original Message-
From: prototype-scriptaculous@googlegroups.com 
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Ralph Brickley
Sent: Tuesday, July 20, 2010 3:04 PM
To: prototype-scriptaculous@googlegroups.com
Subject: Re: [Proto-Scripty] Morph and setTimeout

JavaScript doesn't know what the +id is because it's within the double quotes. 

Do this instead 

 setTimeout($('masinfo'+id+).show(),500,id);
 }

Sent from my iPhone

On Jul 20, 2010, at 12:59 PM, Martín Marqués martin.marq...@gmail.com wrote:

 I'm trying to mix Effect.Morph and setTimeout() to enlarge a div and
 after the div finishes enlargening another div inside it appears (this
 is where I use setTimeout()). The problema is that I get a error and
 can't find out why.
 
 Here is the code:
 
 function expandir(id,newh){
new Effect.Morph('cont'+id, {
style: 'height:'+newh+'px;', // CSS Properties
duration: 0.5 // Core Effect properties
});
 
setTimeout($('masinfo'+id).show(),500,id);
 }
 
 Here it says that id is not defined in the setTimeout line.
 
 Any ideas?
 
 -- 
 Martín Marqués
 select 'martin.marques' || '@' || 'gmail.com'
 DBA, Programador, Administrador
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Prototype  script.aculo.us group.
 To post to this group, send email to prototype-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.
 

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

-- 
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] Morph and setTimeout

2010-07-20 Thread Rick . Wellman
Oops, already made a mistake;  Make that:

var cmd = $('masinfo' + id + ).show();
setTimeout(cmd,500,id);

-Original Message-
From: prototype-scriptaculous@googlegroups.com 
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Rick.Wellman
Sent: Tuesday, July 20, 2010 3:42 PM
To: prototype-scriptaculous@googlegroups.com
Subject: RE: [Proto-Scripty] Morph and setTimeout

I'm pretty sure Ralph's suggestion will work.  I prefer to write this in a way 
which will hopefully highlight the potential bug to a less-experienced 
maintenance developer after I have moved onto a 6-digit consulting career that 
I run two-hours a day from the Bahamas (boy, sure hope my idea works or that 
consulting career is a pipe-dream):

var elid = 'masinfo' + id;
setTimeout($(elid).show(),500,id);

-Original Message-
From: prototype-scriptaculous@googlegroups.com 
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Ralph Brickley
Sent: Tuesday, July 20, 2010 3:04 PM
To: prototype-scriptaculous@googlegroups.com
Subject: Re: [Proto-Scripty] Morph and setTimeout

JavaScript doesn't know what the +id is because it's within the double quotes. 

Do this instead 

 setTimeout($('masinfo'+id+).show(),500,id);
 }

Sent from my iPhone

On Jul 20, 2010, at 12:59 PM, Martín Marqués martin.marq...@gmail.com wrote:

 I'm trying to mix Effect.Morph and setTimeout() to enlarge a div and
 after the div finishes enlargening another div inside it appears (this
 is where I use setTimeout()). The problema is that I get a error and
 can't find out why.
 
 Here is the code:
 
 function expandir(id,newh){
new Effect.Morph('cont'+id, {
style: 'height:'+newh+'px;', // CSS Properties
duration: 0.5 // Core Effect properties
});
 
setTimeout($('masinfo'+id).show(),500,id);
 }
 
 Here it says that id is not defined in the setTimeout line.
 
 Any ideas?
 
 -- 
 Martín Marqués
 select 'martin.marques' || '@' || 'gmail.com'
 DBA, Programador, Administrador
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Prototype  script.aculo.us group.
 To post to this group, send email to prototype-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.
 

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

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

-- 
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 in IE7 vs. IE8

2010-05-28 Thread Rick . Wellman
Sorry for this short reply which may not even be correct but...

Usually the port number is considered part of the URL from the server
session viewpoint so if you're trying to go back to a different port
than the rest of your app uses, that could be a problem.  [I may have
butchered this explanation so someone able to use more specific
jargon... feel free to help or even tell me I'm completely wrong.]

 

From: prototype-scriptaculous@googlegroups.com
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Russell
Keith
Sent: Friday, May 28, 2010 4:24 PM
To: prototype-scriptaculous@googlegroups.com
Subject: RE: [Proto-Scripty] Ajax in IE7 vs. IE8

 

It appears that IE7 doesn't like the port number added to the URL.  Any
thoughts on how to get around this?  I have to have the port numbers.

 

 

From: prototype-scriptaculous@googlegroups.com
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Russell
Keith
Sent: Friday, May 28, 2010 3:08 PM
To: prototype-scriptaculous@googlegroups.com
Subject: [Proto-Scripty] Ajax in IE7 vs. IE8

 

Ok this doesn't make any sense to me.  The following code works in IE8
but not IE7.  The Ajax calls never get fired according to my proxy
software.  I don't have the luxury of firebug since I am relegated to IE
here at work.  Any ideas?

 

 

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

html xmlns=http://www.w3.org/1999/xhtml;

head

title/title

style type=text/css

.status{

margin-left: 10px;

margin-right:  10px;

width: 50px;

}

/style

script type=text/javascript src=prototype.js/script

 

script type=text/javascript

var secs = 10;

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

$('secs').update(secs);

checkAll();

new PeriodicalExecuter(function() { checkAll() },secs);

});

 

function check(num){

$('jetway0'+num).value ='...';

$('jetway0'+num).style.color='black';

new Ajax.Request(http://10.0.0.5:80+num+/shared/login.jsp;, {

onSuccess: function(transport) {

$('jetway0'+num).value ='Up';

$('jetway0'+num).style.color='green';

},

onFailure: function(transport){

$('jetway0'+num).value='Down';

$('jetway0'+num).style.color='red';

}

});   

}

 

function checkAll(){

for (i=1; i=6; i++){

check(i);

}

}

/script

 

/head

body

Checks every span id=secs/spannbsp;seconds.br /br /

Jetway01: input class=status id=jetway01/span
style=text-decoration: underline; color: blue; cursor: hand;
onclick=check(1)Refresh/spanbr /

Jetway02: input class=status id=jetway02/span
style=text-decoration: underline; color: blue; cursor: hand;
onclick=check(2)Refresh/spanbr /

Jetway03: input class=status id=jetway03/span
style=text-decoration: underline; color: blue; cursor: hand;
onclick=check(3)Refresh/spanbr /

Jetway04: input class=status id=jetway04/span
style=text-decoration: underline; color: blue; cursor: hand;
onclick=check(4)Refresh/spanbr /

Jetway05: input class=status id=jetway05/span
style=text-decoration: underline; color: blue; cursor: hand;
onclick=check(5)Refresh/spanbr /

Jetway06: input class=status id=jetway06/span
style=text-decoration: underline; color: blue; cursor: hand;
onclick=check(6)Refresh/spanbr /

br /

span style=text-decoration: underline; color: blue; cursor: hand;
onclick=checkAll()Refresh All/span

/body

/html

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

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

-- 
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: Hide or Remove non-HTML element from HTML

2010-04-20 Thread Rick . Wellman
I've only partially followed this thread so apologies if this was 
suggested/shotdown.
Can you wrap it with a well-formed HTML element? i.e. div (most likely) and 
remove it with javascript/prototype?

-Original Message-
From: prototype-scriptaculous@googlegroups.com 
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Jelks
Sent: Tuesday, April 20, 2010 10:36 AM
To: Prototype  script.aculo.us
Subject: [Proto-Scripty] Re: Hide or Remove non-HTML element from HTML



On Apr 20, 10:43 am, Jonathan Rosenberg j...@tabbysplace.org
wrote:
 Ok, so I was too glib.  Maybe it's not very simple.

 1) Do you have control of the delivery of this document at the server side?

Only somewhat.  If I had total control, I would not be letting this

AsyncExceptionError occured during AsyncInvocation./
AsyncException

arrive in and pollute the document.

 2) Is it well-formed XHTML?

Yes.  But it's served as text/html.

 3) I'm not sure I understand what you're trying to do with this page while
 it's in a browser.  JIs it just to remove the text node

Yes, to remove that text node (with *or without* it's bogus
ASYNCEXCEPTION and /ASYNCEXCEPTION apparently sibling nodes that
IE creates from that XML snippet above) -- in order that I don't see
this:

Error occured during AsyncInvocation.

at the top of the page in IE (no problem hiding it in Firefox/Chrome).

Thanks,

Jelks

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

-- 
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 Updater running from a DVD under IE8

2010-02-16 Thread Rick . Wellman
Um, maybe I'm whack, but...
Doesn't an AJAX request need an HTTP server?  Am I correct in
understanding that you are just trying to distribute files/static
content?

-Original Message-
From: prototype-scriptaculous@googlegroups.com
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Walter
Lee Davis
Sent: Tuesday, February 16, 2010 11:17 AM
To: prototype-scriptaculous@googlegroups.com
Subject: Re: [Proto-Scripty] Ajax Updater running from a DVD under IE8

Sorry to bump this so soon, but my client is getting itchy. Has anyone  
seen anything like this, where an Ajax Updater will not run in a local  
file context under IE8? No errors on screen, but no updated content,  
either. I've updated to 1.6.1, moved my call to the updater from a  
document.observe to a Yahoo-style script block before /body, to no  
avail.

Thanks,

Walter

On Feb 15, 2010, at 6:59 PM, Walter Lee Davis wrote:

 I have a site that gets distributed on DVD as a portable library.  
 IE8 users are complaining that an element I am loading into the home  
 page using Ajax Updater is not appearing at all for them. The  
 problem only seems to happen when the site is accessed from the DVD.  
 If you visit the preview version of the site here:
http://files.libertyfund.org/pll 
  everything loads just fine under any browser.

 This site is using 1.6.0.3, I haven't updated it yet to 1.6.1, and I  
 can't recall if there was any work done in this area between those  
 two versions.

 Does this ring any bells for anyone? Is it going to be fix-able, or  
 do you suspect it might be one of those IE features?

 Thanks in advance,

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


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

-- 
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: Multiple timed slideshows

2010-02-01 Thread Rick . Wellman
I am guessing that one of two things is true (maybe a little of both):
1) Though this is the correct forum, no response would mean that no one who 
reads this knows of boiler plate code.
2) I cannot imagine this is terribly different from code you've done before 
with small modifications.  Is there some specific aspect of it that has you 
perplexed? 

-Original Message-
From: prototype-scriptaculous@googlegroups.com 
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of greyhound
Sent: Monday, February 01, 2010 4:06 PM
To: Prototype  script.aculo.us
Subject: [Proto-Scripty] Re: Multiple timed slideshows

If I have posted this in the wrong section, please could someone give
me a heads up?

Thanks

On Jan 31, 8:16 pm, greyhound b...@greyhound-computing.com wrote:
 Hi everyone,

 I have been using the script library to create simple slide shows with
 no problem.

 I have recently been asked to create 3 slideshows which fade in one
 after the other, very similar to this example (which is in 
 Flash)http://www.rockarchive.com/(see the top 3 discs that rotate)

 Does anyone know of any examples as to how this could be achieved?

 Thanks in advance.

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

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



[Proto-Scripty] RSS Feed

2010-01-19 Thread Rick . Wellman
My apologies if there is a different forum to ask this, but when I
originally signed up to this group I setup an RSS feed.  I do not get
regular RSS updates (actually I get none except the first) and was
wondering if others are experiencing the same thing or if I need to
investigate my client (the dreaded MS Outlook).  I mainly suspect the
server side because I am getting other RSS subscriptions.

 

Rick Wellman
Applications Programmer



 

-- 

You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group.

To post to this group, send email to prototype-scriptacul...@googlegroups.com.

To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.



RE: [Proto-Scripty] Blinddown IE7 problem

2009-12-30 Thread Rick . Wellman
It seems to me that there is a comment somewhere that you need to put a
container div within the div you are applying the effect to.  i.e. 

div
div
... all of your stuff ...
/div
/div

Sorry I do not have time to find the original documentation and/or
confirm but I am pretty sure I have come across undesired behavior
with blindup/blinddown and this was necessary.  HTH

-Original Message-
From: prototype-scriptaculous@googlegroups.com
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of drewB
Sent: Wednesday, December 30, 2009 3:56 PM
To: Prototype  script.aculo.us
Subject: [Proto-Scripty] Blinddown IE7 problem

I develop using FF3 and have been testing my design on IE7.  I have
noticed a big problem with using blinddown / blindup.  When it blinds
down, the div overlaps the next div and at the end is shifted to the
left (overlapping the div to the right of it).  Once I move the mouse,
things go back to normal.  When I blind up the div often shifts to the
right and items from the next div disappear (things don't go back to
normal after moving the mouse).

You can see a demo of it at
http://67.214.211.38/demosite/member/demos/blinddown.html.
Click on any of the Show Plan links to see the blind down and then
click Hide Plan to blind up.

I have found a hand full of posts about a similar problem but no
resolutions that work for me:
https://prototype.lighthouseapp.com/projects/8887/tickets/7-effect-blind
up-and-effect-blinddown-not-rendering-properly-on-ie7
http://dev.rubyonrails.org/ticket/8710

Does anyone have advice about how to fix this?

--

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.


--

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




RE: [Proto-Scripty] Re: Blinddown IE7 problem

2009-12-30 Thread Rick . Wellman
Ok, well that is all I got.  I did notice that you had an unordered list 
outside of the div.  Until you find the actual problem, I highly suggest 
putting everything inside the container.  Good luck.

div style=overflow: visible;
div
div class=action_plan heading_container
h3 class=title
Plan
img class=clickable src=../../images/add_button.png alt=Add Task 
style=margin-left: 0.45em; title=Add Task/
a class=clickable style=font-size: 70%;Add Task/a
/h3
/div
/div

ul class=steps_chbx
...
/ul

/div

-Original Message-
From: prototype-scriptaculous@googlegroups.com 
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of drewB
Sent: Wednesday, December 30, 2009 4:16 PM
To: Prototype  script.aculo.us
Subject: [Proto-Scripty] Re: Blinddown IE7 problem

That was first thought as well but it didn't end up making a
difference.

On Dec 30, 2:04 pm, Rick.Wellman rick.well...@kiewit.com wrote:
 It seems to me that there is a comment somewhere that you need to put a
 container div within the div you are applying the effect to.  i.e.

 div
 div
 ... all of your stuff ...
 /div
 /div

 Sorry I do not have time to find the original documentation and/or
 confirm but I am pretty sure I have come across undesired behavior
 with blindup/blinddown and this was necessary.  HTH

 -Original Message-
 From: prototype-scriptaculous@googlegroups.com

 [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of drewB
 Sent: Wednesday, December 30, 2009 3:56 PM
 To: Prototype  script.aculo.us
 Subject: [Proto-Scripty] Blinddown IE7 problem

 I develop using FF3 and have been testing my design on IE7.  I have
 noticed a big problem with using blinddown / blindup.  When it blinds
 down, the div overlaps the next div and at the end is shifted to the
 left (overlapping the div to the right of it).  Once I move the mouse,
 things go back to normal.  When I blind up the div often shifts to the
 right and items from the next div disappear (things don't go back to
 normal after moving the mouse).

 You can see a demo of it 
 athttp://67.214.211.38/demosite/member/demos/blinddown.html.
 Click on any of the Show Plan links to see the blind down and then
 click Hide Plan to blind up.

 I have found a hand full of posts about a similar problem but no
 resolutions that work for 
 me:https://prototype.lighthouseapp.com/projects/8887/tickets/7-effect-blind
 up-and-effect-blinddown-not-rendering-properly-on-ie7http://dev.rubyonrails.org/ticket/8710

 Does anyone have advice about how to fix this?

 --

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


--

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] Issues selecting checkboxes in FF

2009-12-15 Thread Rick . Wellman
Um,... I am pretty sure if you see that a checkbox is checked then it is
checked.  You gotta suspect your validation code ('cause it sounds like
your validation code is checking a group of checkboxes to make sure that
at least one is checked).

-Original Message-
From: prototype-scriptaculous@googlegroups.com
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of
smartcookie
Sent: Tuesday, December 15, 2009 2:18 PM
To: Prototype  script.aculo.us
Subject: [Proto-Scripty] Issues selecting checkboxes in FF

Hey there:

Does anyone know a good way to programmably select or click on a
checkbox input in FF?

I have tried :
el.down('input').checked = 'checked';

and
el.down('input').onclick();

In the first code, I can see the checkboxes being checked, but when I
submit, my error validation alerts that nothing is selected...

Does anyone know another method..

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


--

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




Re: [Proto-Scripty] Re: Include scripts

2009-12-09 Thread Rick Waldron
Something I came across in my Twitter feed... LABjs



On Wed, Dec 9, 2009 at 6:54 AM, Frédéric f...@gbiloba.org wrote:

 Le mercredi 9 décembre 2009 11:25, T.J. Crowder a écrit :

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

 I see.

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

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

// @include another_script.js

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

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

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

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

 Thanks for your help.

 --
Frédéric

 --

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




--

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




Re: [Proto-Scripty] Re: Delay or defer ajax requests

2009-12-07 Thread Rick Waldron
I'm not at a computer to try this out, and well, it might be a little 
hair-brained but perhaps...


( new Ajax.Updater() ).defer();

-- Sent from my Palm Prē
T.J. Crowder wrote:

Hi,



 I'm using animations on my website, and i want to start an Ajax

 request after a animation has finished. So i want to use Function.defer

 (...) on the Ajax.Updater function.



Your animations don't provide an `afterFinish` callback or similar?

(Script.aculo.us' do, but you didn't say you were using

script.aculo.us, so I'm not assuming.)



 I don't want to create a new function for using the delay:



Pretty sure that's your only choice. What's your objection to it?



HTH,

--

T.J. Crowder

Independent Software Consultant

tj / crowder software / com

www.crowdersoftware.com



On Dec 6, 10:51 pm, David S. lt;evil.zweitaus...@googlemail.com

wrote:

 Hello.



 I'm using animations on my website, and i want to start an Ajax

 request after a animation has finished. So i want to use Function.defer

 (...) on the Ajax.Updater function. The problem is that the

 Ajax.Updater must be initiated using the new keyword, but then

 Ajax.Updater isn't working.



 I tried it like this:

 new Ajax.Updater.defer(5,'main_body', '?topic='+topic, { evalScripts:

 true });



 I don't want to create a new function for using the delay:



 var submit_ajax = function(topic) {

      new Ajax.Updater('main_body', '?topic='+topic, { evalScripts:

 true });}



 submit_ajax.delay(0.7,topic);



 How is it possible to run functions that require new after a delay.



 Thanks.



--



You received this message because you are subscribed to the Google Groups 
Prototype amp; 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.






--

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




Re: [Proto-Scripty] Re: document.write() vs Element/appendChild()

2009-12-07 Thread Rick Waldron
IMO, this is bad practice. 


$(element).insert('lt;divlt;/div'); 

-- Sent from my Palm Prē
david wrote:

Hi All,



This is not the original question, but to insert elements in the DOM,

you should do:

$('myContent').innerHTML='lt;div .. lt;/div'



It's faster in execution than creating an element with a new.Element a

set each needed property.



--

david



On 7 déc, 12:00, Alex McAuley lt;webmas...@thecarmarketplace.com

wrote:

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

 in the scope...



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

 scope



 Alex Mcauleyhttp://www.thevacancymarket.com



 - Original Message -

 From: ColinFine lt;colin.f...@pace.com

 To: Prototype amp; script.aculo.us 
 lt;prototype-scriptaculous@googlegroups.com

 Sent: Monday, December 07, 2009 10:53 AM

 Subject: [Proto-Scripty] Re: document.write() vs Element/appendChild()



 On Dec 4, 10:36 pm, fma lt;f...@gbiloba.org wrote:

  Ok, I found something...



  If I look at the HTML tree in the IE debugger, on the left panel I

  can't see any 'class' attribute. However, it does appear on the right

  panel (called Attributs), with the correct value. But IE does not

  seems to use it. I found that I can add an attribute to the div in the

  left panel. So I tried to add an attribute named 'class', and I set

  its value: this fixes the problem, and IE can apply the CSS!!!



  Then, I tried something else... I used the old-style to build the DOM

  tree:



  this.content = document.createElement('div');

  Element.extend(this.content);

  this.content.setAttribute('id', this._name + _content);

  this.content.setAttribute('class', fullContent);

  document.body.appendChild(this.content);



 I don't know if this is relevant to the problem, but you don't need to

 use 'setAttribute' for built-in attributes of HTML element:



 this.content.id = this._name + _content;



 avoids an unnecessary function call.



 For the DOM attribute 'class', the Javascript binding requires you to

 use 'className', because 'class' is a reserved word in Javascript:



 this.content.class = fullContent;



 (or, using a Prototype method)

 this.content.addClassName('fullContent');

 This is not quite the same, because if you already have a class on the

 element, this will add the new class, whereas the simple assignment

 will replace it. But since you have just created the element, there is

 no difference.



  instead of the new-style:



  this.content = new Element('div', {'id': this._name + _content,

  'class': fullContent});



  and it worked!!!



  At first, I didn't put the quotes arround the attributes names, in the

  hash:



  this.content = new Element('div', {id: this._name + _content,

  class: fullContent});



  but IE does not like this syntax (it asks for an int or a string). But

  as you can see, giving a string does not seems to work well.



 IE objects (correctly) to your using the Javascript reserved word

 'class' as an object key: Firefox is more lax and lets it through.

 'id' will work without quotes.



  Am I doing something wrong with the new-style method? Or is it a known

  issue in Prototype?



 I don't know. Your example seems to match that in the Prototype

 documentation. I would try it with 'className' instead of 'class' and

 see whether this works.



 --



 You received this message because you are subscribed to the Google Groups

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



--



You received this message because you are subscribed to the Google Groups 
Prototype amp; 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.






--

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] When Ajax Insert Expands Page Downward...

2009-12-07 Thread Rick Waldron
Yes and it drives me nuts. I'm sure there is a correct way of fixing this, but 
i'm ok with just setting somekind of footer content below the fold so that I 
always have scroll bars

-- Sent from my Palm Prē
Dave L wrote:

I am having an issue:  when inserting a number of elements that end up

push the page downward so that the scroll bar has to be adjusted, all

of the css shifts to the left.  I am using firefox 3.0 and have

noticed this occurance before.  Has anyone else come across this or

know what might be causing this?



--



You received this message because you are subscribed to the Google Groups 
Prototype amp; 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.






--

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

2009-12-07 Thread Rick Waldron
A good place to start, add:

console.log('this is my first debug output');

Anywhere inside of a loaded dom closure (like your initializer function or 
prototype's document.observe('dom:loaded', ...);  )

-- Sent from my Palm Prē
evilC wrote:

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






--

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

2009-12-07 Thread Rick Waldron
Very, very cool.

-- Sent from my Palm Prē
evilC wrote:

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






--

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

2009-12-07 Thread Rick Waldron
Weird, maybe I thought it was doing what it should do... Either way, nice fix

-- Sent from my Palm Prē
evilC wrote:

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






--

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




Re: [Proto-Scripty] Re: document.observe and Sorter in scrolling li sts

2009-12-07 Thread Rick Waldron
Missing:

lt;head
lt;body

If found, please return.

-- Sent from my Palm Prē
Niko Schwarz wrote:

I don't know why, but somehow this snippet executes document.observe

fine. I just open another script tag and suddenly the world is good.



But the issue with the scrolling drag and drop remains. This code

snippet should be executable in a browser as is, from a file (I can

attach it as a file if that's easier, or host it on a website):



lt;!DOCTYPE html

lt;html lang=en

lt;script src=http://www.google.com/jsapi;lt;/script

lt;script

   google.load(prototype, 1.6.1.0);

   google.load(scriptaculous, 1.8.3);

lt;/script

lt;script

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

Sortable.create('fruit', {

scroll: container

});

});



lt;/script



lt;titleTestlt;/title

lt;div id=container style=overflow: scroll; width: 200px; height: 100px;

lt;ul id=fruit

lt;liApple

lt;liBanana

lt;liPeach

lt;liStrawberry

lt;liCherry

lt;liPear

lt;liOrange

lt;liMango

lt;/ul



Cheers,



Niko



On Mon, Dec 7, 2009 at 7:15 PM, Niko Schwarz

lt;niko.schw...@googlemail.com wrote:

 Hi, I have this tiny script, and it fails in two ways. First, the

 document observe thing fails really strangely, saying:



 TypeError: Result of expression 'document.observe' [undefined] is not

 a function.



 The second error, after I create the sorter on the command line: You

 cannot drag and drop the lower elements of the list.



 Here's the script:



 lt;!DOCTYPE html

 lt;html lang=en

 lt;script src=http://www.google.com/jsapi;lt;/script

 lt;script

   google.load(prototype, 1.6.1.0);

   google.load(scriptaculous, 1.8.3);



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

     Sortable.create('fruit', {

    scroll: container

    });});



 lt;/script



 lt;titleTestlt;/title

 lt;div id=container style=overflow: scroll; width: 200px; height: 100px;

 lt;ul id=fruit

    lt;liApple

    lt;liBanana

    lt;liPeach

    lt;liStrawberry

    lt;liCherry

    lt;liPear

    lt;liOrange

    lt;liMango

 lt;/ul





 So, what is your take?





 Cheers,



 Niko





 --

 http://scg.unibe.ch/staff/Schwarz

 twitter.com/nes1983

 Tel: +41 076 235 8683









-- 

http://scg.unibe.ch/staff/Schwarz

twitter.com/nes1983

Tel: +41 076 235 8683



--



You received this message because you are subscribed to the Google Groups 
Prototype amp; 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.






--

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] Element.update() without evaluating the script.

2009-12-07 Thread Rick Waldron
What condition should exist to stop the evaluation?

-- Sent from my Palm Prē
JoJo wrote:

I have a lt;textarea id=foo which contains JS code that people can

copy and paste. It's dynamically generated, so I do something like

this:



$('foo').update('lt;script . ' + this.someVariable + '/);



The documentation on Element.update states that the script will be

evaluated rather than inserted literally. It does not tell me how to

stop the evaluation. How may I do this?



--



You received this message because you are subscribed to the Google Groups 
Prototype amp; 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.






--

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] Internet Explorer bug with Effect.Appear

2009-12-07 Thread Rick Waldron
Before I even begin to help you with this... you have 3+ copies of the
Prototype/Scriptaculous libraries being called in.


While your at it:

http://www.getfirebug.com






On Mon, Dec 7, 2009 at 2:03 PM, Mark K. mki...@gmail.com wrote:

 Hey all,

 If you take a look at a site I'm working on at
 http://www.rnvitals.com/hawaii,
 you'll notice (in Internet Explorer only) that when you mouseover the
 Articles tab in the header, nothing occurs.  If you click on the
 Forums tab, you'll notice that when you mouseover the Articles tab
 then a submenu appears underneath.  I'm not sure why it appears in one
 and not the other; Internet Explorer gives me a generic Object
 doesn't support this property or method error and refers to line 543
 of effects.js.

 The forum is running phpBB 3.0, and the rest of the site is powered by
 Wordpress.  Obviously, one of them is loading something or not loading
 something that is or isn't doing what it's supposed to or not supposed
 to do with Effect.Appear. :(

 Has anyone else had this problem when using these scripts with
 Wordpress?

 --

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




--

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




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

2009-12-06 Thread Rick Waldron
Instead of onSuccess, try using onComplete...

-- Sent from my Palm Prē
evilC wrote:

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






--

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

2009-12-06 Thread Rick Waldron
Also, in PHP related advice, *ereg *and *split* are deprecated. if you
turned on your PHP errors and use E_ALL, it will throw back errors.


Rick

On Sun, Dec 6, 2009 at 6:36 PM, Rick Waldron waldron.r...@gmail.com wrote:

 Actually, my reasoning for that response was a fluke, so ignore it


 the problem: you're calling *this*.deleteform()

 I noticed you use all kinds of alert()'s for debugging... i'd recommend
 learning firebug and making it your very best friend. Firebug told me that 
 *this* IS NOT *pb_editloc*, its actually *window*

 so... replace

 *this*.deleteform()

 with:

 *pb_editloc*.deleteform();

 And it works perfectly.


 Also, can i recommend that you don't use body onload=foo()... its silly
 to wait that long to start doing your DOM work. I dropped the onload=
 attribute, and commented out the function it called (might as well delete
 it), but copied the body of it into document.observe('dom:loaded')

 Also... I made some suggestions in here. Find them in *bold*

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

 *  // Mixing elderly events with Prototype is sloppy.
   //window.onresize= winResize;
   document.observe('resize',winResize);
 *
   winResize();

   pb_editloc.initialize();

   var latlng = new google.maps.LatLng(51.64, 0);
   var myOptions = {
 zoom: 8,
 center: latlng,
 mapTypeId: google.maps.MapTypeId.ROADMAP
   };
   map = new google.maps.Map($(map_canvas), myOptions);

   // Click Listener
   google.maps.event.addListener(map, 'click', function(event) {
 if (pb_editloc.editmode){
   pb_editloc.clicked(event.latLng);
 }
   });


   // Insert sidebar
 *
 **  var newDiv = document.createElement(div);
   newDiv.innerHTML = ;
   newDiv.id =pb_sidebar;
 **  $(pb_rightbar).appendChild(newDiv);
 **
 /*
 **//  Why not use:
 **  $(pb_rightbar).insert(
 new Element('DIV', {id: 'pb_sidebar'})
   );
 */
 *

   // Insert loc box (Shows current location)
   pb_locbox.initialize('pb_locbox','pb_bottombar');

   // Insert zoom box (Shows current zoom)
   pb_zoombox.initialize('pb_zoombox','pb_bottombar');

   // Insert zoom box (Shows current zoom)
   pb_zoombox.initialize('pb_wipe_database','pb_bottombar');

   //Insert Add button
   insertHtmlFromTemplate(pb_add_location_button,pb_map_controls);


   readLocations();
 });





 On Sun, Dec 6, 2009 at 6:11 PM, Rick Waldron waldron.r...@gmail.comwrote:

 The problem is that when the dom is loaded... there is no such thing as
 pb_add_location.







 On Sun, Dec 6, 2009 at 5:09 PM, T.J. Crowder t...@crowdersoftware.comwrote:

 Hi,

  Just tried onComplete - no joy

 You probably don't want onComplete. onComplete is called regardless of
 whether the request was successful. You probably want onSuccess and
 onFailure, doing different things.

 -- T.J.

 On Dec 6, 7:25 pm, evilC ev...@evilc.com wrote:
  Just tried onComplete - no joy
 
  I uploaded a copy tohttp://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.comprototype-scriptaculous%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/prototype-scriptaculous?hl=en.






--

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




Re: [Proto-Scripty] Re: Prototype conflict solution

2009-12-02 Thread Rick Waldron
Wow, I'm flattered... I was beginning to think that GenevaJS amounted to
nothing more then a novelty :D


Keep in mind that GenevaJS is not 100% yet, but if you do use it and come
across broken or missing methods, you can certainly contribute

Rick





On Wed, Dec 2, 2009 at 7:43 AM, david david.brill...@gmail.com wrote:

 Sorry,

 Should read  ... GenevaJS, a port of jquery syntax using prototype at
 http://genevajs.com/ 

 --
 david

 On 2 déc, 13:42, david david.brill...@gmail.com wrote:
  Hi both,
 
  What is funny with the JQuery compatibility mode is that it breaks
  plugin, and standard JQuery code.
  What I propose is a different approach, suppress Jquery, and only use
  Prototype with GenevaJS, a port of jquery using prototype athttp://
 genevajs.com/
 
  btw, it's not as simple.
 
  --
  david
 
  On 30 nov, 13:01, Rafal Zarajczyk rzarajc...@gmail.com wrote:
 
   As far as I know there is no such thing in prototype, but definitely
   it would be usefull sometimes! When I need a single method from
   Prototype in a jQuery-driven site (let's say I want to use unescapeHTML
   ()) I just copy-paste implementation... which is sometimes easy,
   sometimes hard.
 
   I'm looking forward to this feature!
 
   Rafał Zarajczyk
 
   Ps. The solution switch everything do Prototype is not always
   possible :-P
 
   On 24 Lis, 14:58, markojakic jakicmeis...@gmail.com wrote:
 
I am working on some site, which has jquery support, but I added
Prototype (autocomplete component with xml loading) and it's not
working when JQuery is loaded.
I know that JQuery has that support with JQuery.noconflict but it's
hard to change ALL the .js files and ALL the $ functions.
So, does Prototype have such support? I'd only need to change a
 little
one .js file which handles with autocompleter.
 
Regards

 --

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




--

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




[Proto-Scripty] Re: Forms

2009-10-29 Thread Rick . Wellman

$F() gets the *value* of the form element (i.e. a dropdown's value, the
text in a text box, etc.)
$() just gets the DOM element itself (so would return the dropdown, the
text box, etc. respectively).
[so also, using $F() on a non-form element is fairly pointless]

-Original Message-
From: prototype-scriptaculous@googlegroups.com
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Russell
Keith
Sent: Thursday, October 29, 2009 10:28 AM
To: prototype-scriptaculous@googlegroups.com
Subject: [Proto-Scripty] Re: Forms


Then how is $F() any different than $()?

Also, any idea why I can't get my form to submit.  I have been all over
Google and can't figure it out.

-Original Message-
From: prototype-scriptaculous@googlegroups.com
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Walter
Lee Davis
Sent: Thursday, October 29, 2009 10:24 AM
To: prototype-scriptaculous@googlegroups.com
Subject: [Proto-Scripty] Re: Forms


Try giving your form elements IDs to match their NAME property. I have  
always needed the ID to be set in order to get a value out of $F.

Walter

On Oct 29, 2009, at 11:08 AM, Russell Keith wrote:

 Ok, maybe I'm just being dense, but I am reading the API for forms  
 and I am getting nothing from it.

 What is proper use of the $F utility and what can it do for me?  I  
 have read the Form.Element.getValue and it means nothing to me.

 I have this form:

 form name=createPDF action=/pdf/pdf_process.php  
 method=POST
 input type=hidden name=A_NAME value=John /
 input type=hidden name=APPLY_DATE value=?=date(m/d/Y)? 
  /
 input type=hidden name=A_BIRTH_DATE value=01/01/01 /
 input type=hidden name=L_NAME value=Jane /
 input type=hidden name=L_BIRTH_DATE value=01/01/01 /
 input type=hidden name=A_ACCOUNT value=1 /
 /form

 When I try to do alert($F('A_NAME')); I get an 'Object does not  
 support this property or method' error.  I get the same error when I  
 try to submit the form with 'document.createPDF.submit();' is there  
 something wrong with my form?

 







--~--~-~--~~~---~--~~
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: $$ is a violation of Model-View-Controller

2009-10-29 Thread Rick . Wellman

Though I consider javascript/prototype to be one of my weaker web app skills 
(which is why I like Prototype in the first place), I feel compelled to add to 
this discussion in that:

While I certainly agree with the Use Case that you are describing (and the one 
referenced in the response) I guess I have been lucky enough to have never 
used $$() that way.  However, I have used it (and will most likely continue to 
do so) to retrieve elements based on their CSS class selector.  In fact, some 
of the page effects that I have been asked to implement rely on the use of 
$$().  So, IMHO, maybe it is better stated that $$() is part of the View in the 
MVC paradigm?  Just like Struts is a Controller but many people use the Struts 
tags which are part of the View?

-Original Message-
From: prototype-scriptaculous@googlegroups.com 
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of kangax
Sent: Thursday, October 29, 2009 4:51 PM
To: Prototype  script.aculo.us
Subject: [Proto-Scripty] Re: $$ is a violation of Model-View-Controller


On Oct 29, 4:36 pm, JoJo tokyot...@gmail.com wrote:
 Is it poor practice to use $$?

    $$('#grandparent #parent tag.class');

 I've been using $$ quite a lot because it has sped up DEVELOPMENT, but
 now I have realized that it will slow down MAINTENANCE.  Recently, my
 boss asked me to move a whole div to another part of the page.  Since
 I was accessing that div with $$, I was forced to change my JS along
 with my HTML.  If I had accessed that div with $('elementID'), I would
 have only needed to edit my HTML.

 For this, I believe that $$ is a violation of the model-view-
 controller paradigm.  HTML and CSS are the view.  JS should be thought
 of as the controller.  If you think about it, JS processes user input
 just like PHP, except on a livelier schedule.  To make your website
 easier to implement, you should refrain from using $$ to describe the
 HTML structure.

 What are your thoughts?

Yep. I came to the very same conclusion recently -
http://stackoverflow.com/questions/1567496/jquery-anti-pattern-building-selectors-with-string-manipulation/1567743#1567743

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



[Proto-Scripty] Re: Observe new elements

2009-09-26 Thread Rick Waldron
var _observers

On Thu, Sep 24, 2009 at 5:41 AM, Alex McAuley 
webmas...@thecarmarketplace.com wrote:

  You need to stopObserving the old ones relative to your element (cleans
 up the observers) and add a new observer as normal

 HTH

 Alex Mcauley
 http://www.thevacancymarket.com

 - Original Message -
 *From:* Russell Keith russell.ke...@aacreditunion.org
 *To:* prototype-scriptaculous@googlegroups.com
 *Sent:* Wednesday, September 23, 2009 10:27 PM
 *Subject:* [Proto-Scripty] Observe new elements

  If I am adding elements to a page after the DOM is loaded, how do I add
 my existing Element.observe to it?



 Russell


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-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: Observe new elements

2009-09-26 Thread Rick Waldron
Whoops! I hit shift or control return and well... sent that too early.

Anyway, I always do this...


var Observers = function () {

// your observers go in here...

};

Ajax.Responders.register({
onComplete: function () {
 Observers();
}
});

document.observe('dom:loaded', function () {
   Observers();
});



On Sat, Sep 26, 2009 at 5:56 PM, Rick Waldron waldron.r...@gmail.comwrote:

 var _observers


 On Thu, Sep 24, 2009 at 5:41 AM, Alex McAuley 
 webmas...@thecarmarketplace.com wrote:

  You need to stopObserving the old ones relative to your element (cleans
 up the observers) and add a new observer as normal

 HTH

 Alex Mcauley
 http://www.thevacancymarket.com

 - Original Message -
  *From:* Russell Keith russell.ke...@aacreditunion.org
 *To:* prototype-scriptaculous@googlegroups.com
 *Sent:* Wednesday, September 23, 2009 10:27 PM
 *Subject:* [Proto-Scripty] Observe new elements

  If I am adding elements to a page after the DOM is loaded, how do I add
 my existing Element.observe to it?



 Russell


 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-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: A better way to check for an element.

2009-09-20 Thread Rick Waldron
Mislav's when() seems a bit redundant when called inside of
document.observe('dom:loaded')...


I think this topic would be interesting to discuss in the the proto-dev
mailing list, ie. exceptions thrown for non-existant elements... i'd also
like to see some kind of support for catching stupid coding: documents with
elements that have the same id (like... div id=myDiv/div  div
id=myDiv/div...ugh.) I wrote a snippet that used mutation events to check
the document for junk like this, but sadly, DOMContentLoaded,
DOMNodeInsterted et al aren't supported widely enough to warrant production
level usage.



Rick


On Sat, Sep 19, 2009 at 8:39 AM, Radoslav Stankov rstan...@gmail.comwrote:


 You can use something like my CD3.Behavior lib (

 http://github.com/RStankov/controldepo-3-widgets/blob/master/src/behaviors.js
 )

 code
 CD3.Behaviors({'#element:click': yourClickHandler });
 // -- or --
 CD3.Behaviors('#element', function(){
  this.observe('click', yourClickHandler);
 });
 // -- or ... CD3.Behaviors have really large set of possible uses
 /code

 Or ... use Mislav's when() function
 http://mislav.uniqpath.com/js/when-available-in-prototype/
 


--~--~-~--~~~---~--~~
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: A better way to check for an element.

2009-09-20 Thread Rick Waldron
Thats not to say that when() isn't pretty cool :)



On Sun, Sep 20, 2009 at 9:00 AM, Rick Waldron waldron.r...@gmail.comwrote:

 Mislav's when() seems a bit redundant when called inside of
 document.observe('dom:loaded')...


 I think this topic would be interesting to discuss in the the proto-dev
 mailing list, ie. exceptions thrown for non-existant elements... i'd also
 like to see some kind of support for catching stupid coding: documents with
 elements that have the same id (like... div id=myDiv/div  div
 id=myDiv/div...ugh.) I wrote a snippet that used mutation events to check
 the document for junk like this, but sadly, DOMContentLoaded,
 DOMNodeInsterted et al aren't supported widely enough to warrant production
 level usage.



 Rick



 On Sat, Sep 19, 2009 at 8:39 AM, Radoslav Stankov rstan...@gmail.comwrote:


 You can use something like my CD3.Behavior lib (

 http://github.com/RStankov/controldepo-3-widgets/blob/master/src/behaviors.js
 )

 code
 CD3.Behaviors({'#element:click': yourClickHandler });
 // -- or --
 CD3.Behaviors('#element', function(){
  this.observe('click', yourClickHandler);
 });
 // -- or ... CD3.Behaviors have really large set of possible uses
 /code

 Or ... use Mislav's when() function
 http://mislav.uniqpath.com/js/when-available-in-prototype/
 



--~--~-~--~~~---~--~~
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: including prototype dynamically, and observe:domloaded

2009-09-20 Thread Rick Waldron
If none of the above work...

document.write('script type=text/javascript src='
http://somewhere/edu/is//prototype.js;\/script');

have you tried removing the extra / before prototype.js?







On Fri, Sep 18, 2009 at 1:45 PM, Ngan Pham nganp...@gmail.com wrote:

 Hi jrochkind,
 I believe document.write is execute properly and full before your observe
 call is done.  However, document.write's job is simply to write the string
 to the browser, nothing more.  It's then the browser's job to interpret the
 string and do whatever it has to do on a different tangent. In this case,
 load an external javascript document.  So immediately after document.write
 has performed it's job, the next statement is ran--which causes the problem
 for you since the external prototype script is not ready.

 As stated above this isn't a good thing to do in general.  However, to
 answer your questionyou either of the follow (there may be more
 options):
 1. Modify the prototype.js file and add a function call at the bottom to
 let your page know prototype is loaded.
 2. Use a setInterval function to periodically check for prototype's
 existence.  Once it's available you can then stop the checking and resume
 your code.

 On Thu, Sep 17, 2009 at 12:37 PM, Jonathan Rochkind rochk...@jhu.eduwrote:


 Thanks Alex, I think that post does have the right analysis of what
 was going on in my case and why it wasn't working.

 And thanks for the alert that loading prototype via document.write in
 general may be a bad idea.

 Is there any good way to have an external .js file trigger a load of
 Prototype, or is this basically just a lost cause, and if you want
 Prototype on a page, you've just got to include a script tag that
 references a prototype.js file directly on the page, no ifs and or
 buts?

 Jonathan

 On Sep 17, 3:23 pm, Alexander Wallace alexmlwall...@gmail.com wrote:
  While I don't recommend loading prototype via document.write,
  this might be due to including both the doc.write(prototype) and the
  doc.observe() function within the same enclosing script tag.
  See:
 http://kossovsky.net/index.php/2009/07/script-as-blocking-element-and...
 
  But I really don't recommend loading prototype.js using document.write.
  I'm not sure how that would interfere with the IE method of dom:loaded
  (which involves using document.writing a deferred script element and
  watching its .onreadystatechange), but I can't imagine the outcome
  would be bug-free.
 
  -Alex
 
  On Thu, Sep 17, 2009 at 2:54 PM, jrochkind rochk...@jhu.edu wrote:
 
   So theoretically (Prototype 1.6), it should be possible to have
   javascript code include the Prototype library into a page via
   document.write, right?
 
   document.write('script type=text/javascript src='
 http://somewhere/
   edu/is//prototype.js\/script');
 
   Okay, this mostly works. Unless you want the same script that did this
   to then immediately call any Prototype function, such as
   document.observe.
 
   document.write('script type=text/javascript src='
 http://somewhere/
   edu/is//prototype.js\/script');
   document.observe(dom:loaded, function() { alert('loaded!'); });
 
   This does NOT work, because at the point that document.observe is up
   there, Prototype is NOT actually loaded yet.  Although it will be
   eventually.
 
   Can anyone explain what's going on?  Does the browser not do or fully
   process the document.write until after the current script is fully
   done?
 
   Is there any way to have a script include the prototype library
   dynamically, and then have that same script call some prototype
   functions, such as in particular document.observe?



 


--~--~-~--~~~---~--~~
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: A better way to check for an element.

2009-09-18 Thread Rick Waldron
Its not much different, but this is what i do:

if ( $('some_button') ) {
  $('some_button').observe('click', function (e) {
//do stuff.
  });
}


Ideally, i wish prototype was a bit more strict about this stuff...

If you're using Firebug, you could replace your $() definition:

function $(element) {
  if (arguments.length  1) {
for (var i = 0, elements = [], length = arguments.length; i  length;
i++)
  elements.push($(arguments[i]));
return elements;
  }
*  if (Object.isString(element)) {
var _element  = element;
element  = document.getElementById(element);

if ( element == null ) {
  console.log('' + _element + ' is null or does not exist');
  return;
}
  }
*  return Element.extend(element);
}







On Fri, Sep 18, 2009 at 4:17 PM, Luisgo lgo...@gmail.com wrote:


 Hey all,

 I was wondering if you can suggest a better way of achieving what this
 snippet does. I do it often enough that it starts bloating my code and
 frankly just gets annoying to type.

   var some_button = $('some-button')
   if ( some_button ) {
 some_button.observe(click,function(event){
   event.stop();
   form_object.save();
 });
   }

 I can compress it a bit by doing this:

   if ( some_button = $('some-button') ) {
 some_button.observe(click,function(event){
   event.stop();
   form_object.save();
 });
   }

 But that's little consolation.

 In an ideal world I would want to do something close to:

   $('some-button').observe(click,function(){
 form_object.save();
   }, false );

 Note: that false parameter would replace event.stop() which happens
 often enough. Defaults to true.

 Or even like (I know it looks like JQuery):

   $('some-button').click(function(){
 form_object.save();
   },false);

 Any ideas/suggestions?

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



[Proto-Scripty] Re: how merge two json objects?

2009-09-15 Thread Rick Waldron
To note, the jQuery#extend implementation is a bit more in depth... has
there been any talk in the proto-core list about strengthening
Object#extend?

Rick

On Mon, Sep 14, 2009 at 8:35 PM, Miguel Beltran R. yourpa...@gmail.comwrote:

 Thanks to both #Mangus and #Alexander

 Use Object.extend look so easy, what I not believe myself  haha

 2009/9/12 Alexander Wallace alexmlwall...@gmail.com

 var object1 = { foo : bar };
 var object 2 = { baz : moof };
 Object.extend(object1, object2);

 Object.extend returns the new object1, which now
 has the attributes { foo : bar, baz : moof }.
 Be aware that any duplicate value will be overridden by the newer value.


 On Fri, Sep 11, 2009 at 8:30 PM, Miguel Beltran R. 
 yourpa...@gmail.comwrote:



 2009/9/11 DJ Mangus d.man...@gmail.com

 I've never done this but I'm pretty sure you can use object.extend.
 http://api.prototypejs.org/language/object.html#extend-class_method


 but how used?









 --
 
 Lo bueno de vivir un dia mas
 es saber que nos queda un dia menos de vida


 


--~--~-~--~~~---~--~~
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: When to expect code changes to be added to Prototype.

2009-09-05 Thread Rick Waldron
I wasn't previously aware of this enhancement (which is most def. is)...
however re: TJ's reply, I think support for something like this is quite
appropriate, as i know the jQuery does support the use of multiple selector
expressions sep. by commas.


Rick


On Fri, Sep 4, 2009 at 11:49 AM, T.J. Crowder t...@crowdersoftware.comwrote:


 Hi,

 The Lighthouse ticket should still be there.  If you filed the ticket,
 you should be able to see it by searching for all tickets created by
 you.  Hopefully that would shed light on the issue.

 You've said there's a fix to Prototype...but what you describe is an
 enhancement, isn't it?  Very big difference between enhancements and
 fixes.  It may well be that the Core team didn't think that supporting
 multiple expressions in that way was appropriate for the project.
 --
 T.J. Crowder
 tj / crowder software / com
 www.crowdersoftware.com


 On Sep 4, 3:10 pm, FigglesKoy figgles...@gmail.com wrote:
  There's a fix to Prototype that I've been waiting for a while to see.
  Specifically, that the Element.match method would support commas to
  support checking for multiple rules in a single call i.e. match
  ('DIV.aClass, DIV.bClass').  Thing is, this has been fixed online for
  a while, but it has never made it to a Prototype release and I'm not
  sure why.  The github commit is here (http://github.com/sstephenson/
  prototype/commit/afd74ce1c72a17666d8c9d86131463ad73cafe9e) and if I'm
  reading it correctly, its been there since November of last year.
  However, even in the latest 1.6.1 release, it is not present.  I can
  no longer find it on the lighthouse page though I did at one time.  I
  believe it was attached to milestone 1.6.0.4, which seems to not exist
  any more.  I can manually add the code in for now but if this won't be
  in subsequent releases, then I will have to remember to add it back in
  each time I upgrade.  So I guess I'm just looking for some explanation
  on how to know when/if some code commit will be added to a future
  release.  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 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: can I get a list of event listeners on an element?

2009-08-25 Thread Rick Waldron
This question has been asked... but I've never seen a solid answer... maybe
I just missed them. But if you're using version 1.6.1_rc3 (or any version
with Element#getStorage() )



var _storage= $('element').getStorage();
console.log(
_storage._object.prototype_event_registry._object );



(assumes you have firebug (or anything that supports a console.log() )
running.)



On Tue, Aug 25, 2009 at 5:45 PM, Kevin Porter k...@9ballpool.co.uk wrote:



 Hi,

 Can I get a list of registered listeners/observers on an element?

 What I'm trying to do is dynamically replace an element with another
 element, but want to preserve the events.

 I don't want to resort to something like:

 new_element.onclick = old_element.onclick;

 as the prototype docs advise against using .onclick, .onmouseover etc.

 If prototype doesn't provide a way to do this, is there a bare JS way to
 do it (ie to get a list of events that were registered with
 addEventListener)? I googled but couldn't find this.


 regards,

 - Kev

 --
 Kevin Porter
 Advanced Web Construction Ltd
 http://webutils.co.uk
 http://billiardsearch.net
 http://9ballpool.co.uk

 AJAX Blackjack - real-time multi-player blackjack game with no flash, java
 or software downloads required - http://blackjack.webutils.co.uk



 


--~--~-~--~~~---~--~~
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: ternary operators

2009-07-30 Thread Rick Waldron
Drop the parens around the first argument.

function foo(arg) {

return $(arg) ? true : alert('Element Does not exist');  // i commented this
out: false;

}
...



On Tue, Jul 28, 2009 at 12:02 PM, Alex McAuley 
webmas...@thecarmarketplace.com wrote:


 In my usual Not enough coffee moments i just used an If/Else instead lol

 Not sure why i was trying to cut code using a tenary ...

 We live and learn

 Sorry for useless post


 Alex Mcauley
 http://www.thevacancymarket.com


 - Original Message -
 From: Jeztah webmas...@thecarmarketplace.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 28, 2009 4:51 PM
 Subject: [Proto-Scripty] ternary operators


 
  Afternoon guys
 
  Is it possible in javascript to give out 2 answers to a tenary
  opertor (doesnt make sense i know - see below)
 
  function foo(arg) {
 
  return ($(arg)) ? true : alert('Element Does not exist');false;
 
  }
  ...
  (wrapped in window loaded function)
 
  foo('baz'); // doesnt exist so i want it to alert the
  alert and return false to halt the script...
 
 
  div id=bar/div
 
 
 
  Is this the right way to do it in the operator or cant it be done
  and no i dont want to make 2 functions i would like it in one if it
  can be done.
 
  Regards
  Alex Mcauley
 
  http://www.thevacancymarket.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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: ternary operators

2009-07-30 Thread Rick Waldron
Huh?

Jeztah == Alex?

On Thu, Jul 30, 2009 at 8:37 AM, Alex McAuley 
webmas...@thecarmarketplace.com wrote:

  Sorry you missed the point i was trying to achieve.

 I wanted the operator to in essence evaluate 2 responses for example.

 alert('Element Does not exist'); alert('The second responsee');

 However it cannot be achieved so it must be done usung if/else..

 Regards

 Alex Mcauley
 http://www.thevacancymarket.com

 - Original Message -
 *From:* Rick Waldron waldron.r...@gmail.com
 *To:* prototype-scriptaculous@googlegroups.com
 *Sent:* Thursday, July 30, 2009 1:18 PM
 *Subject:* [Proto-Scripty] Re: ternary operators


 Drop the parens around the first argument.

 function foo(arg) {

 return $(arg) ? true : alert('Element Does not exist');  // i commented
 this out: false;

 }
 ...



 On Tue, Jul 28, 2009 at 12:02 PM, Alex McAuley 
 webmas...@thecarmarketplace.com wrote:


 In my usual Not enough coffee moments i just used an If/Else instead lol

 Not sure why i was trying to cut code using a tenary ...

 We live and learn

 Sorry for useless post


 Alex Mcauley
 http://www.thevacancymarket.com


  - Original Message -
 From: Jeztah webmas...@thecarmarketplace.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 28, 2009 4:51 PM
 Subject: [Proto-Scripty] ternary operators


 
  Afternoon guys
 
  Is it possible in javascript to give out 2 answers to a tenary
  opertor (doesnt make sense i know - see below)
 
  function foo(arg) {
 
  return ($(arg)) ? true : alert('Element Does not exist');false;
 
  }
  ...
  (wrapped in window loaded function)
 
  foo('baz'); // doesnt exist so i want it to alert the
  alert and return false to halt the script...
 
 
  div id=bar/div
 
 
 
  Is this the right way to do it in the operator or cant it be done
  and no i dont want to make 2 functions i would like it in one if it
  can be done.
 
  Regards
  Alex Mcauley
 
  http://www.thevacancymarket.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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: ternary operators

2009-07-30 Thread Rick Waldron
Hehe. I guess i missed that.

I read through these pretty quickly...

On Thu, Jul 30, 2009 at 2:35 PM, Alex McAuley 
webmas...@thecarmarketplace.com wrote:

  the original post is signed with my name !!
 Alex Mcauley
 http://www.thevacancymarket.com

 - Original Message -
 *From:* Rick Waldron waldron.r...@gmail.com
 *To:* prototype-scriptaculous@googlegroups.com
 *Sent:* Thursday, July 30, 2009 7:31 PM
 *Subject:* [Proto-Scripty] Re: ternary operators

 Huh?

 Jeztah == Alex?

 On Thu, Jul 30, 2009 at 8:37 AM, Alex McAuley 
 webmas...@thecarmarketplace.com wrote:

  Sorry you missed the point i was trying to achieve.

 I wanted the operator to in essence evaluate 2 responses for example.

 alert('Element Does not exist'); alert('The second responsee');

 However it cannot be achieved so it must be done usung if/else..

 Regards

 Alex Mcauley
 http://www.thevacancymarket.com

 - Original Message -
 *From:* Rick Waldron waldron.r...@gmail.com
 *To:* prototype-scriptaculous@googlegroups.com
 *Sent:* Thursday, July 30, 2009 1:18 PM
 *Subject:* [Proto-Scripty] Re: ternary operators


 Drop the parens around the first argument.

 function foo(arg) {

 return $(arg) ? true : alert('Element Does not exist');  // i commented
 this out: false;

 }
 ...



 On Tue, Jul 28, 2009 at 12:02 PM, Alex McAuley 
 webmas...@thecarmarketplace.com wrote:


 In my usual Not enough coffee moments i just used an If/Else instead
 lol

 Not sure why i was trying to cut code using a tenary ...

 We live and learn

 Sorry for useless post


 Alex Mcauley
 http://www.thevacancymarket.com


  - Original Message -
 From: Jeztah webmas...@thecarmarketplace.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 28, 2009 4:51 PM
 Subject: [Proto-Scripty] ternary operators


 
  Afternoon guys
 
  Is it possible in javascript to give out 2 answers to a tenary
  opertor (doesnt make sense i know - see below)
 
  function foo(arg) {
 
  return ($(arg)) ? true : alert('Element Does not exist');false;
 
  }
  ...
  (wrapped in window loaded function)
 
  foo('baz'); // doesnt exist so i want it to alert the
  alert and return false to halt the script...
 
 
  div id=bar/div
 
 
 
  Is this the right way to do it in the operator or cant it be done
  and no i dont want to make 2 functions i would like it in one if it
  can be done.
 
  Regards
  Alex Mcauley
 
  http://www.thevacancymarket.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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Newbee question : Compatibility with javascript 1.5

2009-07-30 Thread Rick Waldron
That sounds like fun... i like device app development. Can you tell us what
device you're working with? That will be helpful

Rick

On Thu, Jul 30, 2009 at 3:55 PM, Christophe christophe.dec...@gmail.comwrote:


 Hi there,

 Apologies to everybody if my question is offending in any way, but
 this is my first post to such a group.

 I'm a occasional user of Prototype and Scriptaculous and pretty happy
 with these tools.

 However, I'm facing an issue for which I can find any answer around:

 I created some pages that work pretty well on modern browsers such as
 FF 3 or 3.5 and Safari 3 or 4, but I'm asked to make them run on some
 special Internet devices that run only Mozilla Firefox 1.7 with
 Javascript 1.5

 So my question is : what are the requirements of Prototype 1.6 and
 Scriptaculous 1.8, will my pages run well on such an old browser.
 If not, is there an older version of Prototype and/or Scriptaculous
 that will answer my problem.

 Thanks in advance

 Christophe

 


--~--~-~--~~~---~--~~
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: selectors failing in IE8FF3 @ Colin

2009-07-29 Thread Rick Waldron
Colin,

I was just thinking about your statement:
(OTOH I wish that browsers and libraries would object to a very common
instance of invalid HTML: duplicate id's) And how much I agree. This is the
result...



(function () {
  var _domIdentities  = function () {};

  _domIdentities.prototype  = {
test: function () {
  var _error  = new Error('Duplicate element ID exists'),
  _elems  = $(document.body).select('*[id]'),
  _len= _elems.length,  _temp   = [], _i  = 0;

  for( ; _i  _len ; _i++ ) {
if ( _temp.indexOf( _elems[_i].id ) = 0 )
  throw _error + ' ' + _elems[_i].id + '';
else
  _temp.push( _elems[_i].id );
  }
}
  };
  new _domIdentities().test();
  delete _domIdentities;
})();


Nothing I'd consider perfect but I think its an interesting starting
point.

... perhaps if DOMNodeInserted and other mutation events where more widely
supported.

Just some zany ideas.




On Wed, Jul 22, 2009 at 5:31 AM, ColinFine colin.f...@pace.com wrote:




 On Jul 21, 1:52 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  Each to their own, everyone has their own coding practices and concepts.
 
 Indeed. I'm not about to start using '.' or ':' in ID's myself.

  In PHP and Perl you -could- call . a heirachial operator as it joins 2
  nodes (strings for example) together - thus jumping from one to the next
 or
  making the bridge (to assimilate them) - which is what it does in
 Javascript
  for example (kind of).

 I think this is a perverse argument, but I'm not going to get excited
 about it.

  As i said - each to their own but if CSS explicits .className as a
  classname then perhaps they should think about not having dots in ID's
  ([0-9Aa-Zz]\-_) would be a better fit for DOM element id's in my opinion.
  Classnames do not allow dots as far as i know. I would've thought the
 devs
  of JS libraries wluld have realised that perhaps 0.01% of javascript
  developers in the world would use dots and possibly didnt want the
  performance lack to accomodate these users  Just my 2 pence worth!!!
 
 I think, as Rick implied above, that the designers of CSS selectors
 were ill-advised to use symbols which were permitted in id's (I'm
 assuming that the HTML spec came before the CSS one, but I haven't
 checked). But formally, there are no contexts in which these are
 ambiguous.

 But I think it would be wrong for JS libraries to refuse to work just
 because you had made certain (valid) choices in your HTML.
 (OTOH I wish that browsers and libraries would object to a very common
 instance of invalid HTML: duplicate id's)

 


--~--~-~--~~~---~--~~
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: scriptaculous PHP help

2009-07-24 Thread Rick Waldron
Or output class=some-class in the element tags and observe the whole set
with some event delegation... will keep your markup and JS sep. and clean.



On Fri, Jul 24, 2009 at 7:59 PM, T.J. Crowder t...@crowdersoftware.comwrote:


 Hi,

  echo h2a href=\#\ onclick=\Effect.toggle('d2','BLIND',
  {duration: 2.0}); return false;\$directory/h2br //a;

 I'm not a PHP guy, but surely that ends up outputting HTML that has an
 onclick attribute calling Effect.toggle on the literal element ID
 d2?  And of course, IDs are unique in a page, so that's only ever
 going to affect one element.

 If you want to affect other elements, you'll have to give them unique
 IDs and make the call use those IDs appropriately.

 FWIW,
 --
 T.J. Crowder
 tj / crowder software / com
 Independent Software Engineer, consulting services available


 On Jul 24, 7:27 pm, dmcglone d.mcgl...@att.net wrote:
  Hi all,
 
   I am trying to create a page that reads a directory of images and
  displays them with scriptaculous. So far from what I have, the code
  does work as far as displaying the directory links but it is only
  making the very 1st one active, all the rest of the directory links on
  the page work, BUT they are expanding and folding only the first
  directory (gemstone).
 
  I hope this was a good explanation. I've posted my code to help make
  it as clear as I can.
 
  Here is my code:
 
  ?php
  echo div id = noWrap;
  echo 'div id = img_cursor';
 
  $directories = array('gemstone', 'bella', 'passage', 'sedona',
  'deepstar', 'crystalline');
 
  foreach ($directories as $directory){
 
  $mydir2=opendir(images/laminate/Wilsonart_Laminate_Colors/
  $directory);
 
  $cats2=array();
 
  echo h2a href=\#\ onclick=\Effect.toggle('d2','BLIND',
  {duration: 2.0}); return false;\$directory/h2br //a;
 
  while(($cat2=readdir($mydir2)) !==false){
 
  if ($cat2 != .  $cat2 != ..  strpos(strtolower($cat2),-
  thumb.jpg) !== false){
  array_push($cats2, $cat2);
 
  echo div id=\d2\ style=\display:none;\;
 
  echo img src='images/laminate/Wilsonart_Laminate_Colors/$directory/
  $cat2' onclick='Another_Big_One(this)'/div;
 
  }
  }
 
  closedir($mydir2);
 
  }
 
  echo /div;
  echo /div;
 
  ?
 
  Blessings
  David 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 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: selectors failing in IE8FF3

2009-07-21 Thread Rick Waldron
This is a really interesting thread...

I don't want to retract my statement, but I dont entirely agree with what i
wrote previously (it's all part of learning right ?).

I've discussed this with a respected colleague, and we both agree that just
because a spec says so doesn't make it right or best practice, to quote
him:

if i start seeing div id=iswear.iamnotaclass:honest I am going to take
my life - Al MacDonald (hyper-metrix.com  @f1lt3r)

I couldn't agree more.

























On Tue, Jul 21, 2009 at 8:52 AM, Alex McAuley 
webmas...@thecarmarketplace.com wrote:


 Each to their own, everyone has their own coding practices and concepts.

 In PHP and Perl you -could- call . a heirachial operator as it joins 2
 nodes (strings for example) together - thus jumping from one to the next or
 making the bridge (to assimilate them) - which is what it does in
 Javascript
 for example (kind of).

 As i said - each to their own but if CSS explicits .className as a
 classname then perhaps they should think about not having dots in ID's
 ([0-9Aa-Zz]\-_) would be a better fit for DOM element id's in my opinion.
 Classnames do not allow dots as far as i know. I would've thought the devs
 of JS libraries wluld have realised that perhaps 0.01% of javascript
 developers in the world would use dots and possibly didnt want the
 performance lack to accomodate these users  Just my 2 pence worth!!!


 Alex Mcauley
 Developer
 The Vacancy Market LTD
 http://www.thevacancymarket.com



 - Original Message -
 From: ColinFine colin.f...@pace.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 1:09 PM
 Subject: [Proto-Scripty] Re: selectors failing in IE8FF3





 On Jul 21, 10:42 am, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  Why would you want to use . in an id In most web programming a .
  or
  a :: means its a node or part of a class or something.
 
  This makes no sense to me why anyone would want to confuse js libraries
  and
  possible server side backends.
 
 I started out agreeing with you, then thought about it, and realised
 that I disagree quite strongly. Why shouldn't you use dots if you
 want? Different languagfe use symbols in different ways. In both Perl
 and PHP (two widely used languages for web programming) '.' is a
 concatenation operator, not a hierarchical one. It is now quite common
 to use dots between the parts of an email name, though the purists
 used to complain that the dot was supposed to denote hierarchy.

 If the HTML spec didn't allow '.', that would be different. But since
 it does you are free to use them. There's no question of 'confusing'
 js libraries or server programs unless those libraries and programs
 are wrong, in which case they ought to be fixed.




 


--~--~-~--~~~---~--~~
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: selectors failing in IE8FF3

2009-07-20 Thread Rick Waldron
Instead of changing the way the core works... and potentially causing
breakage to existing code - perhaps you might try rewriting your selector
statement with escaped periods.

This question caused me to read a bunch regarding valid id's from one html
spec to another, and then double back to css selector specs. Apparently,
they didn't compare notes...

Rick




On Mon, Jul 20, 2009 at 11:28 AM, Mona Remlawi mona.reml...@gmail.comwrote:


 You've guessed it, it's unfeasible, the amount of effort that takes
 makes my head hurt :)
 Anyway, i found the little bug in prototype (hooray!).

 IE8 and FF3 have their selectors go into 'selectorsAPI' mode, now into
 some debugging (version: 1.6.0.3)
 
 2723:  this.mode = 'selectorsAPI';
 ...
 2823:  findElements: function(root) {
 ...
 2837:  case 'selectorsAPI':
 ...
 2842:  var oldId = root.id, id = $(root).identify();
 2843:  e = # + id +   + e;
  alert(e) // you'll see how the dots are confusing
 the selector for classnames ...
 

 Now for a fix, i changed the following line in Element#identify
 
 1782:  if (id)  return id.replace(/\./g, '\\.');
 
 to escape the dots.

 with that, the unit test will succeed.

 I'm not sure if this is the best way to go around it, or if there is
 another chars for escaping, so it's in your hands now.

 Waiting for the feedback and hopefully a patch :)

 cheers

 --
 mona

 On Mon, Jul 20, 2009 at 5:06 PM, Richard
 Quadlingrquadl...@googlemail.com wrote:
 
  2009/7/20 Mona Remlawi mona.reml...@gmail.com:
 
  Hello prototypers,
 
  I'm getting a basic error (in selectors) in *IE8/FF3* and don't think
  anyone has reported it yet -- or maybe did, i searched but not
  extensively.
  The problem is that the Element#selector fails when invoked on an
  Element that has a '.' in its id.
  I've put a small unit test on pastie, you just need to get a copy of
  unittest.js from scriptaculous (and test.css if you like colors :) )
  http://pastie.org/552134
 
  Tested with both version#1.6.0.3 and version#1.6.1RC#3 with the same
 results.
 
  Any help is greatly appreciated, I'm trying to debug on my own but
  doubt i'll reach somewhere.
 
  cheers
 
  --
  mona
 
  
 
 
  I don't know how feasible it it, but maybe globally changing your IDs
  to use _ rather than . would be a quick and easy fix.
 
 
 
  --
  -
  Richard Quadling
  Zend Certified Engineer :
 http://zend.com/zce.php?c=ZEND002498r=213474731
  Standing on the shoulders of some very clever giants!
  ZOPA : http://uk.zopa.com/member/RQuadling
 
  
 

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-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: selectors failing in IE8FF3

2009-07-20 Thread Rick Waldron
I feel like i should provide more insight. That was rather vague. An ID
could be labelled a.b:c and referenced in your style sheet as #a.b:c but
as well as being the id of an element, it could mean:

id a, class b, pseudo-selector c.

Best to avoid the confusion and stay away from using . and : altogether.




On Mon, Jul 20, 2009 at 10:10 PM, Rick Waldron waldron.r...@gmail.comwrote:

 Instead of changing the way the core works... and potentially causing
 breakage to existing code - perhaps you might try rewriting your selector
 statement with escaped periods.

 This question caused me to read a bunch regarding valid id's from one html
 spec to another, and then double back to css selector specs. Apparently,
 they didn't compare notes...

 Rick





 On Mon, Jul 20, 2009 at 11:28 AM, Mona Remlawi mona.reml...@gmail.comwrote:


 You've guessed it, it's unfeasible, the amount of effort that takes
 makes my head hurt :)
 Anyway, i found the little bug in prototype (hooray!).

 IE8 and FF3 have their selectors go into 'selectorsAPI' mode, now into
 some debugging (version: 1.6.0.3)
 
 2723:  this.mode = 'selectorsAPI';
 ...
 2823:  findElements: function(root) {
 ...
 2837:  case 'selectorsAPI':
 ...
 2842:  var oldId = root.id, id = $(root).identify();
 2843:  e = # + id +   + e;
  alert(e) // you'll see how the dots are confusing
 the selector for classnames ...
 

 Now for a fix, i changed the following line in Element#identify
 
 1782:  if (id)  return id.replace(/\./g, '\\.');
 
 to escape the dots.

 with that, the unit test will succeed.

 I'm not sure if this is the best way to go around it, or if there is
 another chars for escaping, so it's in your hands now.

 Waiting for the feedback and hopefully a patch :)

 cheers

 --
 mona

 On Mon, Jul 20, 2009 at 5:06 PM, Richard
 Quadlingrquadl...@googlemail.com wrote:
 
  2009/7/20 Mona Remlawi mona.reml...@gmail.com:
 
  Hello prototypers,
 
  I'm getting a basic error (in selectors) in *IE8/FF3* and don't think
  anyone has reported it yet -- or maybe did, i searched but not
  extensively.
  The problem is that the Element#selector fails when invoked on an
  Element that has a '.' in its id.
  I've put a small unit test on pastie, you just need to get a copy of
  unittest.js from scriptaculous (and test.css if you like colors :) )
  http://pastie.org/552134
 
  Tested with both version#1.6.0.3 and version#1.6.1RC#3 with the same
 results.
 
  Any help is greatly appreciated, I'm trying to debug on my own but
  doubt i'll reach somewhere.
 
  cheers
 
  --
  mona
 
  
 
 
  I don't know how feasible it it, but maybe globally changing your IDs
  to use _ rather than . would be a quick and easy fix.
 
 
 
  --
  -
  Richard Quadling
  Zend Certified Engineer :
 http://zend.com/zce.php?c=ZEND002498r=213474731
  Standing on the shoulders of some very clever giants!
  ZOPA : http://uk.zopa.com/member/RQuadling
 
  
 

 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-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: Observing elements not working...

2009-07-16 Thread Rick Waldron
are you adding the observer after the dom is loaded?

document.observe('dom:loaded', function () [
$('btn-link-cancel').observe('click',function(){ RedBox.close(); });

});

On Thu, Jul 16, 2009 at 7:30 AM, david david.brill...@gmail.com wrote:


 Hi lun.ashis,

 One thing, because code seems to be good, is that webkit can't attach
 an event on an hidden element. But I don't know if it's still true for
 version 4.
 If it could help.

 --
 david

 On 16 juil, 10:40, lun.ashis ashis@gmail.com wrote:
  Hi guys
 
  I am facing problem with Safari 3.0.4 that element observed is
  useless, it does nothing. But it works for other browsers and also
  with the other upper version of safari.
 
  my code is
  $('btn-link-cancel').observe('click',function(){ RedBox.close(); });
 


--~--~-~--~~~---~--~~
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: Ajax Request Timeout

2009-07-15 Thread Rick

@Matt Foster: your patch didn't work for me ??

in ff i didn't get the onTimeout event  or if you get then it
happend when the server is back online
an the as often as it should happend while the offline time.

i don't know why?

i use an PeriodicalExecuter for my ajax request ...

that's how i do it without timeout:
--my apps
code---
new PeriodicalExecuter(
function (pe) {

var successListener = function(transport, json){
appendPost('posts', 
transport.responseJSON);
scrollToEnd();

//FireBUG###
console.log(Event : ,AJAX : Request 
successed);
//FireBUG###
};

var failureListener = function(transport, json){
show_alert('Fehler beim Aufbau der 
Verbindung zum Server.');

//FireBUG###
console.log(Event : ,AJAX : Request 
failed);
//FireBUG###
};

var exceptionListener = function(transport, 
json){
show_alert('Es liegt eine unbekannter 
Fehler vor.');

//FireBUG###
console.error(Event : ,AJAX : 
Request exception happend);
//FireBUG###
};

new Ajax.Request('app.php', {
method:'post',
parameters: { controller: 'check' },
onSuccess: successListener,
onException: exceptionListener,
onFailure: failureListener
});

}, 4);
---

i've used your patch an added an onTimeout event an the other stuff,
but under Firefox this event just happend when the server is back
online
under InternetExplorer it 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-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: Ajax Request Timeout

2009-07-14 Thread Rick

hi

 But leaving aside status 0, just a logical point.  The third condition
 in your updated code:

      return (status = 200  status  300  status != 0); 

 ...is irrelevant and will never be evaluated.  If 200 = x  300, x
 cannot be zero.

i can't believe what piece rubbish of code i have written, my brain
must have bin offline :'(


i think the zero comes from that part:
--- line: 1499--
  getStatus: function() {
try {
  return this.transport.status || 0;
} catch (e) { return 0 }
  }
---

so Firefox must leave the status undefined.


@ Matt Foster : i tried your patch but it didn't work for me,
but maybe its my fault ... maybe it was a bad day of coding for me :)

i will try it again  yes the Ajax part off prototype is a bit
uncomfortable


by the way sorry I am not a native English speaker, so don't be
mad with me ;)

--~--~-~--~~~---~--~~
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] Ajax Request Timeout

2009-07-13 Thread Rick

I have googled for Ajax Request Timeout, but i didn't finde a good
working solution.

These both are for most people the best solutions.

http://positionabsolute.net/blog/2008/07/prototype-ajax-request-timeout.php
http://codejanitor.com/wp/2006/03/23/ajax-timeouts-with-prototype/

But these solutions just work half, it worked under IE8 but not under
FF3

I tried to fix it my self, so i fixed the problem that under firefox,
always the onSuccess comes, even if the server is
down.

 prototype.js   line: 1494 --
  success: function() {
var status = this.getStatus();
return !status || (status = 200  status  300);
 maby the problem
  },

 prototype.js   line: 1494 changed --
  success: function() {
var status = this.getStatus();
return (status = 200  status  300  status != 0); 
works got a onFailure event, if server is down
  },


after this fix i have a correct onFailure event in FF, IE and Opera.

--~--~-~--~~~---~--~~
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: differences between mootools 'each' and Prototype 'Enumerable.each'

2009-07-11 Thread Rick Waldron
attr.edges is an array... keep it simple :)
http://jsbin.com/unohi


I just added to the last example, so view the source

Rick




On Sat, Jul 11, 2009 at 10:54 AM, ronman ron.new...@gmail.com wrote:


 It works!  Thank you muchly.  Valuable for learning, too.

 Now the code executes far enough to uncover another similar problem
 which I think will go to my basic understanding of Javascript.  I'm
 expecting it to act like PHP but I keep getting functions where I
 expect values:

 given:

 attr: {
   edges: []
 }


 initialize: function($super,cv, id, attr) {

   // attr at this point is an object.  nice.

var myedges=$H(attr.edges);
myedges.each(function(edge, id) {

   // in the first place, I didn't expect to even get here because
 myedges is an empty Hash, has no members.

  // but this shows the source code of a function!  I wanted the
 value of a member of attr.edges (if it existed).
   alert(edge);

}, this);





 On Jul 10, 4:15 pm, Rick Waldron waldron.r...@gmail.com wrote:
  The result your getting is completely correct, you're just missing one
  aspect...
  Take a look:
 
  http://jsbin.com/anefa
 
  (view source... )
 
  On Fri, Jul 10, 2009 at 4:57 PM, ronman ron.new...@gmail.com wrote:
 
   Hi,
   I've been puzzling over this for a couple of days and finally admit I
   need help.  I have a Hash of objects which I iterate over using each:
 
$H(data.nodes).each(function(mynode,id) {
alert(mynode);
// do something with mynode
  },this);
 
   What I get back for 'mynode' is
   'nodename', [object Object]
 
   instead of what I need:
   [object Object]
 
   Here's the structure of the Hash, copied from Firebug.  If there's a
   better way to represent this, let me know:
 
   data:  Object nodes=Object size=[2]
nodes:   Object node0=Object node1=Object
  node0:   Object label='node 0' height=0.44
  node1:   Object label='node 1' height=0.44
  node2:   Object label='node 2' height=0.44 width=1
  node3:   Object label='node 3' height=0.44 width=1
   .
   apparently the _each method of Hash in Prototype can't understand this
   structure, but I'm not seeing why it returns
   'nodename' and a comma before the object instead of just the object.
 
   Help!
 
   Ron
 


--~--~-~--~~~---~--~~
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: differences between mootools 'each' and Prototype 'Enumerable.each'

2009-07-10 Thread Rick Waldron
The result your getting is completely correct, you're just missing one
aspect...
Take a look:

http://jsbin.com/anefa


(view source... )


On Fri, Jul 10, 2009 at 4:57 PM, ronman ron.new...@gmail.com wrote:


 Hi,
 I've been puzzling over this for a couple of days and finally admit I
 need help.  I have a Hash of objects which I iterate over using each:

  $H(data.nodes).each(function(mynode,id) {
  alert(mynode);
  // do something with mynode
},this);


 What I get back for 'mynode' is
 'nodename', [object Object]


 instead of what I need:
 [object Object]


 Here's the structure of the Hash, copied from Firebug.  If there's a
 better way to represent this, let me know:

 data:  Object nodes=Object size=[2]
  nodes:   Object node0=Object node1=Object
node0:   Object label='node 0' height=0.44
node1:   Object label='node 1' height=0.44
node2:   Object label='node 2' height=0.44 width=1
node3:   Object label='node 3' height=0.44 width=1
 .
 apparently the _each method of Hash in Prototype can't understand this
 structure, but I'm not seeing why it returns
 'nodename' and a comma before the object instead of just the object.

 Help!

 Ron

 


--~--~-~--~~~---~--~~
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: Is Form.Element.EventObserver deprecated ?

2009-07-10 Thread Rick Waldron
$('id-of-form-element').observe('change', function () {// do stuff in here.
});

On Fri, Jul 10, 2009 at 3:33 PM, Mathew math...@gmail.com wrote:


 I don't see Form.Element.EventObserver in the API doc. Is it
 deprecated ? If not could someone provide an example of using this
 API.

 Basically the requirement is, if the drop-down list changes its value
 dy$()namically,  or re-populated dynamically then i need to invoke a
 method to populate another form control (another drop-down)



 


--~--~-~--~~~---~--~~
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: resize problem.

2009-07-01 Thread Rick Waldron
As a helpful sidenot, i think you'd benefit from NOT using onload=





script
document.observe('dom:loaded', function () {
var onResize = function(e) {
   var viewport = document.viewport.getDimensions();
   var screen = $('screen');
   var s_view = screen.getDimensions();

   screen.style.positon = 'absolute';
   screen.style.left = (viewport.width - s_view.width)/2+'px';
   screen.style.top = (viewport.height - s_view.height)/2+'px';
   };

   Element.observe(window, 'resize', onResize);
});
/script
body




On Wed, Jul 1, 2009 at 9:13 AM, serenobs seren...@gmail.com wrote:


 i used screen as a example.
 I used another word in real code.

 On 7월1일, 오후6시38분, Vladimir Tkach tea...@gmail.com wrote:
  screen its reserved word in js
 
  2009/7/1 serenobs seren...@gmail.com
 
 
 
 
 
 
 
   I missed it.
   I'm using prototype 1.6.1.RC3.
 
   On 7월1일, 오후6시08분, serenobs seren...@gmail.com wrote:
Hi again :)
 
I'm new to prototype, javascript and I got many problems
so please understand my bunch of questions :)
 
Here is my question.
I'd like to replace my div when window resized.
I coded like below:
script
function onBodyLoad() {
var onResize = function(e) {
var viewport = document.viewport.getDimensions();
var screen = $('screen');
var s_view = screen.getDimensions();
 
screen.style.positon = 'absolute';
screen.style.left = (viewport.width - s_view.width)/2+'px';
screen.style.top = (viewport.height - s_view.height)/2+'px';
};
 
Element.observe(window, 'resize', onResize);};
 
/script
body onLoad=new onBodyLoad()
 
I can see onResize was called.
But IE, viewport.width returns 0, and FF returns right number.
and both screen element doesn't move its position.
 
What's wrong with above code?
 
  --
  Best Regards,
  Vladimir Tkach
 
  +972-54-7574166
  tea...@gmail.com
 
  http://teamco-anthill.blogspot.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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: iterator.call is not a function

2009-07-01 Thread Rick Waldron
The reason you need to use an index on playlist is because select returns an
array, so... instead of using the index[0] the way you've done, you can send
it back to the el.select():


$$('div.fp_YouTube').each(function(el)  {
   var player   = el.select('.player')[0]; // --- right here!
   var playlist = el.select('.playlist li'); // also... select your li's
here, this will save you another select() call on the next line!
   playlist.each(function(video)  { // -- neater.
   console.log(video.id);
   });
});


Have a look:

http://jsbin.com/avedu


Rick




On Wed, Jul 1, 2009 at 1:37 PM, Ian R i...@fairmountfair.com wrote:



 I did check on the array situation -- it's so good and bad that
 finally turning to this forum and *writing it all down* usually solves
 the problem!

 In the above case, $(playlist).select('li').each didn't work, but
 playlist[0].select('li').each does.

 I'm not sure that I exactly LOVE how that works, but it's not
 terrible.  If there's a better way, I'd love to know about it.

 Thanks!
 Ian
 


--~--~-~--~~~---~--~~
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: determine if dom:onload has happened yet?

2009-06-29 Thread Rick Waldron
In RC 1.6.1 when you use:

document.observe('dom:loaded', function () {
 // do stuff with the DOM
});

it is executed as early as it possibly can. Inside of that, you will not
need an additional dom:loaded listener, because the dom is loaded - it only
happens once per page render. All nodes  elements you need to access in the
page will be available once this happens (as long as they actually exist).


Rick






On Mon, Jun 29, 2009 at 11:18 AM, Jonathan Rochkind rochk...@jhu.eduwrote:


 Thanks Tobie. The problem again for me is when I end up adding a
 dom:loaded listener inside a dom:loaded listener!  Since adding a
 dom:loaded callback there will cause problems, but document.loaded is
 still false at that point.

 Is this the issue that you say is fixed in RC 1.6.1?  Can you
 elucidate how?  Is dom:loaded true in that situation now?  Or will
 adding a dom:loaded callback inside an existing dom:loaded callback
 actually result in your new callback being called?

 If either of those things are true, then I agree that's sufficient to
 allow me to do what I'd like. Thanks!

 Jonathan

 On Jun 26, 7:36 pm, Tobie Langel tobie.lan...@gmail.com wrote:
  The issues you mention, Jonathan, are a bug and are fixed in the
  release candidates of 1.6.1.
 
  On the other hand, modifying the behaviour of document.observe
  ('dom:loaded', callback); after the dom:loaded event was triggered
  would cause important backwards compatibility issues.
 
  It arguably would also be a very bizarre behaviour for an event
  listener and definitely hugely inconsistant with the rest of the
  Prototype and DOM API.
 
  If you want to rely on such a behaviour, it's pretty trivial to
  implement it yourself like so:
 
  function callAsSoonAsPossible(callback) {
if (document.loaded) {
  callback();
} else {
  document.observe('dom:loaded', callback);
}
 
  }
 
  and then rely on it instead.
 
  Hope this helps.
 
  Tobie
 


--~--~-~--~~~---~--~~
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: Events in own Class

2009-06-29 Thread Rick Waldron
Dig it:


http://jsbin.com/uhogi

(view the source)



Rick




On Mon, Jun 29, 2009 at 12:19 PM, Sven stuebe...@googlemail.com wrote:


 Hi,

 is it possible to add Events to own classes?

 something like this:

 var myClass = Class.create({
foo : function(){
this.fire('bar');
}
 });

 var xyz = new MyClass();
 xyz.observe('bar', function(){alert(barbarbar);});

 rgds sven
 


--~--~-~--~~~---~--~~
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: Events in own Class

2009-06-29 Thread Rick Waldron
No problem

Rick

On Mon, Jun 29, 2009 at 12:41 PM, Sven stuebe...@googlemail.com wrote:


 wow thank you ;)

 On 29 Jun., 18:38, Rick Waldron waldron.r...@gmail.com wrote:
  Dig it:
 
  http://jsbin.com/uhogi
 
  (view the source)
 
  Rick
 
 
 
  On Mon, Jun 29, 2009 at 12:19 PM, Sven stuebe...@googlemail.com wrote:
 
   Hi,
 
   is it possible to add Events to own classes?
 
   something like this:
 
   var myClass = Class.create({
  foo : function(){
  this.fire('bar');
  }
   });
 
   var xyz = new MyClass();
   xyz.observe('bar', function(){alert(barbarbar);});
 
   rgds sven
 


--~--~-~--~~~---~--~~
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: Events in own Class

2009-06-29 Thread Rick Waldron
I think I set you on the right path... copy the code a gave you and see what
you can come up with.

Rick



On Mon, Jun 29, 2009 at 12:56 PM, Sven stuebe...@googlemail.com wrote:


 hmm but wait

 this is a global event...
 i want a instance-based event.

 xyz.foo(); //alert(barbarbar);
 abc.foo(); // alert(1234); and second $('bla').hide();

 rgds sven

 On 29 Jun., 18:41, Sven stuebe...@googlemail.com wrote:
  wow thank you ;)
 
  On 29 Jun., 18:38, Rick Waldron waldron.r...@gmail.com wrote:
 
 
 
   Dig it:
 
  http://jsbin.com/uhogi
 
   (view the source)
 
   Rick
 
   On Mon, Jun 29, 2009 at 12:19 PM, Sven stuebe...@googlemail.com
 wrote:
 
Hi,
 
is it possible to add Events to own classes?
 
something like this:
 
var myClass = Class.create({
   foo : function(){
   this.fire('bar');
   }
});
 
var xyz = new MyClass();
xyz.observe('bar', function(){alert(barbarbar);});
 
rgds sven
 


--~--~-~--~~~---~--~~
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: question from newbie, how add parameters?

2009-06-29 Thread Rick Waldron
You code was rife with syntax errors...

I posted a demo of the corrected switch statement here:

http://jsbin.com/ataka

there is also some basic event stuff to show it in action

Rick


On Mon, Jun 29, 2009 at 7:08 PM, Miguel Beltran R. yourpa...@gmail.comwrote:

 Hi list

 if have a variable like this
 switch (a){
 case 1:
vparams = {option1: 100, option2: one}break;
 case 2
vparams = {option1: 100}break;
 case n
vparams = {option1: 100, option2: one: option3: option2 }break;
 }

 vparams= {vparams, onComplete: function(){Diaglog.closeInfo();}};
 make error, show me
 Error: invalid object initializer

 hehe I need learn a lot of javascript :P
 how call this type of variable (vparams)?

 --
 
 Lo bueno de vivir un dia mas
 es saber que nos queda un dia menos de vida

 


--~--~-~--~~~---~--~~
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: question from newbie, how add parameters?

2009-06-29 Thread Rick Waldron
After the switch, add this:

vparams['your_additional_property'] = 'additional property's value';


I hope this is what you mean...


On Mon, Jun 29, 2009 at 8:16 PM, Miguel Beltran R. yourpa...@gmail.comwrote:



 2009/6/29 Rick Waldron waldron.r...@gmail.com

 You code was rife with syntax errors...

 I posted a demo of the corrected switch statement here:

 http://jsbin.com/ataka

 there is also some basic event stuff to show it in action

 Rick



 Thanks Rick, but I want know how append a option to vparams.
 this option will be the same whatever how many options before asigned
 the final result what is want is
 vparam = {option1: 100, option2:one, onComplete: function(){...}}
 or
 vparam = {option1: 100, onComplete: function(){...}}
 vparam = {option1: 100, option2:one, option3:option2, onComplete:
 function(){...}}


 


--~--~-~--~~~---~--~~
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: question from newbie, how add parameters?

2009-06-29 Thread Rick Waldron
HA! I didn't even notice that i'd not escaped my apostrophe!



On Mon, Jun 29, 2009 at 11:27 PM, T.J. Crowder t...@crowdersoftware.comwrote:


 Hi,

 FWIW, if the name of the additional property is static, then

vparams['your_additional_property'] = 'additional property\'s
 value';

 can be written:

vparams.your_additional_property = 'additional property\'s value';

 You only need the bracketed notation giving the property name as a
 string if you need to create the string at runtime or if the property
 name is a reserved word (although it works, of course, even if you're
 giving a literal string).

 FWIW,
 --
 T.J. Crowder
 tj / crowder software / com
 Independent Software Engineer, consulting services available


 On Jun 30, 1:54 am, Miguel Beltran R. yourpa...@gmail.com wrote:
  2009/6/29 Rick Waldron waldron.r...@gmail.com
 
   After the switch, add this:
 
   vparams['your_additional_property'] = 'additional property's value';
 
   I hope this is what you mean...
 
  Thanks, this help me
 


--~--~-~--~~~---~--~~
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: Prototype in salesforce development

2009-06-28 Thread Rick Waldron
Yeah dude... FirePHP is the new black! hahaha It's so nice to NEVER have to
output var_dump to the page...





On Sun, Jun 28, 2009 at 4:38 AM, T.J. Crowder t...@crowdersoftware.comwrote:


 Now that's cool!  I didn't know about FirePHP and FirePython.  I've
 added notes about them to the list of reources[1] on the unofficial
 wiki.

 [1] http://proto-scripty.wikidot.com/resources

 Thanks Rick!

 -- T.J. :-)

 On Jun 27, 4:38 pm, Rick Waldron waldron.r...@gmail.com wrote:
  This is sort of redundant to TJ, but I'm going to throw it out there...
 I'm
  not familiar with salesforce development, but firebug has a number of
  add-ons that make life so much easier allowing you to debug your server
 side
  code right in firebug:
 
  http://getfirebug.com/extensions/index.html
 
  I use FirePHP and FirePython
 
  Rick
 
  On Sat, Jun 27, 2009 at 6:47 AM, T.J. Crowder t...@crowdersoftware.com
 wrote:
 
 
 
   Hi,
 
one question, on Ajax.Updater(id, URL, optionStr), the second
 argument
is it MUST be file or can we have controller action which return
result ?
 
   It must be a URL (which is not necessarily a file, it depends on your
   server configuration).
 
   HTH,
   --
   T.J. Crowder
   tj / crowder software / com
   Independent Software Engineer, consulting services available
 
   On Jun 27, 11:16 am, Nakata Kokuyo alvincks...@gmail.com wrote:
Thanks for guidance T.J ..
 
one question, on Ajax.Updater(id, URL, optionStr), the second
 argument
is it MUST be file or can we have controller action which return
result ? Appreciated if you can show me some sample if possible ..
 
On Jun 27, 3:56 pm, T.J. Crowder t...@crowdersoftware.com wrote:
 
 Hi,
 
  alert('call 2...');
  new Ajax.updater(id, URL, optionStr);
  alert('call 3...');
 
 JavaScript is case sensitive, Ajax.updater and Ajax.Updater are not
 the same thing.
 
 Can I strongly recommend using some kind of debugger for catching
 these things, like Firebug or the IE Dev toolbar, etc.  They would
 have told you that Ajax.updater was undefined.  Some resources here
 [1].
 
 [1]http://proto-scripty.wikidot.com/resources
 
 HTH,
 --
 T.J. Crowder
 tj / crowder software / com
 Independent Software Engineer, consulting services available
 
 On Jun 27, 8:33 am, Nakata Kokuyo alvincks...@gmail.com wrote:
 
  Good day,
 
  I have a problem by running prototype in salesforce visualforce
 page,
  which i unable to understand and have some doubts
 
  Below code is intend to allow user to select drop down list and
 able
  to update div with value in drop down list.
 
  Below code only able to run and call out alert on Call 2..., it
   seem
  like ajax.updater is not calling, anyone have idea on this, what
 is
  wrong in my code?
 
  Thank you for your guidance in advance !
 
  Coding :
  [quote]
  apex:includeScript value={!$Resource.jsr_class}/
  apex:includeScript value={!$Resource.prototype}/
  apex:includeScript value={!$Resource.scriptaculous_builder}/
 
  function doTest()
  {
 
  var tempStr =
 $F('j_id0:j_id3:prm_partnername_list');
  alert(tempStr);
 
  if(tempStr != '')
  {
  alert('call 1...');
  updater('j_id0:j_id3:thePanel', '
  https://cs1.salesforce.com/apex/
  my_test?sfdc.tabName=01rS0004drs');
 
  }
  }
 
  function updater(id, URL)
  {
  var optionStr =
  {
  method : 'get',
  onSuccess : function(){
  alert('calling success');
  }
  }
 
  alert('call 2...');
  new Ajax.updater(id, URL, optionStr);
  alert('call 3...');
  }
 
  /script
 
  apex:form 
 
  table width=100% height=400 cellpadding=0
   cellspacing=0
  border=0 style=background: #F3F3EC
  tr
  td align=left valign=topnumber/td
  /tr
  tr
  td
  apex:selectList
   id=prm_partnername_list  size=1
  onchange=doTest(); 
  apex:selectOptions
   value={!partnerNameList}/
  /apex:selectList
 
  /td
 
  /tr
  /table
 
  /apex:form
  [/quote]
 
 
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post

[Proto-Scripty] Re: [ANN] Alpha version of scripty2 (script.aculo.us' next major version!) out now

2009-06-27 Thread Rick Waldron
Right... I've come to this conclusion. Anyway, one the examples here:
http://scripty2.com/doc/scripty2%20fx/element.html#morph-class_method

$('element_id').morph('width:500px;height:500px', {
  duration: 4,
  transition: '',
  delay: .5,
  propertyTransitions: {
width: 'mirror', height: 'easeInOutCirc'
  },
  after: function(){ alert('finished');  }
});


throws an error.

this.options.transition is not a function

I forked and fixed it in base.js, its commited in my git fork if you want
it.

Rick

http://github.com/rwldrn





On Sat, Jun 27, 2009 at 6:37 AM, Radoslav Stankov rstan...@gmail.comwrote:


 As far as I know scripty2 is not dropin replacements. It is a totally
 new project. As far the only 'old' effects are morph / fade / appear
 and the main change Effect variable is no logger in play.

 But a part of that it is really awesome effect engine. And as an open
 source project any one could write old Effect.* to new scripty2
 effects.
 


--~--~-~--~~~---~--~~
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: Prototype in salesforce development

2009-06-27 Thread Rick Waldron
This is sort of redundant to TJ, but I'm going to throw it out there... I'm
not familiar with salesforce development, but firebug has a number of
add-ons that make life so much easier allowing you to debug your server side
code right in firebug:

http://getfirebug.com/extensions/index.html


I use FirePHP and FirePython


Rick





On Sat, Jun 27, 2009 at 6:47 AM, T.J. Crowder t...@crowdersoftware.comwrote:


 Hi,

  one question, on Ajax.Updater(id, URL, optionStr), the second argument
  is it MUST be file or can we have controller action which return
  result ?

 It must be a URL (which is not necessarily a file, it depends on your
 server configuration).

 HTH,
 --
 T.J. Crowder
 tj / crowder software / com
 Independent Software Engineer, consulting services available


 On Jun 27, 11:16 am, Nakata Kokuyo alvincks...@gmail.com wrote:
  Thanks for guidance T.J ..
 
  one question, on Ajax.Updater(id, URL, optionStr), the second argument
  is it MUST be file or can we have controller action which return
  result ? Appreciated if you can show me some sample if possible ..
 
  On Jun 27, 3:56 pm, T.J. Crowder t...@crowdersoftware.com wrote:
 
   Hi,
 
alert('call 2...');
new Ajax.updater(id, URL, optionStr);
alert('call 3...');
 
   JavaScript is case sensitive, Ajax.updater and Ajax.Updater are not
   the same thing.
 
   Can I strongly recommend using some kind of debugger for catching
   these things, like Firebug or the IE Dev toolbar, etc.  They would
   have told you that Ajax.updater was undefined.  Some resources here
   [1].
 
   [1]http://proto-scripty.wikidot.com/resources
 
   HTH,
   --
   T.J. Crowder
   tj / crowder software / com
   Independent Software Engineer, consulting services available
 
   On Jun 27, 8:33 am, Nakata Kokuyo alvincks...@gmail.com wrote:
 
Good day,
 
I have a problem by running prototype in salesforce visualforce page,
which i unable to understand and have some doubts
 
Below code is intend to allow user to select drop down list and able
to update div with value in drop down list.
 
Below code only able to run and call out alert on Call 2..., it
 seem
like ajax.updater is not calling, anyone have idea on this, what is
wrong in my code?
 
Thank you for your guidance in advance !
 
Coding :
[quote]
apex:includeScript value={!$Resource.jsr_class}/
apex:includeScript value={!$Resource.prototype}/
apex:includeScript value={!$Resource.scriptaculous_builder}/
 
function doTest()
{
 
var tempStr = $F('j_id0:j_id3:prm_partnername_list');
alert(tempStr);
 
if(tempStr != '')
{
alert('call 1...');
updater('j_id0:j_id3:thePanel', '
 https://cs1.salesforce.com/apex/
my_test?sfdc.tabName=01rS0004drs');
 
}
}
 
function updater(id, URL)
{
var optionStr =
{
method : 'get',
onSuccess : function(){
alert('calling success');
}
}
 
alert('call 2...');
new Ajax.updater(id, URL, optionStr);
alert('call 3...');
}
 
/script
 
apex:form 
 
table width=100% height=400 cellpadding=0
 cellspacing=0
border=0 style=background: #F3F3EC
tr
td align=left valign=topnumber/td
/tr
tr
td
apex:selectList
 id=prm_partnername_list  size=1
onchange=doTest(); 
apex:selectOptions
 value={!partnerNameList}/
/apex:selectList
 
/td
 
/tr
/table
 
/apex:form
[/quote]
 
 
 


--~--~-~--~~~---~--~~
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: [ANN] Alpha version of scripty2 (script.aculo.us' next major version!) out now

2009-06-26 Thread Rick Waldron
Thomas,

Is there any specifics we should know about (things no longer available)? I
just plugged in s2.js to a page that has one element that will *shake()*

Firebug says:

$(element).shake() is not a function :\


I chose that one arbitrarily...




Rick






On Fri, Jun 26, 2009 at 9:26 AM, waldron.r...@gmail.com 
waldron.r...@gmail.com wrote:

 very exciting on my phone at the dog park and now i can't wait to get
 to the office! play time!
 -Original Message-
 Date: Friday, June 26, 2009 3:58:54 am
 To: prototype-scriptaculous@googlegroups.com
 From: Alex McAuley webmas...@thecarmarketplace.com
 Subject: [Proto-Scripty] Re: [ANN] Alpha version of scripty2 (
 script.aculo.us' next major  version!) out now


 Looks very nice, well done !
 - Original Message -
 From: madrobby tho...@fesch.at
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Friday, June 26, 2009 8:38 AM
 Subject: [Proto-Scripty] [ANN] Alpha version of scripty2 (script.aculo.us'
 next major version!) out now


 
  Hi peeps!
 
  The alpha of scripty2 is out, please head to http://scripty2.com to
  see the demos and grab a copy.
 
  Also comes with on and offline documentation (probably the most
  requested feature!), courtesy of http://pdoc.org.
 
  This first release focuses almost exclusively on the complete rewrite
  of the effects engine, which is now much more flexible and allows for
  some pretty nifty tricks (but see the demos!).
 
  Note it depends on Prototype 1.6.1_rc3 (a development copy and a
  minified version are included with the scripty2 download).
 
  Also note that the API is not final yet, and it is not 100% compatible
  with the old effects API, major changes i



--~--~-~--~~~---~--~~
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: drag and drop tr from one table to another table.

2009-06-24 Thread Rick Waldron
Can you post a link to an example?

Rick

On Wed, Jun 24, 2009 at 3:29 AM, Nivash Ramachandran rniv...@gmail.comwrote:




 Hi all,

 I am using scriptaculous drag functionality in table tr element. Now I
 am facing the following issues. I can drag a row from one table to
 another table but
 1. While i drag a row, it gets invisible from view (not visible)
 2. I applied border style for table td element but it is not working
 after creating Draggable object.

 System info:
 1. scriptaculous.js v1.8.2
 2. IE 7
 3. Vista



 by Nivash Ramachandran
 India.

 


--~--~-~--~~~---~--~~
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: drag and drop tr from one table to another table.

2009-06-24 Thread Rick Waldron
Whoops - i replied to your first message before updating the thread. Sorry
about that.

Rick

On Wed, Jun 24, 2009 at 12:57 PM, Rick Waldron waldron.r...@gmail.comwrote:

 Can you post a link to an example?

 Rick


 On Wed, Jun 24, 2009 at 3:29 AM, Nivash Ramachandran rniv...@gmail.comwrote:




 Hi all,

 I am using scriptaculous drag functionality in table tr element. Now I
 am facing the following issues. I can drag a row from one table to
 another table but
 1. While i drag a row, it gets invisible from view (not visible)
 2. I applied border style for table td element but it is not working
 after creating Draggable object.

 System info:
 1. scriptaculous.js v1.8.2
 2. IE 7
 3. Vista



 by Nivash Ramachandran
 India.

 



--~--~-~--~~~---~--~~
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: Can options in a selection box be made draggable...

2009-06-23 Thread Rick Waldron
I was nearly tempted to post a link to a w3c spec page but then Alex was
kind enough to explain. If you need an example of what Alex is talking
about:

http://weblog.morosystems.cz/ostatni/dropdown-xhtml-css-javascript-replacement-of-classic-selectbox






On Tue, Jun 23, 2009 at 9:56 AM, Alex McAuley 
webmas...@thecarmarketplace.com wrote:


 Because they are not elements or nodes they are options inside an
 element/
 node ...

 If you wanted them to become draggable you could hack some javascript
 together to take all the options from a select box, make them into elements
 which are draggable and sortable and a button or link to re-assemble the
 select box when finished.. this wouldnt be to hard.

 HTH
 Alex
 - Original Message -
 From: Avram abas...@mitre.org
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, June 23, 2009 1:56 PM
 Subject: [Proto-Scripty] Re: Can options in a selection box be made
 draggable...



 This is a just wondering.  Is there a short answer that will explain
 why the options in a selection box can't be made draggable?

 On Jun 22, 5:16 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  No !
 
 
 
  - Original Message -
  From: Avram abas...@mitre.org
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Monday, June 22, 2009 4:30 PM
  Subject: [Proto-Scripty] Can options in a selection box be made
  draggable...
 
   Can the options in a selection box be made draggable (and dropable)?-
   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 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: sessvars

2009-06-22 Thread Rick Waldron
Take a look at this demo they have posted:

http://www.thomasfrank.se/sessvarsTestPage1.html


Specifically, this:


setName=function(f){
sessvars.username=f.elements[0].value;
document.getElementById('enterYourName').style.display=none;
alert('Welcome to this test of sessvars.js, '+sessvars.username+'!');
location.href=sessvarsTestPage2.html
};


Notice they are declaring a brand new sessvar object called sessvar.username


You can add new objects at anytime.


Be sure you call in sessvars.js BEFORE prototype.

Like...

  script type=text/javascript src=sessvars.js/script
  script type=text/javascript src=prototype.js/script

In the  head


Rick



On Mon, Jun 22, 2009 at 4:06 AM, Brendan O Connor brenda...@gmail.comwrote:

 Thank you very much

 when you create your session object you use the follwing   sessvars.myObj =
 {var1:, var2:0,}

 Can you add variables to this object at a later stage or do you have to
 declare all you varaibles at this stage.







 2009/6/19 Rick Waldron waldron.r...@gmail.com

 Since no one else has replied, justly so as this is not a Prototype related
 question...

 I'm vaguely familiar with sessvars.js - what did you need help with?

 Rick



 On Fri, Jun 19, 2009 at 10:47 AM, cob brenda...@gmail.com wrote:


 Has anyone here used the sessvars lib, would like to ask a question if
 you have

 thx
 Boc






 


--~--~-~--~~~---~--~~
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: Problem using prototype.js

2009-06-19 Thread Rick Waldron
Could you post an example page?


Upon initial inspection... without delving too deep, I notice this:

Your references to the form elements are just that - not form element
values.

$('StateProvince') should be $('StateProvince').value or $F('StateProvince')
$('City') should be $('City').value or $F('City')

And anywhere you've used vanilla JS document.getElementById('') would be
better read as: $

document.getElementById = $




script: function (input_zip) { return ('http://cebsql05/
addressvalidation/default.aspx?city='+$('City')+'state='+$http://cebsql05/addressvalidation/default.aspx?city=%27+$%28%27City%27%29+%27state=%27+$
('StateProvince')+'zip='+ input_zip); },
   callback: function (obj) {
   t = obj.value.split(',');
   document.getElementById('City').value = t
[0];
   document.getElementById('ZipPostal').value = obj.info;
   setSelectedState2(t[1].replace('
',''));
   document.getElementById('Country').focus()







On Fri, Jun 19, 2009 at 6:09 AM, vincejun vince...@gmail.com wrote:


 Hi guys,

 I have downloaded the newest prototype.js 1.6 version.

 I am using AJAX:

 I have used the prototype in my page lets say newpage1.asp and its
 working fine.

 but when i bind a new page shippingandbillinginfo.asp the prototype
 does not work.

 below code is inside my newpage1.asp
 function FindOldCustomerInfo(custid){
 var url = ShippingandBillingInfo.asp;


 I was trying to capture the event focus on my second page
 (ShippingandBillingInfo.asp) but its not working, it only worked on my
 newpage1.asp

 I was trying to have this code work

 $('ZipPostal')
.observe('focus', respondToFocus2)
.observe('change', respondToChange2);

 function respondToChange2(event) {
var element = Event.element(event);
alert(element.value);
 }

 function respondToFocus2(event) {
var element = Event.element(event);
var options = {
script: function (input_zip) { return ('http://cebsql05/
 addressvalidation/default.aspx?city='+$('City')+'state='+$http://cebsql05/%0Aaddressvalidation/default.aspx?city=%27+$%28%27City%27%29+%27state=%27+$
 ('StateProvince')+'zip='+ input_zip); },
callback: function (obj) {
t = obj.value.split(',');
document.getElementById('City').value = t
 [0];
document.getElementById('ZipPostal').value = obj.info;
setSelectedState2(t[1].replace('
 ',''));
document.getElementById('Country').focus()
}
};

document.getElementById('SubmitOrder').disabled = false;
var xml=new AutoComplete('ZipPostal',options);return true;
 }

 but it wont work on the page ShippingandBillinginfo.asp

 please advice on what I should do.

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



[Proto-Scripty] Re: sessvars

2009-06-19 Thread Rick Waldron
Since no one else has replied, justly so as this is not a Prototype related
question...

I'm vaguely familiar with sessvars.js - what did you need help with?

Rick


On Fri, Jun 19, 2009 at 10:47 AM, cob brenda...@gmail.com wrote:


 Has anyone here used the sessvars lib, would like to ask a question if
 you have

 thx
 Boc
 


--~--~-~--~~~---~--~~
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: Curvy Corners + draggables (script.aculo.us)

2009-06-17 Thread Rick Waldron
Before I take a look at your issue... I have a rewrite of CurvyCorners that
i did that makes it run way faster. I was using it in a project and was
annoyed by how long it took to render the corners. I can't say its any
cleaner, but I corrected an unecessary loop. I've attched the rewrite to
this email along with an  example usage (same file, its at the bottom).




Can you post your code? http://jsbin.com


Rick







On Wed, Jun 17, 2009 at 9:58 AM, Rafael M Ximenes rmalv...@gmail.comwrote:


 Hi, everybody!

 I'm a Brazilian WebDev and I've found  a script to round corners
 without images (Script's name is Curvy Corners:
 http://www.curvycorners.net/demos/).
 I was trying to round corners of the draggables, but they lose your
 functions.

 Some help?

 Regards.
 Rafael

 


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



curvy-doesnt-suck.js
Description: JavaScript source


[Proto-Scripty] Re: Need help resolving conflict between Proto and Uize frameworks

2009-06-17 Thread Rick Waldron
Maybe I'm nuts but you're calling

setMovie() in the body tag


meanwhile... you have an Ajax.Request getting some data that will call...

setMovie() when successful



So... i suspect, that onload starts playing, then the ajax request finishes
and resets your player.

I dont recommend onload='' ever btw.

should change to:

script
document.observe('dom:loaded', function () {
 call function in here

});
/script


I think even Alex would agree with me on this particular inline event ;)


Rick

On Wed, Jun 17, 2009 at 11:55 AM, Alex McAuley 
webmas...@thecarmarketplace.com wrote:


 is it run inside a dom:loaded wrapper ?
 - Original Message -
 From: piers piersplow...@gmail.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 17, 2009 4:14 PM
 Subject: [Proto-Scripty] Need help resolving conflict between Proto and
 Uize
 frameworks


 
  I know it's probably a lousy idea but I have both prototype and uize
  referenced in the head of my document:
 
  [code]
 script type=text/javascript src=js/Uize.js/script
 script  type=text/javascript src=javascript/prototype.js/
  script
  [/code]
 
  The only time I use a prototype function in the body of the document
  is to create a function that plays a movie when a thumbnail is
  clicked.
 
  The function is:
 
  [code]
  script
  function setMovie( url, title )
  {
  $('movieHost').innerHTML = '';
  var elEmbed = document.createElement( 'embed' );
  elEmbed.src = url;
  elEmbed.setAttribute(width, 100%);
  elEmbed.setAttribute(height,100%);
  elEmbed.setAttribute(scale,aspect);
  elEmbed.setAttribute(bgcolor,black);
 
  $('movieHost').appendChild( elEmbed );
 
  $('nowPlaying').innerHTML = title;
  }
 
  new Ajax.Request( '', {
   method: 'get',
   onSuccess: function( transport ) {
 var bFirst = true;
 for( var b = 0; b  movieTags.length; b++ ) {
 
   if ( bFirst )
   {
 setMovie( url, title );
 bFirst = false;
   }
  var html = 'a href=javascript:void setMovie(\''+url+'\',\''+title
  +'\');';
   html += title+'/abr/';
 }
   }
  } );
  /script
  [/code]
 
  The only problem I'm having is that I call the function at body
  onload:
 
  [code]
  BODY onload=setMovie('Quicktimes/mov1.mov', 'Suzuki :
  quot;Fencequot;  1 of 12')
  [/code]
 
  In order that the first movie starts playing right away...
 
  And everything is fine... EXCEPT that about 10 or 15 seconds into the
  first movie it skips back to the beginning and starts playing again.
  Once it's done that everything works fine until a page reload - and
  then it plays and skips back.
 
  I've tried changing the order of the script references in the head
  section... but that breaks the uize framework.
 
  Is there some way to recode the function with absolutes?
 
  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 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Prototype and forms

2009-06-17 Thread Rick Waldron
Always nice to find your own mistakes and learn from them - well done!


On Wed, Jun 17, 2009 at 12:30 PM, anthony mrsmi...@gmail.com wrote:


 Here was the problem.

 I should have been calling the function (getAdjForm) using onComplete:

 function getTerritories() {

var params = $('createAdjForm').serialize();
 new Ajax.Updater(
territories,
?= $this-url(array('controller'='index', 'action'='get-
 territories'))?,
{method:'post',
 parameters: params,
onComplete: getAdjForm});
 }

 I have a lot to learn.

 On Jun 17, 10:54 am, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  Because the contents are from an AJAX request and they dont exist in the
  DOM probably .
  OR..
 
  They are outside the /form tag 
 
  Paste full code to a pastie and we can help
 
  - Original Message -
  From: anthony mrsmi...@gmail.com
  To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
  Sent: Wednesday, June 17, 2009 4:52 PM
  Subject: [Proto-Scripty] Re: Prototype and forms
 
  Ok, I have found a better way to explain this.
 
  var params = $('createAdjForm').serialize();
  alert(params);
 
  This does not show the form elements that were included via: div
  id=territories/div
 
  Why is that the case?
 
  On Jun 17, 9:06 am, anthony mrsmi...@gmail.com wrote:
   Thanks for the cleanup. I have made those changes. Feel free to post
   others. The problem I have is that the form had two dynamic places:
 
   div id=territories/div
   and
   div id=adjForm/div
 
   There is an onChange that calls the javascript function getTerritories
   () allows the
   div id=territories/div to display which has a form element
   called territory. At the end of the same function, it calls the other
   javascript function getAdjForm(). getAdjForm() looks to see if the
   form element territory exists. That's the problem, for some reason, it
   cannot see it. What can I do to make it where it does not fail the if
   statement in that function?
 
   On Jun 16, 11:33 am, Rick Waldron waldron.r...@gmail.com wrote:
 
A few things...
 
var params = Form.serialize($('createAdjForm'));
 
You can clean this up as:
 
var params = $('createAdjForm').serialize();
 
There are other points that you could optimize, but thats not your
question...
 
And at whatever point you want adjForm to appear, you need to add:
 
$('adjForm').show()
 
Rick
 
On Mon, Jun 15, 2009 at 5:46 PM, anthony mrsmi...@gmail.com wrote:
 
 I have a form that when a user selects something from a drop-down,
 another element in the form appears. There is another piece of the
 form, that is never showing up, I need to understand what I am
 doing
 wrong and how to fix it:
 
 script type=text/javascript language=JavaScript
 function getAdjForm() {
 
 var params = Form.serialize($('createAdjForm'));
 alert($('territory').value);
 
 if ($('adjType').value !==   $('territory').value !== ){
 
 new Ajax.Updater(
 adjForm,
 ?= $this-url(array('controller'='index',
 'action'='get-adj-
 form'))?,
 {method:'post',
 parameters: params});
 }
 }
 
 function getTerritories() {
 
 var params = Form.serialize($('createAdjForm'));
 new Ajax.Updater(
 territories,
 ?= $this-url(array('controller'='index', 'action'='get-
 territories'))?,
 {method:'post',
 parameters: params});
 
 if ($('adjType').value !== ){
 //alert('d');
 getAdjForm();
 }
 }
 
 function getCustomer() {
 
 var params = Form.serialize($('createAdjForm'));
 new Ajax.Updater(
 customer,
 ?= $this-url(array('controller'='index', 'action'='get-
 customer'))?,
 {method:'post',
 parameters: params});
 }
 
 /script
 
 form method=POST id=createAdjForm action=
 p
 
 table border=0 CELLSPACING=10
 tr
 td
 bSelect Adjustment Type/b
 /td
 td
 ?php echo $this-formSelect('adjType',
 $this-adjType, array
 (onChange=getAdjForm()), array(=Select an Adjustment
 Type) +
 $this-adjTypes) ?
 /td
 /tr
 tr
 td
 bSubmitting Territory/b
 /td
 td
 ?php echo $this-formSelect('shortTerritory',
 $this-
 shortTerritory, array(onChange=getTerritories()), array
 (=Select a Territory) + $this-shortTerritories) ?
 div id=territories/div
 /td
 /tr
 tr
 td valign=top
 bJustification/b
 /td
 td
 ?php echo
 $this-formTextarea('justification',$this-
 justification,array(rows=5,cols=75)) ?
 /td
 /tr
 /table
 hr
 div id=adjForm
 /div
 
 ***
 This issue is that the data that should be here:
 div id=adjForm
 /div
 Is never showing. When getAdjForm(); is called from
 getTerritories(),
 the $('territory').value !==  seems to be the problem. Does the
 browser

[Proto-Scripty] Re: Prototype and forms

2009-06-16 Thread Rick Waldron
A few things...


 var params = Form.serialize($('createAdjForm'));

You can clean this up as:

 var params = $('createAdjForm').serialize();

There are other points that you could optimize, but thats not your
question...


And at whatever point you want adjForm to appear, you need to add:

$('adjForm').show()


Rick


On Mon, Jun 15, 2009 at 5:46 PM, anthony mrsmi...@gmail.com wrote:


 I have a form that when a user selects something from a drop-down,
 another element in the form appears. There is another piece of the
 form, that is never showing up, I need to understand what I am doing
 wrong and how to fix it:

 script type=text/javascript language=JavaScript
 function getAdjForm() {

   var params = Form.serialize($('createAdjForm'));
 alert($('territory').value);

if ($('adjType').value !==   $('territory').value !== ){

new Ajax.Updater(
adjForm,
?= $this-url(array('controller'='index',
 'action'='get-adj-
 form'))?,
{method:'post',
parameters: params});
}
 }

 function getTerritories() {

var params = Form.serialize($('createAdjForm'));
new Ajax.Updater(
territories,
?= $this-url(array('controller'='index', 'action'='get-
 territories'))?,
{method:'post',
parameters: params});

if ($('adjType').value !== ){
//alert('d');
getAdjForm();
}
 }

 function getCustomer() {

var params = Form.serialize($('createAdjForm'));
new Ajax.Updater(
customer,
?= $this-url(array('controller'='index', 'action'='get-
 customer'))?,
{method:'post',
parameters: params});
 }

 /script

 form method=POST id=createAdjForm action=
 p

 table border=0 CELLSPACING=10
tr
td
bSelect Adjustment Type/b
/td
td
?php echo $this-formSelect('adjType',
 $this-adjType, array
 (onChange=getAdjForm()), array(=Select an Adjustment Type) +
 $this-adjTypes) ?
/td
/tr
tr
td
bSubmitting Territory/b
/td
td
?php echo $this-formSelect('shortTerritory',
 $this-
 shortTerritory, array(onChange=getTerritories()), array
 (=Select a Territory) + $this-shortTerritories) ?
div id=territories/div
/td
/tr
tr
td valign=top
bJustification/b
/td
td
?php echo
 $this-formTextarea('justification',$this-
 justification,array(rows=5,cols=75)) ?
/td
/tr
 /table
 hr
 div id=adjForm
 /div


 ***
 This issue is that the data that should be here:
 div id=adjForm
 /div
 Is never showing. When getAdjForm(); is called from getTerritories(),
 the $('territory').value !==  seems to be the problem. Does the
 browser not know that was an element because it just appeared?

 


--~--~-~--~~~---~--~~
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: element is null error on Draggable - element exists!

2009-06-16 Thread Rick Waldron
Could you set this up on http://jsbin.com/?




On Tue, Jun 16, 2009 at 2:06 PM, adamski adam.elemen...@gmail.com wrote:


 I'm having some trouble getting a Draggable to dorp onto a Droppable.
 I get the old element is null error from prototype (its trying to
 show an non-existent element).

 However, the element being dragged most definitely exists, as does the
 droppable. JS generated form Rails helpers.

 Any help much appreciated.

  Funny thing is I have just got another page on our app working really
 well with draggables and droppables. I did notice an element is null
 error on that page but it seems not to affect its functionality.

 Code excerpt is below, hope its not too long to skim through.



  div id=release-search-results-panel
div
 id=card-search-results

div style=position: relative; id=card_Issue_297 class=entity-
 search-card level1

span style=display: none; id=Issue_297_arrow
  img id=Issue_297_expanded onclick=javascript: return
 toggleWallSearchTree(297, 'Issue',false); return false; src=/images/
 icons/arrow_down.gif style=display: none; cursor: pointer;
  img id=Issue_297_collapsed onclick=javascript: return
 toggleWallSearchTree( 297,'Issue',false);return false; src=/images/
 icons/arrow_up.gif style=display: inline; cursor: pointer;
img id=loading_Issue_297
 src=/images/indicator.gif
 style=display: none;
/span
span id=Issue297_loading style=display: none;
 class=clearfix

  img src=/images/small-loading.gif
/span
I1 : test KPI

/div
script type=text/javascript
 //![CDATA[
 new Draggable(card_Issue_297, {revert:true})
 //]]
 /script

!-- IMPORTANT: span MUST be empty for JS/Ajax to work --
span id=Issue_297_children class=child-container/span

div style=position: relative; id=card_Issue_298 class=entity-
 search-card level1

span style=display: none; id=Issue_298_arrow

  img id=Issue_298_expanded onclick=javascript: return
 toggleWallSearchTree(298, 'Issue',false); return false; src=/images/
 icons/arrow_down.gif style=display: none; cursor: pointer;
  img id=Issue_298_collapsed onclick=javascript: return
 toggleWallSearchTree( 298,'Issue',false);return false; src=/images/
 icons/arrow_up.gif style=display: inline; cursor: pointer;
img id=loading_Issue_298
 src=/images/indicator.gif
 style=display: none;
/span
span id=Issue298_loading style=display: none;
 class=clearfix
  img src=/images/small-loading.gif
/span
I2 : there is an issue here

/div
script type=text/javascript
 //![CDATA[
 new Draggable(card_Issue_298, {revert:true})
 //]]
 /script

div style=position: relative;
 id=release-iterations-panel
preleases/iterations../p
/div
script type=text/javascript
 //![CDATA[
 Droppables.add(release-iterations-panel, {after_effect:Element.hide,
 before_effect:Element.show, onDrop:function(element){Element.show
 ('indicator'); new Ajax.Request('/releases/add_item',
 {asynchronous:true, evalScripts:true, onComplete:function(request)
 {Element.hide('indicator')}, parameters:'id=' + encodeURIComponent
 (element.id) + 'authenticity_token=' + encodeURIComponent
 ('acaa102f216e113331509e9d9e7ef3c6418267e7')})}})
 //]]
 /script


 


--~--~-~--~~~---~--~~
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: Effect.toggle('BLIND'); select by class not id

2009-06-12 Thread Rick Waldron
Try this:


a href=javascript:; id=toggleswitchToggle Blind/a

Below goes in a script tag in the head

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

  $('toggleswitch').observe('click', function () {
$$('.class2').each(function (d) {
  Effect.toggle(d, 'blind');
});
  });

});






On Fri, Jun 12, 2009 at 7:47 AM, Gatsman jgats...@gmail.com wrote:


 Hi
 is it possible to select a Element by it’s class?
 I want to blind 2 div with one click and id are unique.

 for Example:
 a href=# onclick=Effect.toggle('class2','BLIND'); return
 false;Toggle blind/a
 div id=d2 class=”class2” style=display:none;div
 ptext/p
 /div/div

 Thanks,
 regards John

 


--~--~-~--~~~---~--~~
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: setOpacity issue

2009-06-12 Thread Rick Waldron
I'm developing a library that will allow this sort of syntax. Actually, it
allows you write jQuery syntax in Prototype, giving $() that power of $$()

I've created a use case of your question.

http://genevajs.com/demos/demo-set-opacity.php

If you view source on the page, you'll see i'm calling prototype.js and
genevajs (this is MY version, its filled with JUNK, please do not use this).
GenevaJS allows me to write jQuery syntax in the Prototype environment.
Compressed and g-zipped it comes it at 3k

Rick




On Fri, Jun 12, 2009 at 3:11 AM, Alex McAuley 
webmas...@thecarmarketplace.com wrote:


 .. which if you want a quick answer would be ...

 $$('img.alpha').each(function(element) {

$(element).setOpacity(0.5);

 });

 - Original Message -
 From: T.J. Crowder t...@crowdersoftware.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Friday, June 12, 2009 8:07 AM
 Subject: [Proto-Scripty] Re: setOpacity issue



 Hi,

  $$('img.alpha').setOpacity(0.5);

 $$ returns an array[1][2], and arrays don't have a setOpacity method.
 You want to call the setOpacity method on each element in the array,
 which you can do in a variety of ways thanks to Prototype's Enumerable
 [3] mix-in, which it mixes in with arrays.  In this case, probably
 Enumerable#invoke[4].

 [1] http://prototypejs.org/api/array
 [2]

 https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array
 [3] http://prototypejs.org/api/enumerable
 [4] http://prototypejs.org/api/enumerable/invoke

 HTH!
 --
 T.J. Crowder
 tj / crowder software / com
 Independent Software Engineer, consulting services available


 On Jun 12, 12:28 am, Brown Freelance sc...@brownfreelance.com wrote:
  Not sure what I'm doing wrong here but here is my problem:
 
  I have a few images that I want to display with 50% opacity. I've
  given these images the class name of alpha.
 
  Example:
  img src=../images/snapshots/thumbs/gma_x158.gif alt=Greg Martin
  Auctions width=156 height=118 class=alpha /
 
  Then, after the body tag I have:
  script language=javascript type=text/javascript
  $$('img.alpha').setOpacity(0.5);
  /script
 
  This does not work for me. It dose work however work if I give the img
  element an ID but that of course is not valid CSS if I use more then
  one and I would rather not give each img their own ID.
 
  Any help would be greatly appreciated.
 
  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 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: setOpacity issue

2009-06-12 Thread Rick Waldron
TJ,

Al MacDonald of Processing.js used GenevaJS in a presentation last night...
he wanted to use Box2D.js (a prototype extension) but he's not familiar with
Prototype syntax... anyway its now posted on our site, with links to his
presentation.

I dont see it as a tool for people making the move... no movement at all. I
see it as a tool to reduce the amount of code we're writing. Or perhaps for
a jQuery developer that gets a job at a prototype shop... there are many
scenarios. We're planning on meeting with the Boston Rails Group soon to
discuss working with them to build it into Rails as a helper to prototype...
as I mentioned it gzips to 3k.

Also - GenevaJS is sideways compatible, for example:

$('.classname').eq(1).highlight();

eq(1) - jquery method for showing the element at index 1 of $('.classname'),
it will get highlight()'ed from effects.js

(yeah... that example is super simple.. but i've been doing some zany stuff,
which i intend to post)

Anyway, that example:
http://genevajs.com/demos/demo-box2d.php


I've made us way off topic. sorry about that. anyone with questions can
email me directly.

Rick




On Fri, Jun 12, 2009 at 11:08 AM, T.J. Crowder t...@crowdersoftware.comwrote:


 Hi Rick,

 Sounds cool for people making the move over, or more importantly
 trying to use/port jQuery plug-ins for use in Prototype.

 I think I'd suggest anyone writing *new* code use the native API
 unless they expect to ditch Prototype for jQuery. :-)  But very cool
 for other purposes!

 -- T.J. :-)

 On Jun 12, 3:33 pm, Rick Waldron waldron.r...@gmail.com wrote:
  I'm developing a library that will allow this sort of syntax. Actually,
 it
  allows you write jQuery syntax in Prototype, giving $() that power of
 $$()
 
  I've created a use case of your question.
 
  http://genevajs.com/demos/demo-set-opacity.php
 
  If you view source on the page, you'll see i'm calling prototype.js and
  genevajs (this is MY version, its filled with JUNK, please do not use
 this).
  GenevaJS allows me to write jQuery syntax in the Prototype environment.
  Compressed and g-zipped it comes it at 3k
 
  Rick
 
  On Fri, Jun 12, 2009 at 3:11 AM, Alex McAuley 
 
  webmas...@thecarmarketplace.com wrote:
 
   .. which if you want a quick answer would be ...
 
   $$('img.alpha').each(function(element) {
 
  $(element).setOpacity(0.5);
 
   });
 
   - Original Message -
   From: T.J. Crowder t...@crowdersoftware.com
   To: Prototype  script.aculo.us 
   prototype-scriptaculous@googlegroups.com
   Sent: Friday, June 12, 2009 8:07 AM
   Subject: [Proto-Scripty] Re: setOpacity issue
 
   Hi,
 
$$('img.alpha').setOpacity(0.5);
 
   $$ returns an array[1][2], and arrays don't have a setOpacity method.
   You want to call the setOpacity method on each element in the array,
   which you can do in a variety of ways thanks to Prototype's Enumerable
   [3] mix-in, which it mixes in with arrays.  In this case, probably
   Enumerable#invoke[4].
 
   [1]http://prototypejs.org/api/array
   [2]
 
  https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global.
 ..
   [3]http://prototypejs.org/api/enumerable
   [4]http://prototypejs.org/api/enumerable/invoke
 
   HTH!
   --
   T.J. Crowder
   tj / crowder software / com
   Independent Software Engineer, consulting services available
 
   On Jun 12, 12:28 am, Brown Freelance sc...@brownfreelance.com wrote:
Not sure what I'm doing wrong here but here is my problem:
 
I have a few images that I want to display with 50% opacity. I've
given these images the class name of alpha.
 
Example:
img src=../images/snapshots/thumbs/gma_x158.gif alt=Greg Martin
Auctions width=156 height=118 class=alpha /
 
Then, after the body tag I have:
script language=javascript type=text/javascript
$$('img.alpha').setOpacity(0.5);
/script
 
This does not work for me. It dose work however work if I give the
 img
element an ID but that of course is not valid CSS if I use more then
one and I would rather not give each img their own ID.
 
Any help would be greatly appreciated.
 
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 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: setOpacity issue

2009-06-12 Thread Rick Waldron
Geneva Switzerland? It was named after this city. The idea being its a
convention between two super powers :)


Rick



On Fri, Jun 12, 2009 at 5:25 PM, Tobie Langel tobie.lan...@gmail.comwrote:


 GenevaJS ? IS there any relation to my homwtown ? Or is that purely
 coincidental?

 Best,

 Tobie

 On Jun 12, 7:45 pm, Rick Waldron waldron.r...@gmail.com wrote:
  TJ,
 
  Al MacDonald of Processing.js used GenevaJS in a presentation last
 night...
  he wanted to use Box2D.js (a prototype extension) but he's not familiar
 with
  Prototype syntax... anyway its now posted on our site, with links to his
  presentation.
 
  I dont see it as a tool for people making the move... no movement at all.
 I
  see it as a tool to reduce the amount of code we're writing. Or perhaps
 for
  a jQuery developer that gets a job at a prototype shop... there are many
  scenarios. We're planning on meeting with the Boston Rails Group soon to
  discuss working with them to build it into Rails as a helper to
 prototype...
  as I mentioned it gzips to 3k.
 
  Also - GenevaJS is sideways compatible, for example:
 
  $('.classname').eq(1).highlight();
 
  eq(1) - jquery method for showing the element at index 1 of
 $('.classname'),
  it will get highlight()'ed from effects.js
 
  (yeah... that example is super simple.. but i've been doing some zany
 stuff,
  which i intend to post)
 
  Anyway, that example:http://genevajs.com/demos/demo-box2d.php
 
  I've made us way off topic. sorry about that. anyone with questions can
  email me directly.
 
  Rick
 
  On Fri, Jun 12, 2009 at 11:08 AM, T.J. Crowder t...@crowdersoftware.com
 wrote:
 
 
 
   Hi Rick,
 
   Sounds cool for people making the move over, or more importantly
   trying to use/port jQuery plug-ins for use in Prototype.
 
   I think I'd suggest anyone writing *new* code use the native API
   unless they expect to ditch Prototype for jQuery. :-)  But very cool
   for other purposes!
 
   -- T.J. :-)
 
   On Jun 12, 3:33 pm, Rick Waldron waldron.r...@gmail.com wrote:
I'm developing a library that will allow this sort of syntax.
 Actually,
   it
allows you write jQuery syntax in Prototype, giving $() that power of
   $$()
 
I've created a use case of your question.
 
   http://genevajs.com/demos/demo-set-opacity.php
 
If you view source on the page, you'll see i'm calling prototype.js
 and
genevajs (this is MY version, its filled with JUNK, please do not use
   this).
GenevaJS allows me to write jQuery syntax in the Prototype
 environment.
Compressed and g-zipped it comes it at 3k
 
Rick
 
On Fri, Jun 12, 2009 at 3:11 AM, Alex McAuley 
 
webmas...@thecarmarketplace.com wrote:
 
 .. which if you want a quick answer would be ...
 
 $$('img.alpha').each(function(element) {
 
$(element).setOpacity(0.5);
 
 });
 
 - Original Message -
 From: T.J. Crowder t...@crowdersoftware.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Friday, June 12, 2009 8:07 AM
 Subject: [Proto-Scripty] Re: setOpacity issue
 
 Hi,
 
  $$('img.alpha').setOpacity(0.5);
 
 $$ returns an array[1][2], and arrays don't have a setOpacity
 method.
 You want to call the setOpacity method on each element in the
 array,
 which you can do in a variety of ways thanks to Prototype's
 Enumerable
 [3] mix-in, which it mixes in with arrays.  In this case, probably
 Enumerable#invoke[4].
 
 [1]http://prototypejs.org/api/array
 [2]
 

 https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global.
   ..
 [3]http://prototypejs.org/api/enumerable
 [4]http://prototypejs.org/api/enumerable/invoke
 
 HTH!
 --
 T.J. Crowder
 tj / crowder software / com
 Independent Software Engineer, consulting services available
 
 On Jun 12, 12:28 am, Brown Freelance sc...@brownfreelance.com
 wrote:
  Not sure what I'm doing wrong here but here is my problem:
 
  I have a few images that I want to display with 50% opacity. I've
  given these images the class name of alpha.
 
  Example:
  img src=../images/snapshots/thumbs/gma_x158.gif alt=Greg
 Martin
  Auctions width=156 height=118 class=alpha /
 
  Then, after the body tag I have:
  script language=javascript type=text/javascript
  $$('img.alpha').setOpacity(0.5);
  /script
 
  This does not work for me. It dose work however work if I give
 the
   img
  element an ID but that of course is not valid CSS if I use more
 then
  one and I would rather not give each img their own ID.
 
  Any help would be greatly appreciated.
 
  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

[Proto-Scripty] Re: Effect.toggle('BLIND'); select by class not id

2009-06-12 Thread Rick Waldron
The way i shared with you allows you to do this task without repeating
without repeating the code.


Yes... i did that on purpose.



On Fri, Jun 12, 2009 at 10:49 AM, Gatsman jgats...@gmail.com wrote:


 Thanks Rick but I found an other way 2 minutes ago

 I added this under the head
 script type=text/javascript
 function blind1(){
 Effect.toggle('id 1 here','BLIND'); return false;
 }

 function blind2(){
 Effect.toggle('id 2 here','BLIND'); return false;
 }
 /script

 And loaded the functions onclick
 a href=# onclick=blind1(); blindgr2;Click Me/a

 Thanks again for your time

 


--~--~-~--~~~---~--~~
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: Event.toggle

2009-06-05 Thread Rick Waldron
Alex is right ... I would even suggest not using Event.observe(window,
'load', function() {}); for this application at all...


you can wrap all those other event handlers in one big

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

all your stuff goes here.

});







On Fri, Jun 5, 2009 at 6:18 AM, Alex McAuley 
webmas...@thecarmarketplace.com wrote:


 You dont need all those Event.observe(window one will do !!!...


 If you want to toggle something after some time just do something like

 var timerOuting=setTimeout(function() {
 $('foo').toggle;

 },5000); // 5 seconds

 will toggle foo after 5 seconds of window loading if you put it in a
 wrapper


 - Original Message -
 From: MIGhunter ad...@botdls.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Friday, June 05, 2009 10:22 AM
 Subject: [Proto-Scripty] Re: Event.toggle


 
  Couldn't find the edit button.
 
  Here is an easier to read markup page:
 http://paste.windower.net/fb6f0e0c
 
  
 


 


--~--~-~--~~~---~--~~
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: Event.toggle

2009-06-05 Thread Rick Waldron
Simple fix, you need to put those observers inside the proper
document.observe('dom:loaded') block for them to actually know when and what
to start observing.

i posted your demo - fixed:

http://www.genevajs.com/misc/demo-ps-list-0013.php

cope/paste as needed. be sure to update the script tags... those paths are
my paths, i thinkyours were /javascripts/lib/ and /javascripts/src/


Rick


On Fri, Jun 5, 2009 at 9:00 PM, MIGhunter ad...@botdls.com wrote:


 Nothing I do seems to be working with IE.  I thought that prototype/
 scriptaculous was supposed to fix IE's retardedness.

 I tried using the following code.  It works for FF but not IE:
 http://paste.windower.net/f3dd16107

 html
 head
titleMove Test/title
 meta http-equiv=Content-Type content=text/html;
 charset=utf-8 /
 
meta name=viewport content=initial-scale=1.0,
 user-scalable=no /
 
script src=/javascripts/lib/prototype.js
 type=text/javascript/
 script
script src=/javascripts/src/scriptaculous.js type=text/
 javascript/script
script type=text/javascript src=
 http://maps.google.com/maps/api/
 js?sensor=true http://maps.google.com/maps/api/%0Ajs?sensor=true
 /script
script type=text/javascript
   function initialize() {
var latlng = new google.maps.LatLng(39.1485520,
 -86.5857814);
var myOptions = {
  zoom: 13,
  center: latlng,
  mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new
 google.maps.Map(document.getElementById
 (map_canvas), myOptions);
  }

/script
 /head
 body onload=initialize()

 div id=parallel_demo style=position:relative; left: -1000px;div
 id=map_canvas style=width:75%; height:75%/div/div
 ul
  lia href=# id=animate_parallel_demoShow the Map/a/li
  lia href=# id=reset_parallel_demoHide the map/a/li
 /ul
 /div

 script type=text/javascript
 $('animate_parallel_demo').observe('click', function(event) {
  event.stop();

  new Effect.Parallel([
new Effect.Move('parallel_demo', { sync: true, x: 1000, y: 0,
 mode: 'relative' }),
new Effect.Opacity('parallel_demo', { sync: true, from: 0, to:
 1 })
  ], {
duration: 1.5
  });
 });

 $('reset_parallel_demo').observe('click', function(event) {
  event.stop();

  $('parallel_demo').setStyle({
top: 0,
left: -200,
opacity: 0
  });
 });
 /script


 /body
 /html


 On Jun 5, 2:59 pm, Matt Foster mattfoste...@gmail.com wrote:
Is there a way to initially load the page with the map open
   and then close it after a timed period?  Better yet, is there some way
   to load it with it hidden but not chopped up?
 
  Yeah, having it display:none or visibility:hidden can muck up the
  calculations of the containers dimensions.  I'd suggest the good ole
  trick of hiding IFrames, which is just set the container as
  { position:absolute; left: -4000px; }  This way the map is off the
  view port hence invisible to the user and yet fully accessible via
  the DOM for dimension calculations.
 
  Thinking more about it, you may not want to instantiate the map until
  you're ready, nothing says it has to be done on page load, I had done
  some work with Ext.js and Google maps, where Ext does the DOM element
  creation all via JS execution, i loaded the map only when it was
  necessary.
 
  http://positionabsolute.net/projects/javascript/ext/googleservice/
 
  --
 
  http://positionabsolute.net
 
  On Jun 5, 5:09 am, MIGhunter ad...@botdls.com wrote:
 
   I'm trying to use a script to hide and show user information.  Right
   now I am just playing with it and here is what I have:
 http://migcfdesign.com/joani/index.html
 
   The problem is the map.
   I can't load the page with the map hidden.  If I do chops off 1/2 of
   the map.  Is there a way to initially load the page with the map open
   and then close it after a timed period?  Better yet, is there some way
   to load it with it hidden but not chopped up?  I'm not sure what's the
   conflict is between google's js and prototype.js.
   The url to a copy of the map messing up is:
 http://migcfdesign.com/joani/index2.html
 
   Here is the code I am using:
   html
   head
   titleToggle Test/title
   meta http-equiv=Content-Type content=text/html;
 charset=utf-8 /
 
   meta name=viewport content=initial-scale=1.0,
 user-scalable=no /
 
   script src=/javascripts/lib/prototype.js
 type=text/javascript/
   script
   script src=/javascripts/src/scriptaculous.js
 type=text/
   javascript/script
   script type=text/javascript src=
 http://maps.google.com/maps/api/
   js?sensor=true/script
   script type=text/javascript
   Event.observe(window, 'load', function

[Proto-Scripty] Re: Event.toggle

2009-06-05 Thread Rick Waldron
Sorry, should've explained why IE is so dumb... Firefox knows to wait to
execute, but it doesnt know everything all the time, so its safer to wrap
everything in the document.observe(). IE doesnt know anything at all and
tries to execute as the page loads... so if you start observing elements
that arent there, IE basically says: 'tough shit'


Good luck!


On Fri, Jun 5, 2009 at 9:24 PM, Rick Waldron waldron.r...@gmail.com wrote:

 Simple fix, you need to put those observers inside the proper
 document.observe('dom:loaded') block for them to actually know when and what
 to start observing.

 i posted your demo - fixed:

 http://www.genevajs.com/misc/demo-ps-list-0013.php

 cope/paste as needed. be sure to update the script tags... those paths
 are my paths, i thinkyours were /javascripts/lib/ and /javascripts/src/


 Rick



 On Fri, Jun 5, 2009 at 9:00 PM, MIGhunter ad...@botdls.com wrote:


 Nothing I do seems to be working with IE.  I thought that prototype/
 scriptaculous was supposed to fix IE's retardedness.

 I tried using the following code.  It works for FF but not IE:
 http://paste.windower.net/f3dd16107

 html
 head
titleMove Test/title
 meta http-equiv=Content-Type content=text/html;
 charset=utf-8 /
 
meta name=viewport content=initial-scale=1.0,
 user-scalable=no /
 
script src=/javascripts/lib/prototype.js
 type=text/javascript/
 script
script src=/javascripts/src/scriptaculous.js type=text/
 javascript/script
script type=text/javascript src=
 http://maps.google.com/maps/api/
 js?sensor=true http://maps.google.com/maps/api/%0Ajs?sensor=true
 /script
script type=text/javascript
   function initialize() {
var latlng = new google.maps.LatLng(39.1485520,
 -86.5857814);
var myOptions = {
  zoom: 13,
  center: latlng,
  mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new
 google.maps.Map(document.getElementById
 (map_canvas), myOptions);
  }

/script
 /head
 body onload=initialize()

 div id=parallel_demo style=position:relative; left: -1000px;div
 id=map_canvas style=width:75%; height:75%/div/div
 ul
  lia href=# id=animate_parallel_demoShow the Map/a/li
  lia href=# id=reset_parallel_demoHide the map/a/li
 /ul
 /div

 script type=text/javascript
 $('animate_parallel_demo').observe('click', function(event) {
  event.stop();

  new Effect.Parallel([
new Effect.Move('parallel_demo', { sync: true, x: 1000, y: 0,
 mode: 'relative' }),
new Effect.Opacity('parallel_demo', { sync: true, from: 0, to:
 1 })
  ], {
duration: 1.5
  });
 });

 $('reset_parallel_demo').observe('click', function(event) {
  event.stop();

  $('parallel_demo').setStyle({
top: 0,
left: -200,
opacity: 0
  });
 });
 /script


 /body
 /html


 On Jun 5, 2:59 pm, Matt Foster mattfoste...@gmail.com wrote:
Is there a way to initially load the page with the map open
   and then close it after a timed period?  Better yet, is there some way
   to load it with it hidden but not chopped up?
 
  Yeah, having it display:none or visibility:hidden can muck up the
  calculations of the containers dimensions.  I'd suggest the good ole
  trick of hiding IFrames, which is just set the container as
  { position:absolute; left: -4000px; }  This way the map is off the
  view port hence invisible to the user and yet fully accessible via
  the DOM for dimension calculations.
 
  Thinking more about it, you may not want to instantiate the map until
  you're ready, nothing says it has to be done on page load, I had done
  some work with Ext.js and Google maps, where Ext does the DOM element
  creation all via JS execution, i loaded the map only when it was
  necessary.
 
  http://positionabsolute.net/projects/javascript/ext/googleservice/
 
  --
 
  http://positionabsolute.net
 
  On Jun 5, 5:09 am, MIGhunter ad...@botdls.com wrote:
 
   I'm trying to use a script to hide and show user information.  Right
   now I am just playing with it and here is what I have:
 http://migcfdesign.com/joani/index.html
 
   The problem is the map.
   I can't load the page with the map hidden.  If I do chops off 1/2 of
   the map.  Is there a way to initially load the page with the map open
   and then close it after a timed period?  Better yet, is there some way
   to load it with it hidden but not chopped up?  I'm not sure what's the
   conflict is between google's js and prototype.js.
   The url to a copy of the map messing up is:
 http://migcfdesign.com/joani/index2.html
 
   Here is the code I am using:
   html
   head
   titleToggle Test/title
   meta http-equiv=Content-Type content=text/html;
 charset=utf-8 /
 
   meta name=viewport content=initial-scale=1.0

[Proto-Scripty] Re: Event.toggle

2009-06-05 Thread Rick Waldron
Whoops! Also... IE collapsed your wrapper div. i put 75% on that and then
100% on the inner div - worked like a charm.

On Fri, Jun 5, 2009 at 9:27 PM, Rick Waldron waldron.r...@gmail.com wrote:

 Sorry, should've explained why IE is so dumb... Firefox knows to wait to
 execute, but it doesnt know everything all the time, so its safer to wrap
 everything in the document.observe(). IE doesnt know anything at all and
 tries to execute as the page loads... so if you start observing elements
 that arent there, IE basically says: 'tough shit'


 Good luck!



 On Fri, Jun 5, 2009 at 9:24 PM, Rick Waldron waldron.r...@gmail.comwrote:

 Simple fix, you need to put those observers inside the proper
 document.observe('dom:loaded') block for them to actually know when and what
 to start observing.

 i posted your demo - fixed:

 http://www.genevajs.com/misc/demo-ps-list-0013.php

 cope/paste as needed. be sure to update the script tags... those paths
 are my paths, i thinkyours were /javascripts/lib/ and /javascripts/src/


 Rick



 On Fri, Jun 5, 2009 at 9:00 PM, MIGhunter ad...@botdls.com wrote:


 Nothing I do seems to be working with IE.  I thought that prototype/
 scriptaculous was supposed to fix IE's retardedness.

 I tried using the following code.  It works for FF but not IE:
 http://paste.windower.net/f3dd16107

 html
 head
titleMove Test/title
 meta http-equiv=Content-Type content=text/html;
 charset=utf-8 /
 
meta name=viewport content=initial-scale=1.0,
 user-scalable=no /
 
script src=/javascripts/lib/prototype.js
 type=text/javascript/
 script
script src=/javascripts/src/scriptaculous.js
 type=text/
 javascript/script
script type=text/javascript src=
 http://maps.google.com/maps/api/
 js?sensor=true http://maps.google.com/maps/api/%0Ajs?sensor=true
 /script
script type=text/javascript
   function initialize() {
var latlng = new google.maps.LatLng(39.1485520,
 -86.5857814);
var myOptions = {
  zoom: 13,
  center: latlng,
  mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new
 google.maps.Map(document.getElementById
 (map_canvas), myOptions);
  }

/script
 /head
 body onload=initialize()

 div id=parallel_demo style=position:relative; left: -1000px;div
 id=map_canvas style=width:75%; height:75%/div/div
 ul
  lia href=# id=animate_parallel_demoShow the Map/a/li
  lia href=# id=reset_parallel_demoHide the map/a/li
 /ul
 /div

 script type=text/javascript
 $('animate_parallel_demo').observe('click', function(event) {
  event.stop();

  new Effect.Parallel([
new Effect.Move('parallel_demo', { sync: true, x: 1000, y: 0,
 mode: 'relative' }),
new Effect.Opacity('parallel_demo', { sync: true, from: 0, to:
 1 })
  ], {
duration: 1.5
  });
 });

 $('reset_parallel_demo').observe('click', function(event) {
  event.stop();

  $('parallel_demo').setStyle({
top: 0,
left: -200,
opacity: 0
  });
 });
 /script


 /body
 /html


 On Jun 5, 2:59 pm, Matt Foster mattfoste...@gmail.com wrote:
Is there a way to initially load the page with the map open
   and then close it after a timed period?  Better yet, is there some
 way
   to load it with it hidden but not chopped up?
 
  Yeah, having it display:none or visibility:hidden can muck up the
  calculations of the containers dimensions.  I'd suggest the good ole
  trick of hiding IFrames, which is just set the container as
  { position:absolute; left: -4000px; }  This way the map is off the
  view port hence invisible to the user and yet fully accessible via
  the DOM for dimension calculations.
 
  Thinking more about it, you may not want to instantiate the map until
  you're ready, nothing says it has to be done on page load, I had done
  some work with Ext.js and Google maps, where Ext does the DOM element
  creation all via JS execution, i loaded the map only when it was
  necessary.
 
  http://positionabsolute.net/projects/javascript/ext/googleservice/
 
  --
 
  http://positionabsolute.net
 
  On Jun 5, 5:09 am, MIGhunter ad...@botdls.com wrote:
 
   I'm trying to use a script to hide and show user information.  Right
   now I am just playing with it and here is what I have:
 http://migcfdesign.com/joani/index.html
 
   The problem is the map.
   I can't load the page with the map hidden.  If I do chops off 1/2 of
   the map.  Is there a way to initially load the page with the map open
   and then close it after a timed period?  Better yet, is there some
 way
   to load it with it hidden but not chopped up?  I'm not sure what's
 the
   conflict is between google's js and prototype.js.
   The url to a copy of the map messing up is:
 http://migcfdesign.com/joani/index2.html
 
   Here is the code I am using

[Proto-Scripty] Re: Working outside loop, but not inside

2009-06-04 Thread Rick Waldron
A quick google for php single quotes vs double quotes will help you
understand the difference and what it means to the overhead and scalability
of your code. I picked this article from said google results:

http://andrewgatenby.com/single-quotes-and-double-quotes-in-php



@Alex,
I honestly can't think of any scenario where it is ok to use inline
handlers, but I'm definitely interested in hearing your argument regarding
them. I'm of the belief that complete separation of logic is imperative and
should be regarded as best practice (or even, only practice)... thoughts?

@Craig,
Apparently Effect.toggle() does not like the element chained to it... odd.
Anyway, you can improve this much further I've posted a demo.
http://genevajs.com/misc/demo-ps-list-0010.php





Rick

--~--~-~--~~~---~--~~
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: Working outside loop, but not inside

2009-06-04 Thread Rick Waldron
Yeah, i discovered the same gotcha...

the JS should actually look like this:

document.observe('dom:loaded', function () {
  $$('.blinders').each(function (b) {

b.observe('click', function () {
  Effect.toggle(this.next(), 'blind');
  // or like this if you used the second version posted:
Effect.toggle(this.down(), 'blind');
});
  });
});

On Thu, Jun 4, 2009 at 3:31 PM, craig bagley.cr...@gmail.com wrote:


 I've implemented what Rick (Thank You!) suggested, and it seems to
 have solved the recognition problem.  The only minor problem I'm still
 having is that instead of a sliding effect, the div just abruptly
 appears without sliding.  It's as if it knows the div needs to be
 displayed onclick, but not that it should call a slide.  I'm assuming
 its because I'm just using script tags as opposed to pasting that
 into one of the js files.  Which file should I be putting it in?  I
 examined the scriptaculous and prototype files for similar looking
 code, but being a supernoob I'm reluctant to just throw it in
 there.

 On Jun 4, 2:29 pm, Rick Waldron waldron.r...@gmail.com wrote:
  @Alex,
 
  I think i met all of your criteria:
 http://genevajs.com/misc/demo-ps-list-0011.php
 
  i left the js in the main file so you could reference. dig it.
 
  Rick
 
  On Thu, Jun 4, 2009 at 12:20 PM, Alex McAuley 
 
  webmas...@thecarmarketplace.com wrote:
@Rick -- Okay here is a good one.
 
   A very dynamic site where you need to pull varying variables
   -- excuse the psudeo code !! just proving its needed sometimes !!
 
   funciton doSomething({options}) {
 
   new Ajax.Updater(options.element,options.url, {
 
  method:options.method,
  evalScripts: options.evalscripts,
   parameters: {
  options.parametersName:
   options.params
   }
   onComplete: options.onCompleteFunction // Not sure if would work - as
 i've
   never tried
 
   });
 
   }
 
   div
  
 onclick=doSomething({element:'myDiv',url:'myurl.php',evalscrips:true,parametersName:'postbody',params:'?php
  
 echo($myVeryDynamicVariableIJustRecievedFromAnotherAjaxRequestThatTheDocumentCouldNotPossiblyKnowWithoutUpdatingLotsOfHiddenVariables);
 ?',onCompleteFunction:'function(){alert(\'Hi\');}'});
   /div
 
   Now without inline handlers i would have to make alot of functions..
 this
   way i can reuse my code and just change the inputs 
 
   I will state i dont do this often but sometimes it is needed as a
 script
   cannot always get the variables it needs as some change dynamically
 from
   other requests and outside factors
 
   I built an extremely dynamic Web Desktop over the last 2 years which is
   alot faster than anything else out there... One of the main factors it
 stays
   fast is the client memory is not clogged up with huge initial downloads
 of
   functions that only get used every now and again!.
 
   My view is each to thier own  If it aint broke dont fix it and if
   everyone wrote code the same then the internet would be boring !!
 
   I would be interested to see how you would tackle problems like the one
   above as i've never really discussed it with anyone before
 
   Regards
   Alex
 
   - Original Message -
   *From:* Rick Waldron waldron.r...@gmail.com
   *To:* prototype-scriptaculous@googlegroups.com
   *Sent:* Thursday, June 04, 2009 4:06 PM
   *Subject:* [Proto-Scripty] Re: Working outside loop, but not inside
 
   A quick google for php single quotes vs double quotes will help you
   understand the difference and what it means to the overhead and
 scalability
   of your code. I picked this article from said google results:
 
  http://andrewgatenby.com/single-quotes-and-double-quotes-in-php
 
   @Alex,
   I honestly can't think of any scenario where it is ok to use inline
   handlers, but I'm definitely interested in hearing your argument
 regarding
   them. I'm of the belief that complete separation of logic is imperative
 and
   should be regarded as best practice (or even, only practice)...
 thoughts?
 
   @Craig,
   Apparently Effect.toggle() does not like the element chained to it...
 odd.
   Anyway, you can improve this much further I've posted a demo.
  http://genevajs.com/misc/demo-ps-list-0010.php
 
   Rick
 


--~--~-~--~~~---~--~~
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: $$ behavior in IE ?

2009-06-04 Thread Rick Waldron
That still wont work...

 console.log( $$('#gridRow').last().down().innerHTML );

# --- is for IDs

you need:

 console.log( $$('.gridRow').last().down().innerHTML );


And i PROMISE that wont work either, you need to iterate through
$$('.gridRow') if you want to output both rows.

Like so:


   div class=gridRow
 spanhi/span
   /div
   div class=gridRow
 spanbye/span
   /div
   script
 document.observe('dom:loaded',function(){
  $$('.gridRow').each( function (g) {
console.log(g.down().innerHTML);
  });
 });
   /script


dig it.






On Thu, Jun 4, 2009 at 5:53 PM, Douglas douglas.gont...@gmail.com wrote:


 Hello, you cannot set the same ID more than once; You problably wanted
 to use classes instead of it;

 [example]
div class=gridRow
  spanhi/span
/div
div class=gridRow
   spanbye/span
/div
script
  document.observe('dom:loaded',function(){
console.log( $$('#gridRow').last().down().innerHTML );
  });
/script
 [/example]

 I think firefox always evaluate the very last ID found in whole
 document. I dont use IE though.
 Cheers


 On Thu, Jun 4, 2009 at 1:26 PM, Christian P zar...@gmail.com wrote:
 
  I am using the latest prototype.js from git
 
  HTML
  !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
  http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
  html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
   head
 titleMy Prototype test bench/title
 script type=text/javascript src=lib/prototype.js/script
 /headbody
 
 h1A simple page to test Prototype/h1
 div id=gridRow
   spanhi/span
 /div
 div id=gridRow
   spanbye/span
 /div
 script
   document.observe('dom:loaded',function(){
 console.log( $$('#gridRow').last().down().innerHTML );
   });
 /script
   /body
  /html
 
 
  IE logs hi
  Firefox logs bye
 
  Why is that?
 
  
 



 --
 Believe nothing, no matter where you read it, or who said it, no
 matter if I have said it, unless it agrees with your own reason and
 your own common sense.

 


--~--~-~--~~~---~--~~
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: Possible Bug: Youtube in a Draggable DIV

2009-06-04 Thread Rick Waldron
1.Your link is 404, I guessed and added an L to htm (.html)

2. Use the option 'handle'... take a look:

http://www.genevajs.com/misc/drag-handle.php

dig it.




On Thu, Jun 4, 2009 at 10:47 AM, jevchance john.va...@gmail.com wrote:


 Hi everyone.

 I'm experiencing some possible bugs with a Scriptaculous draggable DIV
 and Youtube.

 The first issue is with Firefox. The issue arises when I put a Youtube
 video inside a div, inside a draggable div. If I click the play button
 in FF, the div binds to my mouse in a semi-transparent state, and
 follows it around the screen. I can no longer control the Youtube
 video, and I have to close/refresh the page or exit the browser to
 unbind.

 Also, in Safari 4 Public Beta, I can't use the play controls. However,
 if I remove the draggable code, the play button works fine.

 Googling the topic presented this thread from another person with the
 same issue, along with a sample:

 http://www.mail-archive.com/rubyonrails-spino...@googlegroups.com/msg01602.html
 The sample is:
 http://preppylion.com/problem/draggable.htm

 Here's the relevant info:
 Mac OS 10.5.7 Intel
 Firefox 3.0.10
 Safari 4 Public Beta 5528.17

 I can't release the URL of my test page that exhibits this behavior,
 as its an in-production web page for a client. However, my source code
 looks like this:

 div id=productfeature
  div id=productfeaturecontent
div id=productfeatureleft
  object width=280 height=182param name=movie
 value=http://www.youtube.com/v/PcBlL3CtFcAhl=enfs=1;/paramparam
 name=allowFullScreen value=true/paramparam
 name=allowscriptaccess value=always/paramembed src=http://
 www.youtube.com/v/PcBlL3CtFcAhl=enfs=1 type=application/x-
 shockwave-flash allowscriptaccess=always allowfullscreen=true
 width=280 height=182/embed/object
/div
div id=productfeatureright
  h4Headline/h4
  pPositioning text./p
/div
  /div
 /div
 script type=text/javascript
new Draggable('productfeature');
 /script

 


--~--~-~--~~~---~--~~
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: Working outside loop, but not inside

2009-06-04 Thread Rick Waldron
The first ajax request was following your variable's name as a guidleline :)

$myVeryDynamicVariableIJustRecievedFromAnotherAjaxRequestThatTheDocumentCouldNotPossiblyKnowWithoutUpdatingLotsOfHiddenVariables

Just recieved from another ajax request (how do you intend to update the
value of the inline onclick= from this other mystery ajax request? good
luck with that in IE)

without updating lots of hidden variables (good thing i used the element's
allotted internal memory and clearly have 0 hidden variables)


My use of the element's object for storage of data is common practice, so
common that the proto-core team has added it as a standard feature of
prototype in an upcoming version:
http://www.prototypejs.org/2009/2/16/pimp-my-code-1-element-storage
...which was just a replication of jQuery's $.fn.data

I wrote that in 20 minutes... my apologies for not creating a reusable OO
structure. Which, by definition, inline handlers are considered
procedural  and DEFINITELY not OO.


I strongly suggest you read this article:
http://www.quirksmode.org/js/events_early.html

All of a sudden I feel like i'm having an argument about whether or not one
should use font tags or properly structured CSS that remains OUT of your
markup.


Just for fun, replicate my example, but with your method. I'm just curious
to see how you would accomplish what we're discussing.



Rick





On Thu, Jun 4, 2009 at 6:48 PM, Alex McAuley 
webmas...@thecarmarketplace.com wrote:

  My point still stands that it is a simple example... when we delve deeper
 into more complex examples it becomes garder and harder!!... Also fom what i
 can remember about the code it took 2 requests to complete as opposed to
 1 surely that is not memory efficient...

 I dont deny it can probably all be done with non inline i just dont aggree
 that its better to do it due to script size, time to write, number of
 requests, memory  scalability.

 To the best of my knowledge OOP is used for the re-usablility of
 code/functions (certainly in php anyway), i for one like to reuse my
 functions in PHP, Javascript and other languages if only to keep the size of
 things to a minimum and my code is written for me not for other people to be
 able to read (luckily) !!!

 This is probably a good debate to have in an open group like this as alot
 of people new to Javascirpt programming are told not to inline things but
 not really explained the real reasons why or why not to!! - same with php
 and ' vs  !!

 Long day for me time to hit the hay !

 Regards
 Alex



 - Original Message -

 *From:* Rick Waldron waldron.r...@gmail.com
 *To:* prototype-scriptaculous@googlegroups.com
 *Sent:* Thursday, June 04, 2009 11:30 PM
 *Subject:* [Proto-Scripty] Re: Working outside loop, but not inside

 What about when all that inline markup is output from a loop...lots of
 rendered source code that will likely look like spaghetti? The markup
 created by my example is just:
 (i've changed record to name in the example)

 li class=clickera id=a_001 name=001 href=javascript:;Mystery
 Character #001/a

 Furthermore, it takes on average 100ms to load and render the initial data
 from the server and between 10-20ms to click-load-process the second server
 call. Numbers aside - that's super fast, but profiling and net monitoring
 from one server to one client machine isnt proof of anything.

 Anyway... glad we could open that up to more conversation.

 Rick




 On Thu, Jun 4, 2009 at 4:28 PM, Alex McAuley 
 webmas...@thecarmarketplace.com wrote:

  That was a very basic example i wrote !!...

 Plus your code is not re-usable which was kinda my point and its about 50
 lines where as mine would fit into perhaps 10 or so... inline is alot more
 flexible...

 In basic examples yes this way does work but is memory expensive and alot
 of work !!!...

 As i said - each to thier own in thier coding style ... while inline is
 still valid xhtml i will continue to use it

 Also ... is the record node on the href's valid xhtml ? because i cant
 see it on the list of valid nodes!... And i would rather use inline callees
 than use invalid xhtml!

 Regards
 Alex


  - Original Message -
 *From:* Rick Waldron waldron.r...@gmail.com
 *To:* prototype-scriptaculous@googlegroups.com
   *Sent:* Thursday, June 04, 2009 7:29 PM
 *Subject:* [Proto-Scripty] Re: Working outside loop, but not inside

 @Alex,

 I think i met all of your criteria:
 http://genevajs.com/misc/demo-ps-list-0011.php

 i left the js in the main file so you could reference. dig it.


 Rick



 On Thu, Jun 4, 2009 at 12:20 PM, Alex McAuley 
 webmas...@thecarmarketplace.com wrote:

  @Rick -- Okay here is a good one.


 A very dynamic site where you need to pull varying variables
 -- excuse the psudeo code !! just proving its needed sometimes !!

 funciton doSomething({options}) {

 new Ajax.Updater(options.element,options.url, {

method:options.method

[Proto-Scripty] Re: Working outside loop, but not inside

2009-06-03 Thread Rick Waldron
There is a much cleaner way to do this... check it out (tested and passed)

This goes in script tags, or in your external js file:


document.observe('dom:loaded', function () {
  $$('.blinders').each(function (b) {

b.observe('click', function () {
  this.next().toggle('blinddown', 'slide');
});
  });
});



And the PHP really should be written like this:
?php

$count=$count+2;
while ( $count = $num_teams)
{
  ?
  tr
tdPlayer ?php echo $count ?/td
td class='players'
  div class=blinders red
{click to reserve a player spot}
  /div
  div style='display:none; width:175px;height:100px; background:#FFF;'
Random Text that doesn't matter
  /div
/td
  /tr
  ?php
  $count++;
}
?

Notice only ONE var is echo'ed. with all those double quotes your asking PHP
to eval everything inside it, even when there are no vars to parse - thats
not fair to PHP.

Having inline handlers is something you will vastly regret in the future, so
i did away with those and let the .each() deal with assigning behaviours

Tested in FF3  IE 7


Rick



























$count=$count+2;
 while ($count=$num_teams)
{

 echo 'trtdPlayer .$count . /tdtd class='players'div
onclick='Effect.toggle('

 blinddown.$count.', 'slide'); return
 false;'span class='red'{click to reserve a player spot}/span/
 div
 div id='blinddown.$count.'style='display:none; width:175px;
 height:
 100px; background:#FFF;'Random Text that doesn't matter/div/td/
 tr;
  $count++;
}




On Wed, Jun 3, 2009 at 7:13 PM, craig bagley.cr...@gmail.com wrote:


 That's right, yes.  I tried that at one point:

  $count=$count+2;
   while ($count=$num_teams)
{
  echo trtdPlayer .$count . /tdtd class='players'div
 onclick='Effect.toggle('blinddown.$count.', 'slide'); return
 false;'span class='red'{click to reserve a player spot}/span/
 div
 div id='blinddown.$count.'style='display:none; width:175px;
 height:
 100px; background:#FFF;'Random Text that doesn't matter/div/td/
 tr;
  $count++;
}

 However, it still wasn't working, so I decided to mess around with it
 and just hard-code 1 in there.  In my previous experience it will
 toggle the first occurrence of the div id, so I was just trying to
 avoid potential syntax errors until I figured it out...but I still
 have not
 


--~--~-~--~~~---~--~~
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: Working outside loop, but not inside

2009-06-03 Thread Rick Waldron
Oh yeah... and this was your problem;


onclick='Effect.toggle('blinddown1', 'slide'); return false;'

would've worked as:

onclick=Effect.toggle('blinddown1', 'slide'); return false;


You cant use single quotes inside of single quotes.







On Thu, Jun 4, 2009 at 12:37 AM, Rick Waldron waldron.r...@gmail.comwrote:

 There is a much cleaner way to do this... check it out (tested and passed)

 This goes in script tags, or in your external js file:


 document.observe('dom:loaded', function () {
   $$('.blinders').each(function (b) {

 b.observe('click', function () {
   this.next().toggle('blinddown', 'slide');
 });
   });
 });



 And the PHP really should be written like this:
 ?php

 $count=$count+2;
 while ( $count = $num_teams)
 {
   ?
   tr
 tdPlayer ?php echo $count ?/td
 td class='players'
   div class=blinders red
 {click to reserve a player spot}
   /div
   div style='display:none; width:175px;height:100px;
 background:#FFF;'
 Random Text that doesn't matter
   /div
 /td
   /tr
   ?php
   $count++;
 }
 ?

 Notice only ONE var is echo'ed. with all those double quotes your asking
 PHP to eval everything inside it, even when there are no vars to parse -
 thats not fair to PHP.

 Having inline handlers is something you will vastly regret in the future,
 so i did away with those and let the .each() deal with assigning behaviours

 Tested in FF3  IE 7


 Rick



























 $count=$count+2;
  while ($count=$num_teams)
 {

  echo 'trtdPlayer .$count . /tdtd class='players'div
 onclick='Effect.toggle('

 blinddown.$count.', 'slide'); return
 false;'span class='red'{click to reserve a player spot}/span/
 div
 div id='blinddown.$count.'style='display:none; width:175px;
 height:
 100px; background:#FFF;'Random Text that doesn't matter/div/td/
 tr;
  $count++;
}




 On Wed, Jun 3, 2009 at 7:13 PM, craig bagley.cr...@gmail.com wrote:


 That's right, yes.  I tried that at one point:

  $count=$count+2;
   while ($count=$num_teams)
{
  echo trtdPlayer .$count . /tdtd class='players'div
 onclick='Effect.toggle('blinddown.$count.', 'slide'); return
 false;'span class='red'{click to reserve a player spot}/span/
 div
 div id='blinddown.$count.'style='display:none; width:175px;
 height:
 100px; background:#FFF;'Random Text that doesn't matter/div/td/
 tr;
  $count++;
}

 However, it still wasn't working, so I decided to mess around with it
 and just hard-code 1 in there.  In my previous experience it will
 toggle the first occurrence of the div id, so I was just trying to
 avoid potential syntax errors until I figured it out...but I still
 have not
 



--~--~-~--~~~---~--~~
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: Problem with Ajax.Updater...

2009-06-02 Thread Rick Waldron
I noticed you're missing a comma...


var myAjax = new Ajax.Updater(target, url, {method: 'post',
parameters: { params: pars } onComplete:function(){


Between { params: pars } onComplete (should be right before onComplete)


That may be unrelated, but an observation worth noting.





On Tue, Jun 2, 2009 at 4:47 PM, T.J. Crowder t...@crowdersoftware.com wrote:


 Hi,

 Guys, you're talking past each other.

 @Alex:

 This is perfectly valid:

 var x = one=1two=2three=3;
 new Ajax.Updater(target, url, {parameters: x});

 @OP:

 This is perfectly valid (and preferred):

 new Ajax.Updater(target, url, {
 parameters: {
'one':1,
'two':2,
'three':  3
}
 });

 -- T.J.

 On Jun 2, 9:37 pm, partypeopl...@gmail.com partypeopl...@gmail.com
 wrote:
  ok, I tried your suggestion but this doesn't work at all
 
  have you ever tried the syntax you are suggesting? Because I think
  it's wrong...
 
  Caught also in FF's error console as:
 
  Error: missing } after property list
  Source File: 
  Line: 52, Column: 94
  Source Code:
   var myAjax = new Ajax.Updater(target, url, {method: 'post',
  parameters: { params: pars } onComplete:function(){
 
  and indicating exactly the parameters string, as to say you cannot
  open a bracket there, unless you close the previous one
 
  However, putting a trailing coma after the parameters corrects this
  syntax error, and everything works again
 
  Nevertheless, IE denies to deliver, even using this syntax :(
 


--~--~-~--~~~---~--~~
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: Extracting methods from codebase

2009-04-30 Thread Rick Waldron

At very least the code i gave you will allow you to clean up your own
code by subbing document.getElementById() with the $() and i'd say its
pretty damn small


Rick

On Thu, Apr 30, 2009 at 11:42 AM, Bertrand bertrand.char...@gmail.com wrote:

 Well, actually, my managers are pushing for self-contained javascript
 code (trying to get rid of all the library calls, which isn't
 necessarily a good idea, but I have to abide).

 So I ended up using a DOM-compliant version using createElement,
 createTextNode and appendChild.

 But I'll make sure to give that piece of code of yours a spin.

 Thanks a lot.

 On Apr 29, 3:16 pm, Rick Waldron waldron.r...@gmail.com wrote:
 Just sort of curious ... of all the convenience that prototype offers,
 why is the only method you need is Element.update()?

 Anyway, try this...

 (function() {
   function _$(args) {
     this.elements = [];
     for (var i = 0, len = args.length; i  len; ++i) {
       if (typeof args[i] == 'string') {
         this.elements.push( document.getElementById(args[i]) );
       }
     }
   }
   _$.prototype = {
     update: function() {
       this.elements[0].innerHTML = arguments[0];
       return this;
     }
   };
   window.$ = function() {
     return new _$(arguments);
   };

 })();

 And a fragment to drop into a body...

 p id=p_content
 This is some content that starts in a lt;pgt;
 /p
 div id=div_content
 This is some content that starts in a lt;divgt;
 /div
 script
 window.onload = function () {
   $('p_content').update('test');
   $('div_content').update('test');};

 /script

 On Wed, Apr 29, 2009 at 4:33 PM, Bertrand bertrand.char...@gmail.com wrote:

  That would indeed be another interesting way of doing it. The only
  problem is that javascript is often used in environments where
  filesize is critical. In my case, I only use ONE function from the
  library, because I've found it to be th best way to achieve what I
  want to do: Element.update.

  But because I'm unable to sort the source code out, I have to either:

  Ditch Prototype altogether (which I don't really want to do)

  OR

  Make use of the whole library, which is a no-go for me as the minified
  +gzip version still weighs a solid 25kB (which isn't much, but still
  way too much for our needs).

  What bothers me here is the one-size-fits-all mentality, but
  complaining about it sure is easy when I'm not providing any code to
  fix the problem, I know it is, but still it bothers me that I'll have
  to end up not using update (which is a fantastic piece of code, like
  the rest of the library) just because it's so deeply intertwined with
  the rest of the codebase.

  What I was hinting at is something akin to what jqueryUI has on
 http://jqueryui.com/downloadbut even more fine-grained (at function
  level if possible).
 


--~--~-~--~~~---~--~~
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: .each not working in IE?

2009-04-06 Thread Rick Waldron

$R(1,31).each(function(i){
   console.log(i); // if you have firebug.
});






On Mon, Apr 6, 2009 at 3:51 AM, T.J. Crowder t...@crowdersoftware.com wrote:

 Hi,

 Why are you calling $?  $[1] is for extending elements or looking
 elements up by ID, it has nothing to do with ObjectRanges.  The types
 it's documented to accept are String (when looking up by ID) and
 Element (when extending an element).  If you just use days.each, I
 would expect it to work, since ObjectRange mixes in Enumerable.

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

 HTH,
 --
 T.J. Crowder
 tj / crowder software / com
 Independent Software Engineer, consulting services available

 On Apr 5, 11:18 pm, CeyloR w.at...@gmail.com wrote:
 Hello,

 I'm using .each to iterate over an array. This works fine and without
 errors in Firefox but in Internet Explorer I get an error saying the
 object doesn't support that method. Is this a known isue?

 This is the code I use :

 days = $R(1,31);
 $(days).each(function(i){
     //some work to do for each day

 });

 kind regards

 Ceylor
 


--~--~-~--~~~---~--~~
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: event.element vs. $('element_id')

2009-03-27 Thread Rick DeNatale
On Fri, Mar 27, 2009 at 8:57 AM, RobG rg...@iinet.net.au wrote:




 On Mar 27, 10:02 pm, Lapis petter.env...@gmail.com wrote:
  I do like this sometimes, when the scoping is ok:
 
  var submitter = $('submitter');
  if (submitter) {
submitter.observe('click', function (event) {
  // use submitter here
});
 
  };
 
  It is great, time-wise.

 And exploits IE's memory leak due to the closure with circular
 reference.  Don't do it.


So, do I infer from this that IE (at least some version(s)) use a reference
counting GC for Javascript?  Yuck.

-- 
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

--~--~-~--~~~---~--~~
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: Submit a form using enter

2008-12-11 Thread Rick Waldron

I whipped this together, tested and confirmed:

document.observe(dom:loaded, function () {
$('login_form').observe('keydown', function (e) {

if ( e.keyCode == 13 ) {
//event.findElement('form').submit();
alert($F('login_str'));
}
});

}, false);


the form i set up looks like:

form id=login_form
input type=text id=login_str


/form






On Wed, Dec 10, 2008 at 11:11 AM, Hector Virgen [EMAIL PROTECTED] wrote:
 This is untested, but I would probably do something like this:

 $$('form[name=login_form]').invoke('observe', 'keydown', function(event)
 {
 if (event.keyCode === 13) {
 event.findElement('form').submit();
 }
 });

 -Hector


 On Wed, Dec 10, 2008 at 4:46 AM, Dave L [EMAIL PROTECTED] wrote:

 Im not sure I understand.  login_form is the id of the form that I am
 trying to submit.  and form_submit is the id of the actual submit
 button. I tried the following:

 document.form.login_form.onkeydown=if(event.keyCode==13)
 {this.form.submit();return false;};

 and also

 $('login_form').form_submit.onkeydown=if(event.keyCode==13)
 {this.form.submit();return false;};

 but no go.  Thanks for your input.

 On Dec 10, 1:03 am, pradeep saraswati [EMAIL PROTECTED] wrote:
   hai
 
  u are using $('form_submit')  does form_submit is the id of the
  form
 
  then it will surely does not gonna work in I.E
 
  so you specify a name to the formand access the form
 
  document.form.formname.onkeydown this will work in ie...
 
  i too faced this issuejust try this u r problem will be solved
 
  if u are too much particular in accessing form using $...then use $F and
  never access form using the id
  IE will never know..what you are doing...if you access form by id
 
  Regards
  spradeepkumar



 


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