[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: problem: select-one and events

2008-09-29 Thread Hector Virgen
[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 [EMAIL PROTECTED] wrote: I'm not too sure, but I think it's because you need to observe the event where the event is fired

[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] but

[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 class

[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,

[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 destructive

[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 this

[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

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

2008-10-08 Thread Hector Virgen
]wrote: This might not work in IE, as IE doesn't return textnodes 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

[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 think the basic idea is you want to set up an observer

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

2008-10-08 Thread Hector Virgen
will need to use either a smarter selector or a test inside the loop to only return the non- child portion of the element. Walter On Oct 8, 2008, at 11:31 AM, Hector Virgen wrote: Maybe there's a better way to approach my problem. I have a nested unordered list that contains

[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 3

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

2008-10-09 Thread Hector Virgen
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 is interacting directly with the database, you should not need to keep your data escaped. Once javascript

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

2008-10-09 Thread Hector Virgen
or single quotes. On Thu, Oct 9, 2008 at 4:38 PM, Hector Virgen [EMAIL PROTECTED] wrote: Maybe I'm not understanding your implementation, but why do the quotes have to be escaped? If you are passing the data to a function, and is already in the form of a variable, then you do not need

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

2008-10-09 Thread Hector Virgen
coming from the server via an ajax interaction and not on a page load. I can certainly post code, but maybe I was more clear about the situation here. On Thu, Oct 9, 2008 at 4:58 PM, Hector Virgen [EMAIL PROTECTED] wrote: Why are you printing the variable contents instead of using

[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: 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 beautifull

[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 it

[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 =

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

2008-11-07 Thread Hector Virgen
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 cookiejar class I am creating. sample code: var element = new Element('div'); var

[Proto-Scripty] Re: Browser Support List?

2008-11-14 Thread Hector Virgen
, 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'm particularly interested in slightly-older Mac-based browsers like IE5.5 and Safari 2. Thanks! -Hector

[Proto-Scripty] Re: Browser Support List?

2008-11-14 Thread Hector Virgen
. 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 / com On Nov 14, 4:08 pm, Hector Virgen [EMAIL PROTECTED] wrote

[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 elements

[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,

[Proto-Scripty] Re: Focused field

2008-11-19 Thread Hector Virgen
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; Event.observe(document, 'dom:loaded', function() { $$('input, select, textarea').invoke

[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 further

[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

[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]

[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 www...@pochta.ru wrote: sorry - I do

[Proto-Scripty] Re: Modifying prototypescriptaculous 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 kan...@gmail.com wrote: On Jan 23, 3:00 pm, Gabriel Gilini gabr...@usosim.com.br wrote: Quoting the Ecma-262: This standard specifies one departure from the grammar given in 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 wilkola...@gmail.com wrote: Hector Virgen wrote: Hello, I am writing a plugin that takes a text

[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 greg.hauptm...@gmail.comwrote: Hi all, I confess this is a newbie question in advance: Q1 - If one wants to build a

[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 djvir...@gmail.com 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

[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 djvir...@gmail.com wrote: event.element() may not necessarily

[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 brentnicho...@gmail.comwrote: Hello all, I found that the getElementsByClassName had been

[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 araghuram...@gmail.comwrote: 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