[Proto-Scripty] Extending every Ajax.Request onSuccess event

2008-11-13 Thread matte
Hi, I have an application that uses Ajax.Request and its onSuccess event handler in lots of places. I need to call a function (that will check the response) before all these onSuccess events fired. I tried using Ajax.Responders.register with onComplete event but it fires after Ajax.Request's on

[Proto-Scripty] Re: Extending every Ajax.Request onSuccess event

2008-11-13 Thread Alex Mcauley
perhaps put your code up so someone can evaulate it and put forward a suggesiton ? - Original Message - From: "matte" <[EMAIL PROTECTED]> To: "Prototype & script.aculo.us" Sent: Thursday, November 13, 2008 9:30 AM Subject: [Proto-Scripty] Extending every Ajax.Request onSuccess event >

[Proto-Scripty] Re: Window System - WebOs / Web Desktop

2008-11-13 Thread Alex Mcauley
A few bugs have been fixed and some new additions made including double clicking the title bar to maximize/minify the window, Z-indexes fixed to position windows accordingly when having multiple smaller windows open in the container, inner Heights fixed on the content to not overlap the resize

[Proto-Scripty] Re: Extending every Ajax.Request onSuccess event

2008-11-13 Thread matte
Hi Alex, Thanks for the reply. Generic Ajax.Request code: new Ajax.Request(URL, { method: 'post', parameters: OPTIONS, onSuccess: function(transport) { console.log('Request success'); } }); And my extension: Ajax.Responders.register({ onComplete: function(reque

[Proto-Scripty] Re: Extending every Ajax.Request onSuccess event

2008-11-13 Thread T.J. Crowder
Easier to read those on Pastie: http://pastie.org/313717 http://pastie.org/313718 -- T.J. :-) On Nov 13, 9:48 am, "T.J. Crowder" <[EMAIL PROTECTED]> wrote: > Hi Mert, > > You can create a factory function for requests that inserts your > handler, something like this: > > * * * * > function speci

[Proto-Scripty] Re: Extending every Ajax.Request onSuccess event

2008-11-13 Thread matte
Hi TJ, Thank you very much! That is what i wanted. One last question though, I have lots of (I mean lots lots of) 'new Ajax.Request' calls in the application source. So is there a way to do this centralized instead of replacing every 'new Ajax.Request' call. Maybe extending the Ajax.Request base

[Proto-Scripty] Re: Extending every Ajax.Request onSuccess event

2008-11-13 Thread T.J. Crowder
Hi Mert, You can create a factory function for requests that inserts your handler, something like this: * * * * function specialSuccessStuff(transport) { // ...whatever your special onSuccess stuff is... } function makeRequest(url, options) { var orig; orig = options.onSuccess;

[Proto-Scripty] Re: Extending every Ajax.Request onSuccess event

2008-11-13 Thread matte
Hi, Yes it is more straight forward but gobally replacing lots of code seems to be a bit out of control and prone to bugs to me. Thanks a lot TJ. Mert. On Nov 13, 12:38 pm, "T.J. Crowder" <[EMAIL PROTECTED]> wrote: > Hi, > > > Do you have any thoughts or > > suggestions on this? > > Just that i

[Proto-Scripty] Re: Extending every Ajax.Request onSuccess event

2008-11-13 Thread T.J. Crowder
Hi, > Yes it is more straight forward but gobally replacing lots of code > seems to be a bit out of control and prone to bugs to me. Hmmm, to me it's modifying the Prototype internals that's the riskier, more error-prone choice. :-) > Thanks a lot TJ. No worries, good luck with it. -- T.J. O

[Proto-Scripty] Re: Window System - WebOs / Web Desktop

2008-11-13 Thread Alex Mcauley
that is strange for the safari ... i just tested it on my version and they are in the correct place ... out of interest what safari version are you running ? Regards Alex - Original Message - From: "Chris Brody" <[EMAIL PROTECTED]> To: Sent: Thursday, November 13, 2008 10:20 AM Subje

[Proto-Scripty] Re: Extending every Ajax.Request onSuccess event

2008-11-13 Thread matte
Just incase pastie service goes offline in the future, i paste the code below for future references. function ajaxRespondToReadyStateWrapper(orig, readyState) { var state = Ajax.Request.Events[readyState]; var response = new Ajax.Response(this) if (state == 'Complete') {

[Proto-Scripty] Prototype & Scrit.aculo.us NOt working on IE7

2008-11-13 Thread Mckensy
Hi I'm getting very odd behaviour with the effects on ie/&ie6 I get an error on: toggle: function(element, effect) { element = $(element); effect = (effect || 'appear').toLowerCase(); var options = Object.extend({ queue: { position:'end', scope:(element.id || 'global'), limit:

[Proto-Scripty] Re: Extending every Ajax.Request onSuccess event

2008-11-13 Thread T.J. Crowder
Hi, > Do you have any thoughts or > suggestions on this? Just that it will be fragile. The next version of Prototype might not have respondToReadyState, or may have it with different params, or, or, ... Seriously, isn't it more straight-forward to do a global search and replace changing "new A

[Proto-Scripty] Re: Extending every Ajax.Request onSuccess event

2008-11-13 Thread T.J. Crowder
Hi, > I have lots of (I mean lots lots of) 'new Ajax.Request' calls in the > application source. Global search and replace? :-) > Maybe extending the > Ajax.Request base? You could do that, sure, in your own copy of prototype.js; just search for Ajax.Request and modify the initialize function

[Proto-Scripty] Re: Window System - WebOs / Web Desktop

2008-11-13 Thread Alex Mcauley
i just fugured it out ... if you are on a smaller resolution then the title of the minified window will take up most of the allowed width, ergo sending the buttons down to compensate ... i should limit the title length really in smaller windows, i will add the fix to it today at some point Reg

[Proto-Scripty] Re: Window System - WebOs / Web Desktop

2008-11-13 Thread Chris Brody
Cool-I definitely like the minimize/restore/maximize buttons much better! One strange thing: when I tested on Safari for Windows, the buttons were slightly below the title bar for a non-maximized window. I must confess that I have dealt very little with Javascript, and must say that the Prototyp

[Proto-Scripty] Re: Window System - WebOs / Web Desktop

2008-11-13 Thread Alex Mcauley
thanks ... i would imagine its the resolution viewed at .. mine is 1280/800 and the title text is rather excessive ... normally it would say somehting like "Address Book - John Doe" Regards Alex - Original Message - From: "Chris Brody" <[EMAIL PROTECTED]> To: Sent: Thursday, November

[Proto-Scripty] Re: Extending every Ajax.Request onSuccess event

2008-11-13 Thread matte
Hi TJ, Based on your wrap recommendation I have extended prototype (wrapped Ajax.request.prototype.respondToReadyState function) without modifying the initialize function and source code of prototype js. Here is the link to code: http://pastie.org/313738. I hope this helps someone else too. Do y

[Proto-Scripty] Re: Window System - WebOs / Web Desktop

2008-11-13 Thread Chris Brody
Safari 3.1.2, and IE7, not IE6... I have a Mac at home with Windows and Linux virtual machines, so I will try these over the weekend. On Thu, Nov 13, 2008 at 11:24 AM, Alex Mcauley <[EMAIL PROTECTED]> wrote: > > that is strange for the safari ... i just tested it on my version and they > are in

[Proto-Scripty] evalJSON hangs IE

2008-11-13 Thread gingerbbm
Dear all I'm looking for inspiration. Take a look at this code: http://pastie.org/313941 In a simple HTML page this does what one would expect. But the exact same code on a page in my application hangs IE7 on the evalJSON() line (eventually I get a "Stop running this script?" prompt). I would

[Proto-Scripty] Re: evalJSON hangs IE

2008-11-13 Thread gingerbbm
Looks like Prototype 1.6.0.3 is conflicting with an earlier version that has been integrated into another app I'm using - MapGuide Fusion. Is there a way to run two different versions alongside each other?! --~--~-~--~~~---~--~~ You received this message because yo

[Proto-Scripty] Re: evalJSON hangs IE

2008-11-13 Thread Alex Mcauley
have you tried to remove the single quotes around the json string ? - Original Message - From: "gingerbbm" <[EMAIL PROTECTED]> To: "Prototype & script.aculo.us" Sent: Thursday, November 13, 2008 4:28 PM Subject: [Proto-Scripty] Re: evalJSON hangs IE > > Looks like Prototype 1.6.0.3 is

[Proto-Scripty] Need help sending information from multiple forms

2008-11-13 Thread Abel Figueiredo
Hello. I need a little help. I'm developing an application using prototype & php and I want to do the following: In a page I have 3 forms: One containing a start calendar, one containing a end calendar and one that allows the user to select witch data to show on a graph. The idea is to allow t

[Proto-Scripty] Re: evalJSON hangs IE

2008-11-13 Thread kangax
On Nov 13, 11:28 am, gingerbbm <[EMAIL PROTECTED]> wrote: > Looks like Prototype 1.6.0.3 is conflicting with an earlier version > that has been integrated into another app I'm using - MapGuide Fusion. > > Is there a way to run two different versions alongside each other?! How is it conflicting? A

[Proto-Scripty] Re: evalJSON hangs IE

2008-11-13 Thread gingerbbm
On Nov 13, 4:40 pm, kangax <[EMAIL PROTECTED]> wrote: > > How is it conflicting? Any more details? > No more details as yet. If only I had some way of debugging IE like I do with Firefox (Firebug). I'm not getting any errors but the CPU starts maxing out and eventually I get that prompt. --~--~--

[Proto-Scripty] Re: evalJSON hangs IE

2008-11-13 Thread gingerbbm
Alex Mcauley wrote: > have you tried to remove the single quotes around the json string ? evalJSON() is a method on String, so that doesn't work. At this point in time I'm satisfied it's a conflict: if I remove references to the other JavaScript (that itself references the old Prototype code) th

[Proto-Scripty] Re: Need help sending information from multiple forms

2008-11-13 Thread kangax
On Nov 13, 11:13 am, Abel Figueiredo <[EMAIL PROTECTED]> wrote: > Hello. > > I need a little help. > > I'm developing an application using prototype & php and I want to do > the following: > > In a page I have 3 forms: One containing a start calendar, one > containing a end calendar and one that a

[Proto-Scripty] Re: evalJSON hangs IE

2008-11-13 Thread Kevin Smith
Hi, I'm running the exact code and do not get any IE7 hangs: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://www.w3.org/1999/xhtml";> Event.observe(window, 'load', function() { Event.observe($('btn'), 'click', function() { var j = ' {"easting": "518353", "northi

[Proto-Scripty] Re: evalJSON hangs IE

2008-11-13 Thread SWilk
Hey, Kevin Smith wrote: > Hi, > > I'm running the exact code and do not get any IE7 hangs: [...] > Event.observe(window, 'load', function() { > Event.observe($('btn'), 'click', function() { > var j = ' {"easting": "518353", "northing": "168119"} '; > var c = j.evalJSON(); >

[Proto-Scripty] Re: Need help sending information from multiple forms

2008-11-13 Thread kangax
On Nov 13, 11:13 am, Abel Figueiredo <[EMAIL PROTECTED]> wrote: [...] > Seeing it's not possible to use nested forms, I need to combine the > information of all 3 and send it as parameters. I needed something similar some time ago. Serializing multiple forms is as easy as merging multiple objects

[Proto-Scripty] Re: evalJSON hangs IE

2008-11-13 Thread gingerbbm
Thanks for the tip but the code I posted was as a result of meticulously removing bits of a far bigger piece of code. The JSON is supposed to be returned by an Ajax.Request() so I assume it'll be coming through as a string, hence the code above. In any case, if I removed the link to the code cont

[Proto-Scripty] node.select in IE7

2008-11-13 Thread AlannY
Hi there. I'm working on simple script that must work on all browsers, which prototype supports. There are code: var edit = node.select('a#edit')[0]; if( edit ) { ... } In Firefox and Safari this works great: the variable contain the pointer to the DOM's tag with id attribute. But in IE7 the

[Proto-Scripty] Re: slide up effect

2008-11-13 Thread Robert Zotter
Shawnl, Take a look at the Tween Effect http://github.com/madrobby/scriptaculous/wikis/effecttween This should accomplish everything you are trying to do. Cheers. -- Robert Zotter Zapient, LLC Ruby on Rails Development and Consulting http://www.zapient.com http://www.fromjavatoruby.com On N

[Proto-Scripty] Attaching onload event while creating new img tag

2008-11-13 Thread Diodeus
I've been dynamically building a slideshow based on a list of image filenames. I use the following code to create thumbnails: $('placeholder').insert(new Element("img", {id:'something', src:myImage})) I would like to display a progress bar, so I'm going to count the number of images loaded as th

[Proto-Scripty] Re: slide up effect

2008-11-13 Thread Diodeus
A simple Effect.Move will do. http://github.com/madrobby/scriptaculous/wikis/effect-move On Nov 12, 11:31 am, shawnl <[EMAIL PROTECTED]> wrote: > Hello scriptaculous people. > > I am looking for an effect that will slide a div up from a fixed > location on the page. For example, I will have a n

[Proto-Scripty] Re: Attaching onload event while creating new img tag

2008-11-13 Thread Gabriel Gilini
On Thu, Nov 13, 2008 at 6:43 PM, Diodeus <[EMAIL PROTECTED]> wrote: > So how do I do this? I know I could create the element with the > onload, then set the src separately later in the code, but I would > prefer to do it all inside the new Element constructor. > I honestly can't see the harm in d

[Proto-Scripty] Re: node.select in IE7

2008-11-13 Thread Gabriel Gilini
On Thu, Nov 13, 2008 at 4:17 PM, AlannY <[EMAIL PROTECTED]> wrote: > > Hi there. I'm working on simple script that must work on all browsers, > which prototype supports. > > There are code: > var edit = node.select('a#edit')[0]; > if( edit ) { > ... > } What's node? How to fix it? $(node).sel

[Proto-Scripty] Re: Internet Explorer 8

2008-11-13 Thread laurin1
So when does it become a high priority? On Oct 23, 5:44 pm, kangax <[EMAIL PROTECTED]> wrote: > On Oct 23, 1:59 pm, laurin1 <[EMAIL PROTECTED]> wrote: > > > Has anyone tested Prototype with 8 Beta 2? I just started and I am > > getting some error right off the bat. Not positive they are Prototype

[Proto-Scripty] Re: Attaching onload event while creating new img tag

2008-11-13 Thread kangax
On Nov 13, 3:43 pm, Diodeus <[EMAIL PROTECTED]> wrote: > I've been dynamically building a slideshow based on a list of image > filenames. I use the following code to create thumbnails: > > $('placeholder').insert(new Element("img", {id:'something', > src:myImage})) > > I would like to display a pr

[Proto-Scripty] questions about memory leaks

2008-11-13 Thread bluezehn
I've extensively used class.create for a calendar - each week has a class containing 7 days, also represented as objects of a class. 1 ) But the problem is it's turned out to be a bit of a memory eater as there's quite a lot of methods on both classes. Should architecture like this be a problem w

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

2008-11-13 Thread Ehsun
I've create an Object in my pages script tags, something like this: a = new A(); and when I want to call a method of a in the script which is actually the ajax content (evaluated with .evalScripts) everything is fine. but when the creation and the calling code, both are in the ajax contents (sep

[Proto-Scripty] Issues in using Google API with Prototype

2008-11-13 Thread Nilavan
Hi, I am not very knowledgeable in Javascript but I am using the Prototpye framework in one of my projects. I am trying to integrate Google Books Embedded Preview in the page and it doesn't work when I include the Framework. The Javascript console in Google Chrome reports this error: " Uncaught Ty

[Proto-Scripty] Re: Browser Support List?

2008-11-13 Thread RobG
On Nov 14, 9:54 am, "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? http://groups.google.com/group/rubyonrails-spinoffs/browse_thread/thread/37d5a3b8da4fb1c7/7f92194bee9e51bd?hl=en&ln

[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 been asked before, but is there an u

[Proto-Scripty] Re: slide up effect

2008-11-13 Thread Robert Zotter
Dio, Effect.Move is used to move the position of the div but I believe Shawnl wants to create his own type of Blind animation. Shawnl you can also check out the wiki for the an example of how to create your own Effect.BlindRight http://github.com/madrobby/scriptaculous/wikis/effect-blinddown --

[Proto-Scripty] Re: evalScripts problem

2008-11-13 Thread Robert Zotter
Ehsun, Can you post some code so we can get a better understanding of what you are trying to accomplish. Off the top of my head though it sounds like you may want to look into scope binding. http://www.prototypejs.org/api/function/bind http://www.prototypejs.org/api/function/bindAsEventListener

[Proto-Scripty] Re: evalScripts problem

2008-11-13 Thread RobG
On Nov 14, 7:39 am, Ehsun <[EMAIL PROTECTED]> wrote: > I've create an Object in my pages script tags, something like this: > > a = new A(); > > and when I want to call a method of a in the script which is actually > the ajax content (evaluated with .evalScripts) everything is fine. but > when th

[Proto-Scripty] Re: questions about memory leaks

2008-11-13 Thread kangax
On Nov 13, 6:22 pm, bluezehn <[EMAIL PROTECTED]> wrote: > I've extensively used class.create for a calendar - each week has a > class containing 7 days, also represented as objects of a class. > > 1 ) But the problem is it's turned out to be a bit of a memory eater > as there's quite a lot of meth

[Proto-Scripty] Re: Issues in using Google API with Prototype

2008-11-13 Thread kangax
On Nov 13, 5:29 pm, Nilavan <[EMAIL PROTECTED]> wrote: > Hi, > I am not very knowledgeable in Javascript but I am using the Prototpye > framework in one of my projects. I am trying to integrate Google Books > Embedded Preview in the page and it doesn't work when I include the > Framework. The Java

[Proto-Scripty] Re: evalScripts problem

2008-11-13 Thread kangax
On Nov 13, 10:30 pm, RobG <[EMAIL PROTECTED]> wrote: > On Nov 14, 7:39 am, Ehsun <[EMAIL PROTECTED]> wrote: [...] > There are work arounds, but best to avoid eval'ing scripts altogether. Yeah, there's a `globalEval` function scheduled for near future releases. When running in environment that doe

[Proto-Scripty] Re: Browser Support List?

2008-11-13 Thread kangax
On Nov 13, 7:19 pm, RobG <[EMAIL PROTECTED]> wrote: > On Nov 14, 9:54 am, "Hector Virgen" <[EMAIL PROTECTED]> wrote: [...] > I doubt very much that IE 5.5 on Mac OS is supported, Safari 2 should > be OK. Safari 2 is actually one of the reasons why we can't use `Object.prototype.hasOwnProperty`

[Proto-Scripty] prototype-1.6.0.3 line1212 'if (params = Object.toQueryString(params))' is correct ?

2008-11-13 Thread yama
Is the description correct? prototype-1.6.0.3 line 1212 if (params = Object.toQueryString(params)) {... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this grou

[Proto-Scripty] Re: prototype-1.6.0.3 line1212 'if (params = Object.toQueryString(params))' is correct ?

2008-11-13 Thread T.J. Crowder
It's not great style, but yes, I'm fairly certain it really does mean to be doing an assignment there and then testing the result of the assignment for falsity. E.g.: params = Object.toQueryString(params); if (params) { Why? Did it just look like a bug to you, or were you looking into

[Proto-Scripty] Re: questions about memory leaks

2008-11-13 Thread T.J. Crowder
Hi, > 1 ) But the problem is it's turned out to be a bit of a memory eater > as there's quite a lot of methods on both classes. That shouldn't be a problem if you're using Class.create, it assigns the methods to the prototypes so the methods are shared across all instances. Are you trying to cr