[Proto-Scripty] Re: My Space Application

2008-10-31 Thread Hector Virgen
Try using Element#scrollTo http://prototypejs.org/api/element/scrollto $('content').scrollTo(); On Thu, Oct 30, 2008 at 10:58 PM, Ali Imran Ahmad <[EMAIL PROTECTED]>wrote: > > Hi, i am developing myspace application. I have a form which has large > height so when i post data through ajax request

[Proto-Scripty] JSON and elements / text nodes

2008-11-07 Thread Hector Virgen
Hello, Is it possible to convert elements / text nodes to JSON using Object.toJSON()? I need them in JSON so I can store them in a cookie for the cookiejar class I am creating. sample code: var element = new Element('div'); var nativeelement = document.createElement('div'); var textnode = docume

[Proto-Scripty] Re: JSON and elements / text nodes

2008-11-07 Thread Hector Virgen
te: > > On Nov 7, 2:19 pm, "Hector Virgen" <[EMAIL PROTECTED]> wrote: > > Hello, > > > > Is it possible to convert elements / text nodes to JSON using > > Object.toJSON()? I need them in JSON so I can store them in a cookie for > the > > cooki

[Proto-Scripty] Browser Support List?

2008-11-13 Thread Hector Virgen
Sorry if this has been asked before, but is there an updated list of browsers and versions supported by Prototype? I'm particularly interested in slightly-older Mac-based browsers like IE5.5 and Safari 2. Thanks! -Hector --~--~-~--~~~---~--~~ You received this mess

[Proto-Scripty] Re: Browser Support List?

2008-11-13 Thread Hector Virgen
Thanks! This really should be on the main site, as was pointed out in the thread back in 2007. :) -Hector On Thu, Nov 13, 2008 at 4:19 PM, RobG <[EMAIL PROTECTED]> wrote: > > On Nov 14, 9:54 am, "Hector Virgen" <[EMAIL PROTECTED]> wrote: > > Sorry if this has

[Proto-Scripty] Re: Browser Support List?

2008-11-14 Thread Hector Virgen
s in advance, > -- > T.J. Crowder > tj / crowder software / com > > On Nov 13, 11:54 pm, "Hector Virgen" <[EMAIL PROTECTED]> wrote: > > Sorry if this has been asked before, but is there an updated list of > > browsers and versions supported by Prototype? I&

[Proto-Scripty] Re: Browser Support List?

2008-11-14 Thread Hector Virgen
, T.J. Crowder <[EMAIL PROTECTED]>wrote: > > Hi, > > > Does anyone know if IE 5.5 for the Mac is supported? > > IE 5.5 for the Mac isn't even supported by Microsoft. :-) They EOL'd > it a couple of years ago. > -- > T.J. Crowder > tj / crowder software

[Proto-Scripty] Re: $('tableid').down('tbody').insert(tr, 'top') working but...

2008-11-19 Thread Hector Virgen
I believe Element#insert() expects an object as its parameter, like this: $('tableid').down('tbody').insert({top: tr}); http://prototypejs.org/api/element/insert -Hector On Wed, Nov 19, 2008 at 8:27 AM, jason maina <[EMAIL PROTECTED]> wrote: > Hi, > > As per the subject i'm building DOM eleme

[Proto-Scripty] Re: Focused field

2008-11-19 Thread Hector Virgen
A prototype way might go something like this (untested): var focused; Event.observe(document, 'dom:loaded', function() { $$('input, select, textarea').invoke('observe', 'focus', function(event) { focused = event.element(); }); }); -Hector On Wed, Nov 19, 2008 at 7:50 AM, EM

[Proto-Scripty] Re: Focused field

2008-11-19 Thread Hector Virgen
;); $(document.body).insert(button); -Hector On Wed, Nov 19, 2008 at 8:07 PM, kangax <[EMAIL PROTECTED]> wrote: > > On Nov 19, 3:39 pm, "Hector Virgen" <[EMAIL PROTECTED]> wrote: > > A prototype way might go something like this (untested): > > var focused

[Proto-Scripty] Re: Accessing event handlers

2008-11-21 Thread Hector Virgen
Is it possible to override Element#observe to do this automatically? -Hector On Fri, Nov 21, 2008 at 10:26 AM, Matt Foster <[EMAIL PROTECTED]>wrote: > > To elaborate on Kangax's idea, a DOM element is a dynamic object, > being that you can add custom properties which can be referenced for > furt

[Proto-Scripty] Re: Newbie Element Question

2008-11-21 Thread Hector Virgen
When you create an element with "new Element()", it only exists as a javascript variable until you append the element to the DOM. The $() function looks in the DOM for the element, which is why it is not finding it. Also, you may want to use Element#setStyle() instead of accessing the style prope

[Proto-Scripty] Re: Submit a form using enter

2008-12-10 Thread Hector Virgen
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]> wro

[Proto-Scripty] Re: Submit a form using enter

2008-12-11 Thread Hector Virgen
Does the form (or modal) happen to be in an iframe? -Hector On Thu, Dec 11, 2008 at 3:36 AM, Dave L <[EMAIL PROTECTED]> wrote: > > I tried all the above solutions but none seem to work. This is in a > modal popup, so its almost as if the javascript is not finding the > form element or something

[Proto-Scripty] Re: div.select('select[required="true"]') doesntwork

2008-12-17 Thread Hector Virgen
I suggest using a class name of "required" instead of creating a new attribute. Then it becomes very simple to select() required elements (no to mention styling them with CSS). div.select('select.required'); -Hector On Wed, Dec 17, 2008 at 9:35 AM, buda wrote: > > sorry - I do use quirk mode

[Proto-Scripty] Re: Modifying prototype&scriptaculous to work alongside jQuery

2009-01-21 Thread Hector Virgen
I'm not sure how Drupal has their Javascript set up, but generally you should be able to wrap their JS in an anonymous function: (function($){ // Drupal JS code goes here // Within this block, '$' represents jQuery $('#foo').click(function() { alert('jQuery event'); }); })(

[Proto-Scripty] Re: Modifying prototype&scriptaculous to work alongside jQuery

2009-01-23 Thread Hector Virgen
Wow, so only robot programmers can write a $() function? -Hector On Fri, Jan 23, 2009 at 12:16 PM, kangax wrote: > > On Jan 23, 3:00 pm, Gabriel Gilini wrote: > > Quoting the Ecma-262: > > > > This standard specifies one departure from the grammar given in the > Unicode > > standard: The doll

[Proto-Scripty] Updating value of hidden form control

2009-02-22 Thread Hector Virgen
Hello, I am writing a plugin that takes a text input () and hides it using $(input).hide(). The plugin then uses other controls to update the value of the text input. I am using Element.writeAttribute() to update the value, but it does not seem to work when the input is hidden. However, using the

[Proto-Scripty] Re: Updating value of hidden form control

2009-02-23 Thread Hector Virgen
Thanks for the clarification. I assumed that the attribute would be the same as the element property, but I see now how they can be different. -Hector On Mon, Feb 23, 2009 at 8:15 AM, SWilk wrote: > > Hector Virgen wrote: > > Hello, > > > > I am writing a plugin that t

[Proto-Scripty] Re: building object orientated javascript libraries - does Prototype support/help here???

2009-02-27 Thread Hector Virgen
Check out Class#create http://prototypejs.org/api/class/create It's a great way to get started with OO javascript. -Hector On Fri, Feb 27, 2009 at 3:43 PM, greghauptmann wrote: > > Hi all, > > I confess this is a newbie question in advance: > > Q1 - If one wants to build a set of higher level

[Proto-Scripty] Re: building object orientated javascript libraries - does Prototype support/help here???

2009-02-27 Thread Hector Virgen
Also, here's a shameless plug to my own blog that showcases a simple OO prototype plugin. However, it doesn't use Class#create :( http://www.virgentech.com/code/prototagger -Hector On Fri, Feb 27, 2009 at 5:16 PM, Hector Virgen wrote: > Check out Class#create > > http://

[Proto-Scripty] Re: event.element vs. $('element_id')

2009-03-26 Thread Hector Virgen
event.element() may not necessarily return $('object_id'). It returns the element that fired the event, which can be a child element of $('object_id'). For example: Event.observe('document', 'click', function(event) { console.log('You clicked on: ', event.element()); }); If you look at the co

[Proto-Scripty] Re: event.element vs. $('element_id')

2009-03-26 Thread Hector Virgen
Typo in my JS snippet... there should be no quotes around document Event.observe(document, 'click', function(event) { console.log('You clicked on: ', event.element()); }); -Hector On Thu, Mar 26, 2009 at 4:35 PM, Hector Virgen wrote: > event.element() may

[Proto-Scripty] Re: observe any change in the window

2009-03-29 Thread Hector Virgen
You might want to try adding an observer to all form elements to detect when the values change. For example: var isDirty = false; $$('input, textarea').invoke('observe', 'change', function() { isDirty = true; }); -Hector On Fri, Mar 27, 2009 at 3:22 PM, Stefano Esposito < stefano.esposit...@

[Proto-Scripty] Re: registering observers with classes using $$

2009-04-01 Thread Hector Virgen
$$() uses CSS selectors, so you must pass in a CSS rule. Try this: $$('a.classProjectsEditA').invoke('observe', 'click', editProjectRecord); -Hector On Wed, Apr 1, 2009 at 8:47 AM, BrentNicholas wrote: > > Hello all, > > I found that the getElementsByClassName had been depricated so I'm > tryin

[Proto-Scripty] Re: convert string to a number

2009-04-24 Thread Hector Virgen
Can you use the native parseInt() function? or parseFloat()? var num = parseInt("52"); console.log(num); // int 52 -Hector On Fri, Apr 24, 2009 at 9:06 AM, Ananth Raghuraman wrote: > Need prototype function to convert object/string/number to number. Please > help. > > > > --~--~-~--~-

[Proto-Scripty] Re: How to get SELECTED option description

2009-07-06 Thread Hector Virgen
It seems like you're working against the standard here. Normally, the value is what's important upon submission. But what you want can be done. There are two approaches to this: 1. When rendering the page, make the value and description the same. You'll need to escape the value attribute with html

[Proto-Scripty] Re: javascript widget (using prototypejs)

2008-09-16 Thread Hector Virgen
The script that is making the ajax request has to be on the same domain where the ajax response is coming from. So just keep your script on your server and use a wrapper function from the other domain that calls your script residing on your domain. On Tue, Sep 16, 2008 at 12:23 PM, Diodeus <[EMAIL

[Proto-Scripty] Re: How to get a form elements parent form?

2008-09-19 Thread Hector Virgen
> > I believe all class methods in proto begin with a lowercase letter. Except for Ajax methods. :) -Hector On Fri, Sep 19, 2008 at 8:34 AM, Matt Foster <[EMAIL PROTECTED]> wrote: > > Its because IE doesn't extend the objects prototype, and because > you're referencing it via element.form, it

[Proto-Scripty] Re: How to get a form elements parent form?

2008-09-19 Thread Hector Virgen
Oh, ok! That makes a lot more sense, thanks! I was wondering why those were all capitalized. -Hector On Fri, Sep 19, 2008 at 9:10 AM, Justin Perkins <[EMAIL PROTECTED]>wrote: > > On Fri, Sep 19, 2008 at 11:01 AM, Hector Virgen <[EMAIL PROTECTED]> > wrote: > > Except f

[Proto-Scripty] Re: Does Prototype have a future?

2008-09-26 Thread Hector Virgen
I like Prototype because it takes all the work out of Javascript. I've been using it for a few years now but as a PHP developer I usually only used it for Ajax. Only recently have I started to get acquainted with all of its other components, and it is a pleasure to work with. Just last night, for f

[Proto-Scripty] Re: Newbie question

2008-09-27 Thread Hector Virgen
By default, Ajax sends parameters as post data. Try checking for $_POST["centre"], or change your Ajax call to use the "get" method instead: new Ajax.Request(url, { method: 'get' }); -Hector On Sat, Sep 27, 2008 at 11:52 AM, matthewboh <[EMAIL PROTECTED]> wrote: > > I've done Javascript and

[Proto-Scripty] Re: problem: select-one and events

2008-09-29 Thread Hector Virgen
ction() { alert('changed'); }); -Hector On Mon, Sep 29, 2008 at 8:53 AM, buda <[EMAIL PROTECTED]> wrote: > > No, I want after changing the Select1 call an Event whitch will caught > by Select2 and do somth with Select2 > > On 29 сент, 18:50, "Hector Virgen" &l

[Proto-Scripty] Re: problem: select-one and events

2008-09-29 Thread Hector Virgen
I'm not too sure, but I think it's because you need to observe the event where the event is fired. $('Select1') fires the event, so you need to observe $('Select1') to catch the event, otherwise you're waiting for $('Select2') to fire it, and it never does. 2008/9/28 buda <[EMAIL PROTECTED]> > >

[Proto-Scripty] Re: Does Prototype have a future?

2008-09-29 Thread Hector Virgen
"prototype" yields 49.1 million hits, but that's not exactly fair... On Mon, Sep 29, 2008 at 3:54 PM, Dan Dorman <[EMAIL PROTECTED]> wrote: > > On Mon, Sep 29, 2008 at 4:43 PM, MikeFeltman <[EMAIL PROTECTED]> > wrote: > > > > One comment I'd like to make on momentum... > > > > A Google search for

[Proto-Scripty] Re: Fade Effect doesn't work in IE

2008-09-29 Thread Hector Virgen
IE7 has very poor support for alpha-blended transparent images. I'm not sure if it would work, but what if you fade a wrapper div instead of the div with the background image? -Hector On Mon, Sep 29, 2008 at 10:24 PM, Jeusdi <[EMAIL PROTECTED]> wrote: > > I need to do 'Fade' and 'Appear' Effect o

[Proto-Scripty] Re: Fade Effect doesn't work in IE

2008-09-29 Thread Hector Virgen
16 PM, Jeusdi <[EMAIL PROTECTED]> wrote: > > Mmm, What do you mean about wrapper div? > > Hector Virgen ha escrito: > > IE7 has very poor support for alpha-blended transparent images. I'm not > sure > > if it would work, but what if you fade a wrapper div instead

[Proto-Scripty] Re: Can I use onkeydown with invoke?

2008-09-29 Thread Hector Virgen
You want to invoke the 'observe' method: $$('input.info').invoke('observe', 'onkeydown', function(){...}) -Hector On Mon, Sep 29, 2008 at 2:41 PM, Nik <[EMAIL PROTECTED]> wrote: > > Hello all, > > I am wishing to do something like this: > > $$('input.info').invoke('onkeydown', function(){...}) >

[Proto-Scripty] Re: Autocompleter doesn't cancel pending requests

2008-10-03 Thread Hector Virgen
Very nice! I'd like to see this added to Scriptaculous. On Thu, Oct 2, 2008 at 10:38 AM, dinken <[EMAIL PROTECTED]> wrote: > > Bug with Autocompleter not canceling pending Ajax requests causing > potential race condition for onComplete logic. > > //I added this function to the Ajax.Autocompleter

[Proto-Scripty] Re: Dropdownmenu and observe

2008-10-03 Thread Hector Virgen
In my experience I've had success using two different mouseover events instead of a mouseover/mouseout combination. The first mouseover observer is a simple one: $('nav').observe('mouseover', function(event) { $('nav').show(); }); The second observer observes the entire document and checks to

[Proto-Scripty] Observing the removal of elements

2008-10-06 Thread Hector Virgen
Do any callbacks exists for when an element is removed from the DOM via Element.remove()? Or maybe a custom event can be called just prior to the removal? I need something like this to help me remove related "tooltip" divs that are not direct descendants of the element being removed. For example, I

[Proto-Scripty] Re: Observing the removal of elements

2008-10-06 Thread Hector Virgen
Very nice! I think that covers it for my current needs. Thanks :) -Hector On Mon, Oct 6, 2008 at 1:11 PM, Justin Perkins <[EMAIL PROTECTED]>wrote: > > You can use Function#wrap to help you with this by wrapping the > Element#remove method, but you will also have to watch out for other > destructi

[Proto-Scripty] Re: Effect.Fade and Effect.Appear

2008-10-06 Thread Hector Virgen
So on click you want it to fade, and when the Ajax request is completed you want it to appear? On Mon, Oct 6, 2008 at 4:29 PM, Arak Tai'Roth <[EMAIL PROTECTED]>wrote: > > Anybody feel like helping me? I asked around the CakePHP group and > they say it's a Javascript error, so just checking back i

[Proto-Scripty] Vertical Effect.Shake?

2008-10-07 Thread Hector Virgen
Is there a vertical equivalent to Effect.Shake, or a way to make it shake vertically instead of horizontally? -Hector --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to thi

[Proto-Scripty] Getting Text Nodes of Elements

2008-10-07 Thread Hector Virgen
Is there a Prototype way to get the descendants of an element that are only text nodes? Element.descendents() only returns elements. Thanks! -Hector --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.

[Proto-Scripty] Re: Getting Text Nodes of Elements

2008-10-07 Thread Hector Virgen
Thanks! That should do the trick :) On Tue, Oct 7, 2008 at 12:12 PM, Justin Perkins <[EMAIL PROTECTED]>wrote: > > I think you will need to use the native methods to get the text nodes > as Prototype filters them out. This will work though: > > $A( $('some-element-id').childNodes ).select( functio

[Proto-Scripty] Re: Getting Text Nodes of Elements

2008-10-08 Thread Hector Virgen
des in childNodes. > /Søren > > On 07/10/2008, at 21.24, Hector Virgen wrote: > > Thanks! That should do the trick :) > > On Tue, Oct 7, 2008 at 12:12 PM, Justin Perkins <[EMAIL PROTECTED]>wrote: > >> >> I think you will need to use the native methods to ge

[Proto-Scripty] Re: Effect.Fade and Effect.Appear

2008-10-08 Thread Hector Virgen
is helps. -Hector On Wed, Oct 8, 2008 at 8:43 AM, Arak Tai'Roth <[EMAIL PROTECTED]>wrote: > > Are you able to help me with this? > > On Oct 6, 8:28 pm, "Arak Tai'Roth" <[EMAIL PROTECTED]> wrote: > > You got it: > > > > On Oct 6, 5:38 p

[Proto-Scripty] Re: Effect.Fade and Effect.Appear

2008-10-08 Thread Hector Virgen
Correction (but still untested): $$('a.ajaxable').invoke('observe', 'click', handleAjaxClick); -Hector On Wed, Oct 8, 2008 at 11:09 AM, Hector Virgen <[EMAIL PROTECTED]> wrote: > I'm not sure how you'd do this with CakePHP's helper, but I th

[Proto-Scripty] Re: Getting Text Nodes of Elements

2008-10-08 Thread Hector Virgen
> > > The issue lies with the LI that has a UL in it. In that case, you get > > "Bar [bunch of whitespace] Baz", then next you get just "Baz". If the > > order of elements is important, then you will need to use either a > > smarter selector or a test inside th

[Proto-Scripty] Re: Ajax Autocomplete in PHP Loop

2008-10-08 Thread Hector Virgen
The problem is that each of your input boxes have the same ID. All instance of the Autocompleter are being attached to that ID, and the DOM only returns the first one. On Wed, Oct 8, 2008 at 12:42 PM, kevandju <[EMAIL PROTECTED]> wrote: > > Example of what HTML looks like if a user chooses to add

[Proto-Scripty] Re: Ajax Autocomplete in PHP Loop

2008-10-08 Thread Hector Virgen
You should still use a unique ID. In your PHP, you can do this: for ($i=0,$k=2;$k<=$c;$i++,$k++) { echo ' new Ajax.Autocompleter("hlp_callsign' . $i . ' ","hint","callsign_search.php", {paramName:"name"}); '; } On Wed, Oct

[Proto-Scripty] Re: parsing json strips slashes before quotes - can I avoid this?

2008-10-09 Thread Hector Virgen
Is there a reason you need the data to remain escaped while being used by javascript? Unless your javascript is interacting directly with the database, you should not need to keep your data escaped. Once javascript is done with the data, and sends it back to the server, the server should then re-es

[Proto-Scripty] Re: location.hash and event handler/window event

2008-10-09 Thread Hector Virgen
I think you can avoid the setInterval function by using Ajax.Responders. http://www.prototypejs.org/api/ajax/responders Ajax.Responders.register({ onComplete: function() { new AnchorChecker(); } }); -Hector On Thu, Oct 9, 2008 at 12:52 PM, Justin Perkins <[EMAIL PROTECTED]>wrote: > >

[Proto-Scripty] Re: parsing json strips slashes before quotes - can I avoid this?

2008-10-09 Thread Hector Virgen
gt; a library that has better xml support. > > > >> >> On Thu, Oct 9, 2008 at 3:53 PM, Hector Virgen <[EMAIL PROTECTED]> wrote: >> >>> Is there a reason you need the data to remain escaped while being used by >>> javascript? Unless your javascript

[Proto-Scripty] Re: parsing json strips slashes before quotes - can I avoid this?

2008-10-09 Thread Hector Virgen
own to china town', 100);" > > both of those throw errors. obviously I need it to work for double quotes > or single quotes. > > > > > On Thu, Oct 9, 2008 at 4:38 PM, Hector Virgen <[EMAIL PROTECTED]> wrote: > >> Maybe I'm not understanding

[Proto-Scripty] Re: parsing json strips slashes before quotes - can I avoid this?

2008-10-09 Thread Hector Virgen
e. > > so in reference to "Are you using javascript to print out the onmouseover > text, or a server-side language?" - yes, I am using javascript to print the > mouseover text because it's coming from the server via an ajax interaction > and not on a page load. > >

[Proto-Scripty] Re: Getting Text Nodes of Elements

2008-10-09 Thread Hector Virgen
Would it be better to receive text nodes as an enumerable? Maybe something like Element#childTextNodes() to compliment Element#childElements()? It would be nice if text nodes that contain only white space are excluded. -Hector On Thu, Oct 9, 2008 at 8:56 PM, Justin Perkins <[EMAIL PROTECTED]>wrote

[Proto-Scripty] Re: Using .morph to change an elements class?

2008-10-13 Thread Hector Virgen
For adding and removing class names, you should use Element#addClassName and Element#removeClassName. It is much more consistent across all browsers. -Hector On Mon, Oct 13, 2008 at 12:06 AM, Mads <[EMAIL PROTECTED]> wrote: > > Could i use the .morph effect to change an entire class? > > Tried to

[Proto-Scripty] Re: Dynamic script file loading

2008-10-15 Thread Hector Virgen
When the "script" element is inserted into the document body, does the currently-running script wait for the js file to be downloaded and executed? Or does the js file download in the background while the current script finishes? -Hector 2008/10/15 buda <[EMAIL PROTECTED]> > > tere is a beautiful