[Proto-Scripty] A better Each

2008-10-06 Thread kstubs
I have a JSON array list, I am matching the "Name" item against 1 or more items in my match array. Pseudo: for each list.item if item "Name" contains one and every (must match every item in array) then: TRUE return new item to filtered list Example Data: Apple Martini Gin Martini Slippery Nipp

[Proto-Scripty] Form Checkbox Count

2008-10-06 Thread lesmith
Hello Peeps. Hope you can advice me on how to do this. Im new to prototype so please be gentle. I currently have a form where clients can see a list of invoices. They can select a set of invoices via checkbox and hit the pay button thus sending them to a page which gives a total. I would now li

[Proto-Scripty] Drag'N'Drop question

2008-10-06 Thread Sloan
Hi all, I'm new to prototype and script.aculo.us. I'm building an interface that will allow a user to drag a "tool" onto a workarea and drop it. So far, pretty easy. But I need to image/object being dragged to be different from the one the user clicked on at the start of the drag. The item the use

[Proto-Scripty] Re: Prototype wiki?

2008-10-06 Thread T.J. Crowder
Hey Tobie, > There are some security issues with the github wiki which currently > makes it improper to be used as a community wiki. Okay. > Regarding the FAQ, I remember clearly requesting a number of changes > to it before publishing it and haven't heard about it since then. As of our email

[Proto-Scripty] Re: A better Each

2008-10-06 Thread T.J. Crowder
Hi Karl, The biggest issue I see there is what look like global variables: Without 'var' statements in your closure, you're using implicitly- declared global variables, which is a very bad idea. I haven't had time to blog the last few months, but I have a post on this: http://blog.niftysnippets.

[Proto-Scripty] script.aculo.us: effect busy or not...

2008-10-06 Thread Roland
How can i verify if an element currently has an effect which is busy.. looking for something like: $('myElement').__effectBusy //-> boolean What are my options? Roland, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

[Proto-Scripty] Re: Script.aculo.us 2

2008-10-06 Thread Baglan
> 'course it is :-)  Check out: > >        http://github.com/madrobby/scripty2 > > Coming up soon: finalization of the brand-new effects engine, then new > Behaviors module and all-new Drag-n-Drop module.  Then Controls and > Sound will be ported, quite probably by YT, and Builder may end up as an

[Proto-Scripty] Re: Form Checkbox Count

2008-10-06 Thread ColinFine
On Oct 6, 12:06 am, lesmith <[EMAIL PROTECTED]> wrote: > Hello Peeps. > > Hope you can advice me on how to do this. Im new to prototype so > please be gentle. > > I currently have a form where clients can see a list of invoices. They > can select a set of invoices via checkbox and hit the pay bu

[Proto-Scripty] Scriptaculous - Sound.play problem

2008-10-06 Thread Doug
Sound.play works perfectly when the url I specify is a link to the .wav file I wish to play. However, I need the wav file to be dynamic on the server side. So I wish to have the url specify a link such as MyGetWav.aspx?file=t.wav This method appears to be downloaded in the wav file, but the sou

[Proto-Scripty] Re: script.aculo.us: effect busy or not...

2008-10-06 Thread Diodeus
Here's the cheap-and-cheerful method: var running = 1 new Effect.Fade('something',{afterFinish:function(){running=0} }) If you want to go into the guts of scriptaculous, you can look at the effect queue object: http://github.com/madrobby/scriptaculous/wikis/effect-queues On Oct 6, 7:22 am, Ro

[Proto-Scripty] Re: Help needed with element.offsetHeight

2008-10-06 Thread Brian Williams
Kangax, thanks for the info on Position; however having made that change didn't affect my issue. using javascript:alert(document.compatMode) confirms that ie6 is in compatibility mode. I can only assume that it is being affected by CSS inheritance -- for how I have hard coded top and left through

[Proto-Scripty] Re: Help needed with element.offsetHeight

2008-10-06 Thread Brian Williams
or i could just use Prototype.Browser.IE der... sorry, too many projects to memorize the API for everything... thanks for the help On Mon, Oct 6, 2008 at 11:01 AM, Brian Williams <[EMAIL PROTECTED]>wrote: > Kangax, thanks for the info on Position; however having made that change > didn't affe

[Proto-Scripty] Re: Drag'N'Drop question

2008-10-06 Thread Diodeus
Here's how to make the drag/drop work. Putting a "clone" of the dragged item back in the start position depends on how you want your code to work afterwards. Does the item need to be dragged again? .hovering { background-image:url(Images/something.png); background-repeat:no-repe

[Proto-Scripty] Re: Prototype wiki?

2008-10-06 Thread Jerod Venema
On Sun, Oct 5, 2008 at 5:30 PM, Tobie Langel <[EMAIL PROTECTED]> wrote: > > There are some security issues with the github wiki which currently > makes it improper to be used as a community wiki. Is there are reason we're stuck with github? We could go with mediawiki or any other of the gazillio

[Proto-Scripty] Re: Drag'N'Drop question

2008-10-06 Thread Sloan
I've tried using the clone and then replaceing the HMTL of the clone with the HTML of the object (it's not an image). What I missed was the droppables.add. Thanks! The "placed" item will need to be draggable later, but at that point it's entirely seperate from the original drag'n'drop. What I'm b

[Proto-Scripty] Webmonkey - Getting started with Prototype

2008-10-06 Thread Diodeus
Webmoney.com has posted a great article for those new to Prototype: http://www.webmonkey.com/tutorial/Get_Started_With_Prototype Its worth a read. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.

[Proto-Scripty] Re: Prototype wiki?

2008-10-06 Thread T.J. Crowder
Hey Jerod, Yeah, I was asking about github because Prototype is already hosted there, and the official script.aculo.us wiki is hosted there, so it seemed logical to at least ask what the plan was. Anyone who reads this group regularly will know that I'm a big believer in we, the community, doing

[Proto-Scripty] Chicago JavaScript Meetup

2008-10-06 Thread Justin Meyer
Excuse 'spamming' the forum, but it's relevant Vlad Didenko is organizing Chicago's first JavaScript meetup. If you are in the Chicago area and looking to improve your JavaScript skills, join the group at http://javascript.meetup.com/10/. We are posting discussion/talk topics to http://tin

[Proto-Scripty] Re: Drag and Drop with overflow auto

2008-10-06 Thread blechler
The patch to which you are linking works fine in FF3, but in IE as soon as I try to drag something I get an error stating that 'style' is not defined. If you could please provide the code you tacked on to the end of your dragdrop.js file I would really appreciate it. On Sep 18, 3:50 am, bazikch

[Proto-Scripty] OT: Idea for the Prototype wiki site whever it may be

2008-10-06 Thread Brian Williams
My idea is pretty straight forward. A "Newb's Corner" type of area where those who are experienced or even those who aren't all that experienced can make a post or whatnot and talk about something simple that the less-experienced may not know about, or may not be documented all that well. Seriou

[Proto-Scripty] Re: Drag and Drop with overflow auto

2008-10-06 Thread blechler
Actually it says "style is null or not an object". Stupid IE. The Microsoft script debugger points me to line 1903 in prototype.js var value = element.style[style]; Thanks in advance. On Oct 6, 1:38 pm, blechler <[EMAIL PROTECTED]> wrote: > The patch to which you are linking works fine in FF3

[Proto-Scripty] Re: OT: Idea for the Prototype wiki site whever it may be

2008-10-06 Thread T.J. Crowder
@Brian - Sounds like a good idea! One thing I was thinking of was very similar, basically a list of simple things and how Prototype helps you do them. @diodeus: Your (sic) not the only one.. ;-) I'll have something up soon... -- T.J. Crowder tj / crowder software / com On Oct 6, 7:12 pm, Diod

[Proto-Scripty] form.request(...) fails.

2008-10-06 Thread MikeFeltman
Hello, I refactored some previously working code to take advantage of Prototype classes and now this code seems to fail for no apparent reason. Within a class method I've included a call to the request method of a form object. If I step through the code the request is eventually sent from the req

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-06 Thread Lea Hayes
This works great, until a form or input element, is within the element hierarchy. It is mainly a problem with the HTML input tag, because most of the time (especially in ASP.NET) everything is contained within the form. Test Page Object.extend(Element.

[Proto-Scripty] Re: Form Checkbox Count

2008-10-06 Thread Matt Foster
Looks like you're going to need more data in the checkbox. As you're going to need the ID as well i'd leave that as is. But you can add an extra attribute to help with this calculation. Javascript has no problem accessing what could be considered a custom attribute. On Oct 5, 6:06 pm, lesmi

[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: OT: Idea for the Prototype wiki site whever it may be

2008-10-06 Thread kangax
On Oct 6, 2:01 pm, "Brian Williams" <[EMAIL PROTECTED]> wrote: > My idea is pretty straight forward. > > A "Newb's Corner" type of area where those who are experienced or even those > who aren't all that experienced can make a post or whatnot and talk about > something simple that the less-experie

[Proto-Scripty] Re: OT: Idea for the Prototype wiki site whever it may be

2008-10-06 Thread Diodeus
Don't worry Brian, I'll have lots of typos to fix :) On Oct 6, 2:01 pm, "Brian Williams" <[EMAIL PROTECTED]> wrote: > My idea is pretty straight forward. > > A "Newb's Corner" type of area where those who are experienced or even those > who aren't all that experienced can make a post or whatnot a

[Proto-Scripty] Re: Form Checkbox Count

2008-10-06 Thread Walter Lee Davis
On Oct 6, 2008, at 4:08 PM, Matt Foster wrote: > Looks like you're going to need more data in the checkbox. As you're > going to need the ID as well i'd leave that as is. But you can add an > extra attribute to help with this calculation. > > > > Javascript has no problem accessing what could

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

2008-10-06 Thread Justin Perkins
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 methods on elements such as Element#update and Element#replace. http://prototypejs.org/api/function/wrap -justin --~--~-~--~~~

[Proto-Scripty] Re: Form Checkbox Count

2008-10-06 Thread Brian Williams
just do like it was meant php will recognize it as an array and parse it ( $_POST['invoiceID'] ) just fine if for some strange reason you can't - do a for loop over $_POST and use a regex On Mon, Oct 6, 2008 at 5:30 PM, Walter Lee Davis <[EMAIL PROTECTED]> wrote: > > > On Oct 6, 2008, at

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

2008-10-06 Thread Arak Tai'Roth
Anybody feel like helping me? I asked around the CakePHP group and they say it's a Javascript error, so just checking back in here for some help on this issue. On Sep 25, 11:45 pm, "Arak Tai'Roth" <[EMAIL PROTECTED]> wrote: > So I am using the prototype and scriptaculous on my webpage that I am >

[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] How can I get input elements of a div in order of their position?

2008-10-06 Thread buda
How can I get elements [select-one, input-text, input-checkbox, input- radio, textarea] which are placed in a div in order of their position in it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.a

[Proto-Scripty] Re: How can I get input elements of a div in order of their position?

2008-10-06 Thread Justin Perkins
Have you looked into the Form helper methods such as Form#getElements? http://prototypejs.org/api/form/getElements -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To pos

[Proto-Scripty] Re: Prototype wiki?

2008-10-06 Thread Jerod Venema
OK, that makes good sense. Glad you're moving on with something else if we can't use github for security reasons. Let me know if I can help. On Mon, Oct 6, 2008 at 12:48 PM, T.J. Crowder <[EMAIL PROTECTED]>wrote: > > Hey Jerod, > > Yeah, I was asking about github because Prototype is already host

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

2008-10-06 Thread buda
> Also in this case using > custom events doesnt make a lot of sense since you could just do > $('Select1').observe('change', function() { alert('changed'); })) > and have the same behavior U a right in case if it clear and it is known what to do, but I create a class for 'linked' selects and the

[Proto-Scripty] Re: How can I get input elements of a div in order of their position?

2008-10-06 Thread buda
it gets all elements for a form? but I need for a div! On 7 окт, 03:13, "Justin Perkins" <[EMAIL PROTECTED]> wrote: > Have you looked into the Form helper methods such as Form#getElements? > > http://prototypejs.org/api/form/getElements > > -justin --~--~-~--~~~---~--~

[Proto-Scripty] Re: How can I get input elements of a div in order of their position?

2008-10-06 Thread buda
it is - but on a form it may be several divs filled with input elements and I have to work with them separetely from other divs and I need to have their right ordered array of input elements On 7 окт, 04:35, "Justin Perkins" <[EMAIL PROTECTED]> wrote: > 2008/10/6 buda <[EMAIL PROTECTED]>: > > > i

[Proto-Scripty] Re: How can I get input elements of a div in order of their position?

2008-10-06 Thread RobG
On Oct 7, 10:08 am, buda <[EMAIL PROTECTED]> wrote: > How can I get elements [select-one, input-text, input-checkbox, input- > radio, textarea] which are placed in a div in order of their position > in it? use div.getElementsByTagName('*') to get all the div's decendents in DOM order. Iterate o

[Proto-Scripty] Re: How can I get input elements of a div in order of their position?

2008-10-06 Thread Justin Perkins
2008/10/6 buda <[EMAIL PROTECTED]>: > > it is - but on a form it may be several divs filled with input > elements and I have to work with them separetely from other divs and I > need to have their right ordered array of input elements You're right, sorry I did not think of that. Rob's idea is a g

[Proto-Scripty] Re: How can I get input elements of a div in order of their position?

2008-10-06 Thread buda
Thanks for idea, there is no any way by doing it with prototype.js nativly? On 7 окт, 05:14, RobG <[EMAIL PROTECTED]> wrote: > On Oct 7, 10:08 am, buda <[EMAIL PROTECTED]> wrote: > > > How can I get elements [select-one, input-text, input-checkbox, input- > > radio, textarea] which are placed in

[Proto-Scripty] Re: How can I get input elements of a div in order of their position?

2008-10-06 Thread Justin Perkins
2008/10/6 buda <[EMAIL PROTECTED]>: > > Thanks for idea, there is no any way by doing it with prototype.js > nativly? Correct, it would require chaining something like Enumerable#select or something else. $('form-id').getElements().select(function(element){ return element.up('div#your-div-id');

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

2008-10-06 Thread Arak Tai'Roth
You got it: On Oct 6, 5:38 pm, "Hector Virgen" <[EMAIL PROTECTED]> wrote: > 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

[Proto-Scripty] Re: How can I get input elements of a div in order of their position?

2008-10-06 Thread RobG
On Oct 7, 12:22 pm, buda <[EMAIL PROTECTED]> wrote: > Thanks for idea, there is no any way by doing it with prototype.js > nativly? Sure, use $A to convert the returned NodeList to an array and use each to iterate over it. As far as I know, Prototype.js doesn't wrap getElementsByTagName - what

[Proto-Scripty] Re: How can I get input elements of a div in order of their position?

2008-10-06 Thread buda
Thanks a lot for the idea with ancestor - I have resolve the problem On 7 окт, 05:34, RobG <[EMAIL PROTECTED]> wrote: > On Oct 7, 12:22 pm, buda <[EMAIL PROTECTED]> wrote: > > > Thanks for idea, there is no any way by doing it with prototype.js > > nativly? > > Sure, use $A to convert the returne

[Proto-Scripty] Re: How can I get input elements of a div in order of their position?

2008-10-06 Thread buda
The question is how to chek if the control has the div as a ancestor (controls often positioned in different elements ro make UI) On 7 окт, 05:34, RobG <[EMAIL PROTECTED]> wrote: > On Oct 7, 12:22 pm, buda <[EMAIL PROTECTED]> wrote: > > > Thanks for idea, there is no any way by doing it with prot

[Proto-Scripty] Re: How can I get input elements of a div in order of their position?

2008-10-06 Thread Justin Perkins
2008/10/6 buda <[EMAIL PROTECTED]>: > it gets all elements for a form? but I need for a div! Usually wherever *form* elements (input, select, textarea) exist, a tag will be around them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[Proto-Scripty] using onSuccess(transport, json) and header("Content-type: application/x-json")

2008-10-06 Thread liketofindoutwhy
For some reason, no matter what I use new Ajax.Request(url, { method: 'get', onSuccess: function(transport, json){ //alert(Object.inspect(json)); alert(json ? Object.inspect(js

[Proto-Scripty] Re: using onSuccess(transport, json) and header("Content-type: application/x-json")

2008-10-06 Thread jason maina
Try this: //php $myArray=array('status'=>1); $jsonData=json_encode($myArray); return $jsonData; Dont forget the header. //javascript/prototype jsonResponse=eval('('+response.responseText+')'); Access data as array: var myVal=jsonResponse[0].status; Hope that helps On 10/7/08, liketofindoutwhy <

[Proto-Scripty] Re: using onSuccess(transport, json) and header("Content-type: application/x-json")

2008-10-06 Thread jason maina
Something I forgot json in your case will recieve the header while transport the XHR object. So will have to evaluate transport & not json On 10/7/08, liketofindoutwhy <[EMAIL PROTECTED]> wrote: > > For some reason, no matter what I use > > new Ajax.Request(url, { > me

[Proto-Scripty] Detect element is being dragged in sortable

2008-10-06 Thread TigerInCanada
Is there a way that the element with is being dragged can be "aware" that it is being dragged? I have a sortable list where the handle appears when the elements are moused over (somewhat like Basecamp lists) but have a problem if elements are dragged fast, especially in IE, in that the mouseout e

[Proto-Scripty] Re: using onSuccess(transport, json) and header("Content-type: application/x-json")

2008-10-06 Thread T.J. Crowder
Hi, You're looking for the JSON in the second parameter to onSuccess, but that's the result of evaling the X-JSON *header*. From http://www.prototypejs.org/api/ajax/options: "...all callbacks (except onException) are invoked with two parameters: the XMLHttpRequest object and the result of evalua

[Proto-Scripty] Re: Webmonkey - Getting started with Prototype

2008-10-06 Thread Christophe Porteneuve
It's nice, although as a comment suggests, using "invoke" all over the place instead of "each" would be better practice. Also, the section title saying "dom:ready" when it's (fortunately) using the actual dom:loaded in the code is confusing. Finally, I always grit my teeth at non-XHTML code w