[Proto-Scripty] Re: Form.Element#setValue

2008-09-08 Thread Justin Perkins
On Mon, Sep 8, 2008 at 3:35 PM, Alexey Bass [EMAIL PROTECTED] wrote: What I'm asking is that why this is not documented on Prototype site. Maybe it should be mentioned, but really Element#update is just using innerHTML to update the contents of a node, and since innerHTML cannot be used to

[Proto-Scripty] Re: Assigning OnClick Events To Options On A Select Menu?

2008-09-08 Thread Justin Perkins
Why don't you just observe the 'change' event on the select? Works in all browsers, and is the standard method for observing select boxes. One tip, where you do: var someNodeList = $('game_types').getElementsByTagName('option'); var nodes = $A(someNodeList);

[Proto-Scripty] Re: Bug in scriptaculous-js-1.6.4

2008-09-08 Thread Justin Perkins
On Mon, Sep 8, 2008 at 6:06 PM, Jack D [EMAIL PROTECTED] wrote: This problem exist only with IE. It always shows 1 space. I didn't realize it was just an IE thing. I'm sorry I can't help right now because I don't have IE. I might be able to look into it a bit more tomorrow. -justin

[Proto-Scripty] Re: User types freely on webpage and it jumps to a link...

2008-09-12 Thread Justin Perkins
Yes you could just setup a keyup observer on the entire document, the two problems that I see right away is that any keyboard shortcuts the user already uses may or may not work any longer depending on how you write your code. Secondly, depending on the size of the list of links, the script may

[Proto-Scripty] Re: autocompleter does not work with contents pasted by using mouse

2008-09-12 Thread Justin Perkins
On Fri, Sep 12, 2008 at 11:57 AM, Jack [EMAIL PROTECTED] wrote: Question 1: I've observed that when copy paste the search string using keyboard in the text box, it displays hints. However, if I copy paste the same stuff using mouse, then the hints are not displayed at all. I think the

[Proto-Scripty] Re: recommended css forms

2008-09-16 Thread Justin Perkins
Have you looked into Prototip2? http://www.nickstakenburg.com/projects/prototip2/ -justin --~--~-~--~~~---~--~~ 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

[Proto-Scripty] Re: recommended css forms

2008-09-16 Thread Justin Perkins
On Tue, Sep 16, 2008 at 11:33 AM, Jimmy Brake [EMAIL PROTECTED] wrote: nor anything for locking out the rest of a page while using the form(I could have missed it). If you want to do lockout style forms, then the lightbox approach is the best way. -justin

[Proto-Scripty] Re: Need Help with Ajax.Request Parameters

2008-09-16 Thread Justin Perkins
On Tue, Sep 16, 2008 at 10:57 AM, TheZ [EMAIL PROTECTED] wrote: parameters : { user : { first:'first_name', last:'last_name' } } The Ajax.Request object does not handle nested parameters. You should use a string instead. 'user[first]=first_nameuser[last]=last_name' This is

[Proto-Scripty] Re: $$( ) returns hidden/removed tr tags

2008-09-16 Thread Justin Perkins
If all your HTML and JavaScript is in one file, you can put it in pastie and then provide a link. See here: http://pastie.org/ Since you're using Prototype, you should take advantage of it's helper methods to traverse the DOM, such as Element#up and Element#down instead of messing with

[Proto-Scripty] Re: $$( ) returns hidden/removed tr tags

2008-09-16 Thread Justin Perkins
Just as I thought, you are calling your function setRowFeatures immediately instead of waiting until the row is removed. Due to implementation problems in browsers like IE, I really recommend against using effects on table elements. Take these 2 lines of code: row.fade(); //{afterFinish:

[Proto-Scripty] Re: $$( ) returns hidden/removed tr tags

2008-09-16 Thread Justin Perkins
Like I said in my first post, delay invoking your function for the same amount of time as the effect. There's a few different ways to achieve this, but the goal is don't do any row counting/alteration/etc until after the effect is complete. row.fade({duration:0.5}); setTimeout(function(){

[Proto-Scripty] Re: submiting form created by Ajax.inPlaceEditor

2008-09-17 Thread Justin Perkins
On Tue, Sep 16, 2008 at 2:21 PM, Tokeiito [EMAIL PROTECTED] wrote: Is there a way to triger submit by using object i get after: var editor = new Ajax.InPlaceEditor(...); ? You might try calling editor.handleFormSubmission(), although that method expects an event argument it appears to be safe

[Proto-Scripty] Re: Disable form submission

2008-09-17 Thread Justin Perkins
To add to the list of ideas, I would recommend you override the Ajax.InPlaceEditor#checkForEscapeOrReturn method to do what you want since that's where this submit event is getting fired from. Ajax.InPlaceEditor.addMethods({ checkForEscapeOrReturn: function(e) { if (!this._editing ||

[Proto-Scripty] Re: toHTML() doesn't work

2008-09-17 Thread Justin Perkins
On Wed, Sep 17, 2008 at 8:00 PM, yawnmoth [EMAIL PROTECTED] wrote: It's Object#toHTML: http://www.prototypejs.org/api/object/tohtml Yes, like Object.toHTML(someObject), not someObject.toHTML(). --~--~-~--~~~---~--~~ You received this message because you are

[Proto-Scripty] Re: issues with getElementBySelector

2008-09-18 Thread Justin Perkins
On Thu, Sep 18, 2008 at 10:09 AM, Matt Foster [EMAIL PROTECTED] wrote: bluezehn, the $$ method just executes getElementsBySelector on the document. http://prototypejs.org/api/element/getelementsbyselector Doesn't $$ use Element#select? Nobody should be using getElementsBySelector if you're

[Proto-Scripty] Re: AJAX autocompleter

2008-09-18 Thread Justin Perkins
On Thu, Sep 18, 2008 at 2:30 PM, Jack D [EMAIL PROTECTED] wrote: Hello, any clue regarding memory leak? What version of IE? IE is well known for it's memory leaks with JavaScript. I recommend using a memory leak tool for IE rather than just looking at the task manager. sIEve is one

[Proto-Scripty] Re: AJAX autocompleter

2008-09-18 Thread Justin Perkins
On Thu, Sep 18, 2008 at 3:02 PM, Jack D [EMAIL PROTECTED] wrote: Hi Justin, I'm using IE 6. In the memory leak tool which you've specified, if the #leak is showing some number, then does it mean that its a memory leak? I guess, but with IE there will be all sorts of stuff marked as #leak.

[Proto-Scripty] Re: binding to preserve 'this' keyword scope

2008-09-19 Thread Justin Perkins
If you just bind your observer to the current instance of this when you are setting up your observer, everything will work fine. Here is a contrived example to illustrate usage. // this code is untested var Foo = { initialize: function(){ this.message = 'I am who I say I am'; this.body

[Proto-Scripty] Re: yet another show/hide example

2008-09-24 Thread Justin Perkins
I prefer not to nest my code like that, I feel like it is difficult to read and hard to extend/modify (read: fragile), but if that's how you like to read your code and you find it easier to read/write, then that's all that matters. I think if that code works for you now, then you should just be

[Proto-Scripty] Re: Ajax.Autocomplete Questions

2008-09-25 Thread Justin Perkins
On Thu, Sep 25, 2008 at 2:36 PM, ericindc [EMAIL PROTECTED] wrote: First, in the online Ajax.Autocompleter document's Server Return section, it states that the server must return an unordered list. So, in my server side PHP code I literally return a string containing the unordered list.

[Proto-Scripty] Re: Effect.Highlight and :hover stops working?

2008-09-25 Thread Justin Perkins
That is happening because the background color of the row is set with inline CSS to be the original background color when the highlight effect is complete. Inline CSS always has priority over CSS in the stylesheet. Maybe you can try using the !important declaration to override it? Note that the

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

2008-09-26 Thread Justin Perkins
I like Prototype better than any other framework :p -justin --~--~-~--~~~---~--~~ 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

[Proto-Scripty] Re: event.observer oncontextmenu

2008-10-02 Thread Justin Perkins
You need to attach it to the window object, not the document.body object. Event.observe(window, 'contextmenu', someMethod); -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group.

[Proto-Scripty] Re: event.observer oncontextmenu

2008-10-02 Thread Justin Perkins
On Thu, Oct 2, 2008 at 12:47 PM, kangax [EMAIL PROTECTED] wrote: It could, if you are using an older version. Latest one doesn't check against a list of event names, so observing an event on document.body should work. Yes it does. I thought it was only a window event but sure enough it works

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

2008-10-03 Thread Justin Perkins
That's a good idea. I prefer to leave the prototype and scriptaculous source files in pristine condition whenever possible so that when I update to a newer version I don't have to keep track of what I changed and having to reapply those changes. So here is the same idea, but extending

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

[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 form tag will be around them. --~--~-~--~~~---~--~~ You received this message because you are subscribed

[Proto-Scripty] Re: Ajax.Responders

2008-10-07 Thread Justin Perkins
Are you getting any errors? What browser are you using? I think that code can be cleaned up a bit, $() is expensive, it should be used sparingly. Also there is no need to call appear on an already visible element. Ajax.Responders.register({ onCreate: function(request){ var loading =

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

2008-10-07 Thread Justin Perkins
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( function(element){ return element.nodeType == 3; } ) Or better yet: Element.addMethods({ textNodes: function(element){

[Proto-Scripty] Re: Ajax.Responders

2008-10-07 Thread Justin Perkins
On Tue, Oct 7, 2008 at 2:50 PM, Namotco [EMAIL PROTECTED] wrote: WebKit has a JS debugger much like Firebug, no errors. I know, but I still find Firebug to be much better about error reporting. Here's the function I call that seems to no decrement the counter: If there is an error in that

[Proto-Scripty] Re: Form works in Opera Firefox but not in IE and partially in Chrome Safari

2008-10-08 Thread Justin Perkins
Can you create a simple page that displays this problem? It is very hard to debug/view your code on the live site. Also, at this point I consider Chrome a novelty but obviously you want things to work in IE and Safari might be a priority too. -justin

[Proto-Scripty] Re: Form works in Opera Firefox but not in IE and partially in Chrome Safar

2008-10-08 Thread Justin Perkins
In Safari, when I change the first drop-down, the second and third drop-downs are updated but the second one remains disabled. Is that your intention or is that the bug you are describing? -justin --~--~-~--~~~---~--~~ You received this message because you are

[Proto-Scripty] Re: Form works in Opera Firefox but not in IE and partially in Chrome Safa

2008-10-09 Thread Justin Perkins
On Thu, Oct 9, 2008 at 3:02 AM, Mondane [EMAIL PROTECTED] wrote: The bug in Safari is, when choosing an option in the third drop-down (Choose your category), the form resets to only showing Choose your game. After this, it stops working. I didn't have that problem, was able to get through all

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

2008-10-09 Thread Justin Perkins
I know of no native way to do this. The first thing that comes to mind is using window.setInterval() to invoke a function every couple of seconds to see if the address bar has been changed. Are you updating the address bar when an Ajax request changes the page, but then when you click the back

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

2008-10-09 Thread Justin Perkins
On Thu, Oct 9, 2008 at 12:03 PM, Mauro Marchiori Neto [EMAIL PROTECTED] wrote: setInterval right? wouldnt it overload the browser? Not necessarily, as long as your URL checking function is simple and you don't check very frequently. Say, something like this: var AnchorChecker = { initialize:

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

2008-10-09 Thread Justin Perkins
On Thu, Oct 9, 2008 at 10:42 PM, RobG [EMAIL PROTECTED] wrote: Interesting, but it relies on browser sniffing and proprietary properties. What's wrong with that? If it is in the name of performance, I say go for it. -justin --~--~-~--~~~---~--~~ You received

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

2008-10-11 Thread Justin Perkins
On Sat, Oct 11, 2008 at 10:31 AM, RobG [EMAIL PROTECTED] wrote: Performance is not the issue - fewer lines of code doesn't necessarily mean faster performance. Do you differentiate between browser sniffing and object/method sniffing? Do you like that Prototype's Selector#findElements method

[Proto-Scripty] Re: One AJAX Script, Three Browser Bugs?

2008-10-13 Thread Justin Perkins
There is no inherit flaws in Prototype that would cause erratic behavior like you are describing. That's just plain ludicrous for somebody to suggest that, typical jQuery crowd trying to pimp their framework at any chance they can ;) Right away I think your initializer code is buggy. Not sure

[Proto-Scripty] Re: Prototype.js (1.6.0.3) breaks Firebug (1.2.1) Options allegedly.

2008-10-14 Thread Justin Perkins
Ever since Firefox3, there have been many issues with Firebug and I find it pretty hard to believe that Prototype is the cause of these issues. There didn't seem to be anything wrong with running Firebug and Prototype side-by-side on Firefox2. Guess it's easier to blame than to fix. What

[Proto-Scripty] Re: Demos?

2008-10-19 Thread Justin Perkins
All that stuff has been moved to the github wiki for Scriptaculous: http://github.com/madrobby/scriptaculous/wikis All the scriptaculous links at script.aculo.us point over to the wiki but I did notice that the animation framework link points to an invalid page at github, which probably made

[Proto-Scripty] Re: Demos?

2008-10-19 Thread Justin Perkins
I agree github is a little tough to use if you're just looking for demos. There has been a lot of talk about setting up an easier to use wiki, but the details are still being worked out iirc. In the meantime the wiki on github is the best option. Which effect are you wanting to loop? -justin

[Proto-Scripty] Re: I use Updater with a webpage in different folder. I can't see images

2008-10-21 Thread Justin Perkins
Why don't you use paths to your images that are relative to the webroot instead of the directory they are in so that they work no matter where they are? The convention is to have a directory in your webroot called images and all your imagery goes in there. /images/c1/foo.jpg /images/c2/bar.jpg

[Proto-Scripty] Re: PeriodicalExecuter vs. Ajax.PeriodicalUpdater: use cases and advice?

2008-10-21 Thread Justin Perkins
Why aren't you just using the Ajax.PeriodicalUpdater, which supports the decay option? var poller = new Ajax.PeriodicalUpdater('some-element-id', '/foo/bar', {decay:10}); Also, if you pass an empty string as the first parameter, then you can pass pure JavaScript to be executed as opposed to

[Proto-Scripty] Re: PeriodicalExecuter vs. Ajax.PeriodicalUpdater: use cases and advice?

2008-10-21 Thread Justin Perkins
Well since the Ajax requests in Prototype will auto-eval the response, you can modify the page without updating just one div. It's the route I take most of the time. Say you set it up like this: new Ajax.PeriodicalUpdater('', '/some/url'); Then the response from /some/url could be:

[Proto-Scripty] Re: get all values?

2008-10-28 Thread Justin Perkins
given this: div class=foo/div div class=foo/div div class=foo/div div class=foo/div do this: $$('div.foo').each(function(div){ alert(div); }); The each method is an *iterator*. http://prototypejs.org/api/enumerable/each -justin --~--~-~--~~~---~--~~ You