Re: [Proto-Scripty] PrototypeJs equivalent

2010-06-08 Thread Walter Lee Davis

I don't know jQuery at all, but from this description at their API site:

"The .prepend() method inserts the specified content as the first  
child of each element in the jQuery collection..."


I would do this:

$$('p.foo').invoke('insert',{top:'your inserted content here'});

If you were inserting into only one element, you would do this:

$('itemId').insert({top:'your inserted content here'});

Walter

On Jun 8, 2010, at 6:17 PM, Craig Gardner wrote:


I'm coming from a jQuery background, so bear with me.  Is there a
chart that will show me any methods that are similar in jQuery?  More
specifically, I'm looking for a similar method to the
jQuery's .prepend()

Thanks,
Craig Gardner

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



[Proto-Scripty] Re: window.parent.eval problem: Bug in Firefox or in Prototype?

2010-06-08 Thread Mark Reginald James
Hey guys,

After posting this I realised there was a way to remove any Prototype
reference, which made it clear that it's some issue with Firefox.

A test page with the simplified code is at 
http://advancedcontrols.com.au/parent.html
. FF displays "false", while Google Chrome displays "true".

Anyway, it's useful to have this issue archived here, particularly the
fact that including Prototype in the child is a work-around.


-- 
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] window.parent.eval problem: Bug in Firefox or in Prototype?

2010-06-08 Thread Mark Reginald James
Hi,

I'm seeing a discrepancy that only happens in the Firefox browser
(tested on 3.6.3). I'd appreciate any suggestions on whether this is a
bug in Firefox or a bug in Prototype (1.6.1).

If parent.html contains




and child.html contains


window.parent.eval('alert(Object.toJSON([1,2,3]))')


In all browsers but Firefox, loading parent.html will show the correct
alert

  [1,2,3]

while Firefox instead converts the array into a hash:

  {"0": 1, "1": 2, "2": 3}

One fix I've found is to also include Prototype in the child

  

-- 
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] PrototypeJs equivalent

2010-06-08 Thread Craig Gardner
I'm coming from a jQuery background, so bear with me.  Is there a
chart that will show me any methods that are similar in jQuery?  More
specifically, I'm looking for a similar method to the
jQuery's .prepend()

Thanks,
Craig Gardner

-- 
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: disable right click

2010-06-08 Thread Victor S
You don't have to, I just pasted something I had on hand. I use jquery
for other things as well.

On Jun 8, 7:38 am, "T.J. Crowder"  wrote:
> > In any event...
>
> > // disable context menu
> > var $j = jQuery.noConflict();
>
> > $j(document).bind("contextmenu",function(e){
> >         return false;
>
> > });
>
> Why introduce jQuery into it?
>
> document.observe('contextmenu', Event.stop);
> --
> T.J. Crowder
> Independent Software Consultant
> tj / crowder software / comwww.crowdersoftware.com
>
> On Jun 8, 3:16 am, Victor S  wrote:
>
>
>
> > In any event...
>
> > // disable context menu
> > var $j = jQuery.noConflict();
>
> > $j(document).bind("contextmenu",function(e){
> >         return false;
>
> > });
>
> > // disable selection of page items
> > function captureEvents(){
> >         return false;
>
> > }
>
> > document.onselectstart = captureEvents;
> > document.onselect = captureEvents;
> > document.ondblclick = captureEvents;
> > document.onmousedown = captureEvents;
>
> > On Jun 7, 12:10 pm, "T.J. Crowder"  wrote:
>
> > > > Actually guys i want to ask that as i know the "contextmenu" is 
> > > > depricated
> > > > in XHTML so is there any other way which will resist in both.
>
> > > AFAIK, XHTML doesn't define those things; it defines how you write
> > > HTML in XML, not what's valid within that HTML.
>
> > > The latest HTML spec (still a work in progress) continues to list the
> > > contextmenu event.[1]
>
> > > None of which means you shouldn't try to avoid the contextmenu event
> > > when you can, given how it varies amongst browsers. :-)
>
> > > [1]http://www.w3.org/TR/html5/webappapis.html#handler-oncontextmenu
> > > --
> > > T.J. Crowder
> > > Independent Software Consultant
> > > tj / crowder software / comwww.crowdersoftware.com
>
> > > On Jun 7, 2:33 pm, ankit jain  wrote:> Thanks 
> > > Victor i agree.
> > > > Actually guys i want to ask that as i know the "contextmenu" is 
> > > > depricated
> > > > in XHTML so is there any other way which will resist in both.
>
> > > > Thanks
> > > > Ankit
>
> > > > On Mon, Jun 7, 2010 at 7:12 AM, Victor S  wrote:
> > > > > I find it interesting to surf the web on iPad which does not have a
> > > > > right click context menu... And I've been thinking about the iPad and
> > > > > other touch interfaces and the way they handle interaction on
> > > > > screen... Mimmicking that touch interface with the mouse seems
> > > > > tempting and the disabling of right click as well as selection of
> > > > > objects on screen can be useful in that context... But of course some
> > > > > other way of interacting with the content on screen will have to be
> > > > > allowed.. Click and hold or give some obvious buttons to deal with
> > > > > content... To watch the way interfaces and user interaction will
> > > > > change over the next few years will be interesting...
>
> > > > > On Jun 5, 2:08 pm, Peter De Berdt  wrote:
> > > > > > A user that wants to enable it again, will find a way. There's no 
> > > > > > way
> > > > > > to absolutely prevent it.
>
> > > > > > As far as I know, Opera allows for the contextmenu event to be 
> > > > > > enabled
> > > > > > (wasn't by default last time I checked) but doesn't allow to stop 
> > > > > > the
> > > > > > event.
>
> > > > > > You can however consider the following:
> > > > > > - If you're trying to protect images from being downloaded through 
> > > > > > the
> > > > > > contextmenu, just make them a CSS background instead of an . 
> > > > > > This
> > > > > > method is on par with disabling the contextmenu (except that the
> > > > > > context menu will still show).
> > > > > > - Otherwise you can overlay a div on top of the part of the page
> > > > > > you're trying to disable it on and capture the mouseclick events on
> > > > > > the element.
>
> > > > > > All I can say is that the few sites I've come across that 
> > > > > > intercepted
> > > > > > the contextmenu event will never get a visit from me again. It's
> > > > > > annoying to say the least and I don't understand why anyone would do
> > > > > > it. If you want to protect images or files, watermark them in some
> > > > > > way, a much better and more secure method anyway.
>
> > > > > > On 05 Jun 2010, at 17:20, Shane McCarron wrote:
>
> > > > > > > Are there still browsers that don't support the contextmenu event
> > > > > > > class though?
>
> > > > > > > On Sat, Jun 5, 2010 at 4:40 AM, Johan Arensman 
> > > > > > > 
> > > > > > > wrote:
> > > > > > > You can using Event.observe()
>
> > > > > > > Event.observe(window, 'contextmenu', function(event) {
> > > > > > > event.stop();
> > > > > > > });
>
> > > > > > > On Sat, Jun 5, 2010 at 6:29 AM, ankit.it09 
> > > > > > > wrote:
> > > > > > > How to disable right click in a web page using prototype , i mean 
> > > > > > > is
> > > > > > > there any method.
>
> > > > > > Best regards
>
> > > > > > Peter De Berdt
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google 
> > > > >

[Proto-Scripty] Event click Firefox vs others

2010-06-08 Thread mrbana...@googlemail.com
Hi,

I m using current Prototype 1.7 RC.

The following code behaves differently in Firefox compared to the
other browsers (IE, Safari, Chrome).

In firefox handler is triggered for left AND right button mouse
clicks, whereas the other browers just trigger on left button clicks.

document.observe("dom:loaded", function() {
  document.on('click', 'a[data-remote]', function(event) {
var bool = Event.isLeftClick(event);
if ( bool ){
  alert("Left button is pressed" );
} else {
  alert("Left button is NOT pressed" );
}
event.stop();
  });
});

Any idea, why?

Thanks a lot in advance.

--
Volker

-- 
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: disable right click

2010-06-08 Thread T.J. Crowder
> In any event...
>
> // disable context menu
> var $j = jQuery.noConflict();
>
> $j(document).bind("contextmenu",function(e){
>         return false;
>
> });

Why introduce jQuery into it?

document.observe('contextmenu', Event.stop);
--
T.J. Crowder
Independent Software Consultant
tj / crowder software / com
www.crowdersoftware.com


On Jun 8, 3:16 am, Victor S  wrote:
> In any event...
>
> // disable context menu
> var $j = jQuery.noConflict();
>
> $j(document).bind("contextmenu",function(e){
>         return false;
>
> });
>
> // disable selection of page items
> function captureEvents(){
>         return false;
>
> }
>
> document.onselectstart = captureEvents;
> document.onselect = captureEvents;
> document.ondblclick = captureEvents;
> document.onmousedown = captureEvents;
>
> On Jun 7, 12:10 pm, "T.J. Crowder"  wrote:
>
>
>
> > > Actually guys i want to ask that as i know the "contextmenu" is depricated
> > > in XHTML so is there any other way which will resist in both.
>
> > AFAIK, XHTML doesn't define those things; it defines how you write
> > HTML in XML, not what's valid within that HTML.
>
> > The latest HTML spec (still a work in progress) continues to list the
> > contextmenu event.[1]
>
> > None of which means you shouldn't try to avoid the contextmenu event
> > when you can, given how it varies amongst browsers. :-)
>
> > [1]http://www.w3.org/TR/html5/webappapis.html#handler-oncontextmenu
> > --
> > T.J. Crowder
> > Independent Software Consultant
> > tj / crowder software / comwww.crowdersoftware.com
>
> > On Jun 7, 2:33 pm, ankit jain  wrote:> Thanks Victor 
> > i agree.
> > > Actually guys i want to ask that as i know the "contextmenu" is depricated
> > > in XHTML so is there any other way which will resist in both.
>
> > > Thanks
> > > Ankit
>
> > > On Mon, Jun 7, 2010 at 7:12 AM, Victor S  wrote:
> > > > I find it interesting to surf the web on iPad which does not have a
> > > > right click context menu... And I've been thinking about the iPad and
> > > > other touch interfaces and the way they handle interaction on
> > > > screen... Mimmicking that touch interface with the mouse seems
> > > > tempting and the disabling of right click as well as selection of
> > > > objects on screen can be useful in that context... But of course some
> > > > other way of interacting with the content on screen will have to be
> > > > allowed.. Click and hold or give some obvious buttons to deal with
> > > > content... To watch the way interfaces and user interaction will
> > > > change over the next few years will be interesting...
>
> > > > On Jun 5, 2:08 pm, Peter De Berdt  wrote:
> > > > > A user that wants to enable it again, will find a way. There's no way
> > > > > to absolutely prevent it.
>
> > > > > As far as I know, Opera allows for the contextmenu event to be enabled
> > > > > (wasn't by default last time I checked) but doesn't allow to stop the
> > > > > event.
>
> > > > > You can however consider the following:
> > > > > - If you're trying to protect images from being downloaded through the
> > > > > contextmenu, just make them a CSS background instead of an . This
> > > > > method is on par with disabling the contextmenu (except that the
> > > > > context menu will still show).
> > > > > - Otherwise you can overlay a div on top of the part of the page
> > > > > you're trying to disable it on and capture the mouseclick events on
> > > > > the element.
>
> > > > > All I can say is that the few sites I've come across that intercepted
> > > > > the contextmenu event will never get a visit from me again. It's
> > > > > annoying to say the least and I don't understand why anyone would do
> > > > > it. If you want to protect images or files, watermark them in some
> > > > > way, a much better and more secure method anyway.
>
> > > > > On 05 Jun 2010, at 17:20, Shane McCarron wrote:
>
> > > > > > Are there still browsers that don't support the contextmenu event
> > > > > > class though?
>
> > > > > > On Sat, Jun 5, 2010 at 4:40 AM, Johan Arensman 
> > > > > > wrote:
> > > > > > You can using Event.observe()
>
> > > > > > Event.observe(window, 'contextmenu', function(event) {
> > > > > > event.stop();
> > > > > > });
>
> > > > > > On Sat, Jun 5, 2010 at 6:29 AM, ankit.it09 
> > > > > > wrote:
> > > > > > How to disable right click in a web page using prototype , i mean is
> > > > > > there any method.
>
> > > > > 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 > > >  s%2bunsubscr...@googlegroups.com>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/prototype-scriptaculous?hl=en.

-- 
You received this message

Re: [Proto-Scripty] Adding an effect to AJAX'd data.

2010-06-08 Thread Alex McAuley
Why dont you pass the whole json object into a function and have the 
function do all the work - this way you can extract ID's..


Or why not use a classname and do it on each of those...

Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: "Richard Quadling" 

To: 
Sent: Tuesday, June 08, 2010 11:50 AM
Subject: [Proto-Scripty] Adding an effect to AJAX'd data.



Hi.

I've got a simple little page I'm building for our fleet inspectors.
Trying to make it look nicer.

The issue I'm coming up against is the single threaded nature of
JavaScript (I think that's the issue I coming up against).

The onSuccess() callback reads Response.responseJSON.Order.Details and
uses a template to add the details to the page.

The template is ...

var tmpl_Wheel = new Template('#{Position}#{Description}#{Serial}#{Date}#{Supplier}#{Depot}');

As you can see, the style is display:none, so that I can add a
progressive reveal to the wheels.

The trouble is, I can't call the new Effect.Appear('Wheel_' + Wheel)
because it doesn't exist yet.

So.

I've got the "add the wheels to the display" code as ...

var s_Wheels = '';
o_Response.responseJSON.Order.each(function(o_Wheel){
s_Wheels = s_Wheels + tmpl_Wheel.evaluate(o_Wheel);
});
$('vsWheels').update(s_Wheels);

And then I want to add the effect.

o_Response.responseJSON.Order.each(function(o_Wheel){
new Effect.Appear(
'Wheel_' + o_Wheel.Wheel,{
delay: 0.25 * parseInt(o_Wheel.Wheel, 10),
duration : 0.50,
from : 0.00,
to   : 1.00
}
);
});


Initially, the effect was in the same loop (with each wheel being
updated as it went).

But this isn't working either.

What options do I have for this?

Essentially, the data comes in via AJAX and I want it to appear one
wheel at a time, with each wheel being slightly delayed so that they
appear smoothly.

Regards,

Richard Quadling.
--
-
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
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-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] Adding an effect to AJAX'd data.

2010-06-08 Thread Richard Quadling
Hi.

I've got a simple little page I'm building for our fleet inspectors.
Trying to make it look nicer.

The issue I'm coming up against is the single threaded nature of
JavaScript (I think that's the issue I coming up against).

The onSuccess() callback reads Response.responseJSON.Order.Details and
uses a template to add the details to the page.

The template is ...

var tmpl_Wheel = new Template('#{Position}#{Description}#{Serial}#{Date}#{Supplier}#{Depot}');

As you can see, the style is display:none, so that I can add a
progressive reveal to the wheels.

The trouble is, I can't call the new Effect.Appear('Wheel_' + Wheel)
because it doesn't exist yet.

So.

I've got the "add the wheels to the display" code as ...

var s_Wheels = '';
o_Response.responseJSON.Order.each(function(o_Wheel){
s_Wheels = s_Wheels + tmpl_Wheel.evaluate(o_Wheel);
});
$('vsWheels').update(s_Wheels);

And then I want to add the effect.

o_Response.responseJSON.Order.each(function(o_Wheel){
new Effect.Appear(
'Wheel_' + o_Wheel.Wheel,{
delay: 0.25 * parseInt(o_Wheel.Wheel, 10),
duration : 0.50,
from : 0.00,
to   : 1.00
}
);
});


Initially, the effect was in the same loop (with each wheel being
updated as it went).

But this isn't working either.

What options do I have for this?

Essentially, the data comes in via AJAX and I want it to appear one
wheel at a time, with each wheel being slightly delayed so that they
appear smoothly.

Regards,

Richard Quadling.
-- 
-
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
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-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.