[Proto-Scripty] Calling function every time PeriodicalUpdater makes a request

2009-04-27 Thread BryanG
I'm trying to call a JavaScript function every time PeriodicalUpdater makes a request (so I can check the response to see if the PeriodicalUpdater needs to be stopped). I've tried numerous methods - creating a responder for OnComplete, passing an OnComplete callback, and having the web page that

[Proto-Scripty] adding and removing classnames

2009-04-27 Thread Jeff
i'm new to prototype. i was using jQuery and loved it and am a little confused coming over to prototype. i am trying to add and remove a class of active to a labels parent div. does anyone know why i can't do this? i've tried this http://groups.google.com/group/prototype-scriptaculous?hl=en -~--

[Proto-Scripty] equivalent of the onAvailable YUIEvent?

2009-04-27 Thread Mark Mansour
Hey guys, I'm looking for the earliest point to execute a method when a HTML element is available. Currently I can only get my desired usability by inlining the javascript (you can see the dom change when I use dom:loaded). I noticed that YUIEvent has an onAvailable event [http:// developer.yah

[Proto-Scripty] Re: equivalent of the onAvailable YUIEvent?

2009-04-27 Thread T.J. Crowder
Hi, The dom:loaded event[1] is the closest analogue at the moment, if what you're looking for is an event when the DOM is built but before window.onload since the latter waits for images to be complete. I'm told that it has some IE issues at the moment (in 1.6.0.3) although I've never seen a pro

[Proto-Scripty] Re: Calling function every time PeriodicalUpdater makes a request

2009-04-27 Thread T.J. Crowder
Hi Bryan, The docs for the PeriodicalUpdater[1] say that it supports all of the standard Ajax.Options[2], and so I would expect onSuccess, onComplete, etc. to work. But there's a note at the bottom of the PU docs saying specifically to use onSuccess since onComplete is "hijacked" for another pur

[Proto-Scripty] Re: adding and removing classnames

2009-04-27 Thread T.J. Crowder
Hi, Welcome! You'll find it a bit of an adjustment moving from jQuery to Prototype, but there's a lot of good stuff to get into. I'd recommend having a good, thorough read through the API docs[1] to get started with, just so you know what's available to you. Takes about an hour, but pays you b

[Proto-Scripty] displaying Server time using Ajax.periodicaUpdater

2009-04-27 Thread Palastina Uber Alles
Hello everyone, I am new to prototype, and I am trying to implement a simple ajax request I wrote the index.html file, and the clock.html file index.html http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"> Test Page fun

[Proto-Scripty] Re: Is there a way to determine absolute coordinates of an element on the screen?

2009-04-27 Thread ColinFine
On Apr 26, 10:56 pm, buda wrote: > this gets coordinates in a page but I need to translate them to screen > Does Element.getViewportOffset() not help? Colin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Proto

[Proto-Scripty] Re: the effect in Effect.toggle does not work

2009-04-27 Thread Walter Lee Davis
What does Firebug say, specifically, when a function fails to run? Does it error at all? Can you put breakpoints in your code (or alert statements) and see if it is being called? You say that there are other functions which work fine, are they in the same application.js file? Walter On A

[Proto-Scripty] Re: the effect in Effect.toggle does not work

2009-04-27 Thread Vinay Seshadri
Hi Walter, Ive solved the problem!! AWOOHOO!! :) ok you're probably gonna punch me but I really have no idea why this is happening. I use this helper method "javascript_include_tag :defaults" to include my default javascripts in my head tag. This method is in-built in Rails and it generates the f

[Proto-Scripty] Using this.arrayname to add data to an array not working

2009-04-27 Thread Imbi Rehling
Hello to all, my first post to this group! I am new to OOP in JavaScript and have written my first Js Class using prototype.js.. On the 'Learn pages' at prototypejs.org the example for 'Classes-Inheritance' shows the following.. var Logger = Class.create({ initialize: function() { // this

[Proto-Scripty] Re: Calling function every time PeriodicalUpdater makes a request

2009-04-27 Thread BryanG
Thanks for the reply. Your first suggestion worked great, although I don't understand why. When I tried implementing the onSuccess, I called the function directly - something like: onSuccess: alert("onSuccess"); This apparently just gets called once the first time through. If I used the forma

[Proto-Scripty] Re: Using this.arrayname to add data to an array not working

2009-04-27 Thread T.J. Crowder
Hi, Your Logger class, as given, will work fine: var l = new Logger(); l.write("Testing"); l.write("One"); l.write("Two"); l.write("Three"); The result of the above would be that the 'log' array would be: ["Testing", "One", "Two", "Three"] > I have had to use the following in my method that u

[Proto-Scripty] Re: equivalent of the onAvailable YUIEvent?

2009-04-27 Thread Ananth Raghuraman
Look at YUILoader's onSuccess method; it is the same as dom:loaded event On Mon, Apr 27, 2009 at 2:48 AM, Mark Mansour wrote: > > Hey guys, > > I'm looking for the earliest point to execute a method when a HTML > element is available. Currently I can only get my desired usability > by inlining

[Proto-Scripty] Re: Is there a way to determine absolute coordinates of an element on the screen?

2009-04-27 Thread Diodeus
You need the famous Kangax Prototype cheat sheet. There is a very handy diagram on the PDF that will help you with this positioning issue: http://thinkweb2.com/projects/prototype/prototype-1602-cheat-sheet/ On Apr 26, 5:56 pm, buda wrote: > this gets coordinates in a page but I need to transla

[Proto-Scripty] Re: the effect in Effect.toggle does not work

2009-04-27 Thread Walter Lee Davis
Hmmm. Well, that's odd, but chalk one up to Rails and its development/ test/production "environments". The querystring at the end of the filename is there to "force" the browser to get a newer version of the script. That number is the current time in Unix time() mode, I think, or it may be

[Proto-Scripty] Re: Calling function every time PeriodicalUpdater makes a request

2009-04-27 Thread T.J. Crowder
Hi, > If I > used the formatting you specified (with the function() definition), it > works exactly like I wanted, although I'm not sure what the difference > is. All the difference in the world! :-) This code: x = alert("Hi there"); ...calls the alert function and stores the result of ca

[Proto-Scripty] Re: displaying Server time using Ajax.periodicaUpdater

2009-04-27 Thread T.J. Crowder
Hi, There are a couple of problems there. The first and biggest problem is that your clock.html file *isn't* getting the server's time, it's getting the client's time. You're running client-side code to output the time to the document as it's being rendered in the browser. The second problem i

[Proto-Scripty] Web Desktop Showcase

2009-04-27 Thread Jeztah
After a bit of time playing and alot of people asking about "Web Desktops" i decided to pull my old code out of retirement and fix some bugs !! http://showcase.bazookawally.co.uk/ Above is a link to the Desktop Demo ... Please any browser but INTERNET EXPLORER !!! .. there is a couple of bugs i

[Proto-Scripty] Re: Using this.arrayname to add data to an array not working

2009-04-27 Thread IMBI-Indie-Portal
Thanks T.J. I probably should have been more specific. I'm actually building a Q and A Captcha, not a Logger. I used that as an example. The issue is, I am using proto's Ajax.Request and I'm running that code within the 'onComplete: function(transport){ callback }' and this is executing within

[Proto-Scripty] Re: Calling function every time PeriodicalUpdater makes a request

2009-04-27 Thread BryanG
Wow - thanks for the detailed explanation. Makes perfect sense now! Thanks again for the help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email t

[Proto-Scripty] Re: Extending Prototype.BrowserFeatures the right way?

2009-04-27 Thread Tim Snadden
>> > > You shouldn't need try/catch for merely testing types of certain > properties. I would check `borderRadius` first, since it's a standard > CSS3 property. `el` also needs to be `null`ed. I think a more > descriptive name for the test would be `hasBorderRadius` (instead of > `borderRadius`)

[Proto-Scripty] Re: the effect in Effect.toggle does not work

2009-04-27 Thread Vinay Seshadri
Hmmm. Im not sure. This wasnt working for me in dev or production. And the timestamps are there in both environments.You are right about what theyre meant for though. I read about it here http://ahref.in/79887 Its explained a bit more in detail in the API under the Using Asset Timestamps section h