Re: [Proto-Scripty] Download
Copy the code to a new text file and save it as prototype.js Or instead of left-clicking the link, just right-click and select Save target (or whatever it is called in your browser/language). David Am 28.12.2011 00:46, schrieb Joey: When i go to download the latest version of Prototypejs 1.7 it opens a new browser window with code. I am knew to this so bare with me. but i thought it was supposed to be a file template that i open with a web page developer..? anyhelp would be greatly appreciated -- 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 prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Textarea as a container
From the top of my head and totally untested: new Ajax.Request('http://url-you-want-to-request', { onSuccess: function(transport) { $('id-of-your-textarea').setValue(transport.responseText); } }); David Am 22.11.2011 14:19, schrieb bill: I tried using a textarea as the container for Ajax.updater without luck. I presume I need to write the js to take the response and put it in the textarea, but the API just doesn't give me enough detail to use Ajax.request to do that. The returned data is plain text. A bit of assistance would be appreciated. -- Bill Drescher william {at} TechServSys {dot} com -- 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 prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- 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 prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: News Items List
You might wanna try document.observe(); instead of document.observer(); David Am 15.03.2011 10:34, schrieb PartisanEntity: Sorry just to clarify: Line 3 Char3 is the first line of your function. So it's the line starting with: document.observer(. On Mar 15, 10:04 am, PartisanEntitypartisanent...@gmail.com wrote: The link is currently behind a firewall so I can't post it. But here is what IE says: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/ 4.0; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8) Timestamp: Tue, 15 Mar 2011 09:01:36 UTC Message: Object doesn't support this property or method Line: 3 Char: 3 Code: 0 URI:http://www.test.com/_includes/newseffect/slideeffect.js On Mar 14, 5:46 pm, Walter Lee Daviswa...@wdstudio.com wrote: And you also loaded Prototype and Scriptaculous before that, in that order, right? Can you post a link? I have IE8 with a debugger enabled here on a VM, I could see if any errors suggest themselves. Walter On Mar 14, 2011, at 12:20 PM, PartisanEntity wrote: The list is displayed in its entirety without animations. It's almost as if the JavaScript it being ignored completely in IE8. I pasted your JavaScript into a file which I called newslist.js. I linked to it in the head section of my html file like so: script type=text/javascript src=http://www.test.com/_includes/ newsbox/newslist.js/script On Mar 14, 3:43 pm, Walter Lee Daviswa...@wdstudio.com wrote: No, but please define doesn't work. Does the animation fail, does the text not change...? Walter On Mar 14, 2011, at 8:34 AM, PartisanEntity wrote: Hi Walter, Thanks so much for this. It is working perfectly. There is only one issue I am having: While it works in Firefox and Safari, I tried using IE8 and noticed that it works on one computer, but not on another. Do you have any experiences with this script and IE8, anything to watch out for? Thanks! On Mar 12, 5:02 pm, Walter Lee Daviswa...@wdstudio.com wrote: Here's a cut-down version of the code generated by my NewsCycle plug- in for Softpress Freeway. document.observe('dom:loaded',function(){ var newsSource = $('yourListId'); var delayBetweenItems = 3; var effectSpeed = 0.6; var tag = newsSource.firstDescendant().tagName.toLowerCase(); var data = newsSource.select(tag).invoke('hide').pluck('innerHTML'); var news = newsSource.down(tag).show(); var index = 0; var newsCycle = function(){ index = (++index= data.length ? 0 : index) new Effect.Fade(news,{ delay:delayBetweenItems, duration:effectSpeed, afterFinish:function(){ new Effect.BlindDown(news,{ duration:effectSpeed, beforeStart:function(){ news.update(data[index]); }, afterFinish:newsCycle }); } }); }; newsCycle(); }); You need prototype and scriptaculous effects in the page first, obviously, and you need to fill in the id of your list. My plug-in has extra code to make it list agnostic, so you could simplify this a lot if you knew that your effect was only ever being applied to a list. You could also use this as written on a DIV with a bunch of P tags in it, or a DIV with a bunch of DIVs in it -- there's no end to the possible combinations. Walter On Mar 11, 2011, at 11:35 AM, PartisanEntity wrote: Hi all, I am relatively new to scriptaculous and would like to know if the following is possible. I would like to create a list of news items on my website. Instead of showing all items in myul list, I would like for each item to appear using the slide down effect, then for it to disappear and for the next item to appear by sliding down. Is this possible? Has this been done before, perhaps there is some code I could copy as I have no idea how to build something like this. Thank you very much for you time and effort. -- 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 prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group athttp://groups.google.com/group/prototype-scriptaculous?hl=en . -- 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 prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr
Re: [Proto-Scripty] Selector onchange
Try this instead: $('pagePageSelector').observe('change', function(event) { alert('ding'); }); Am 20.12.2010 21:25, schrieb kstubs: $('pagePageSelector').observe('onchange', function(event) { alert('ding'); }); -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Should be simple - using up() with css class
On Tue, Aug 17, 2010 at 1:47 PM, Rhiq ndba...@gmail.com wrote: I obviously don't get the way up() works. Using the generated HTML below: tr class=sd_type ChildOfClass10 ChildOfCat8 open id=type-18 [snip] /tr [snip] tr id=part-47 class=sd_part ChildOfType18 ChildOfClass10 ChildOfCat8 [snip] /tr If I try the following: alert($('part-47').up('tr.sd_type').id) I get an error saying that it is undefined. Yes. the two table rows are siblings. +up+[1] moves up the DOM tree, so it will find ancestors. Does it make sense to anyone what I am trying to do? Is there a way for me to do what I would like? Yes. You want +previous+[2] which lets you find the first (previous) sibling that matches a given selector. [1] http://api.prototypejs.org/dom/element/up/ [2] http://api.prototypejs.org/dom/element/previous/ -- med vänlig hälsning David JH -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: Preventing Autocompleter
I don't think there is a built-in functionaltity for that. But you could edit the autocompleter class and add the check yourself right before the request is done. David Am 05.07.2010 18:54, schrieb infringer: No takers? I guess there is no way to do this? On Jul 1, 6:51 pm, infringerinfrin...@gmail.com wrote: I have an autocompleter on a City field. But I don't want it to send the request UNLESS the state field is filled in? Any suggestions on how to prevent it from sending the request? No need for the unnecessary requests going back and forth. Thanks, -David -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Ajax JSON Request with Flickr URL response don't work in Firefox
Hi Nahum, as far as I know Firefox does not allow for cross-domain AJAX requests. What you could to is to request a php file on your server and that php file does the call to the Flickr API. David Am 24.06.2010 19:47, schrieb ncubica: Hi every body I have a weird issue I been working with the Flickr API, in Flickr for make a connection with the server is through url format in my case something like this http://api.flickr.com/services/rest/?method=flickr.photosets.getListapi_key=10cb3dccaa050efebdc01540c1d4d227user_id=51390...@n07format=json If your run into any browser you are going to get a flickr function and is ok, but Im trying to obtain with Ajax Im doing something like new Ajax.Request('http://api.flickr.com/services/rest/? method=flickr.photosets.getListapi_key=10cb3dccaa050efebdc01540c1d4d227user_id=51390...@n07format=json', { method:'get', onSuccess: function(transport){ debugger; var response = transport.responseText || no response text; alert(Success! \n\n + response); }, onFailure: function(){ alert('Something went wrong...') } }); And is working good in IE the response have what you can see in the url of flickr but in Firefox I dont know why Im getting in the responseText a blank string . does any have any clue what am I doing wrong? Thanks Nahum -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: Cloning/moving an element!?
Hi, thansk for the explantation. Makes sense now. I totally forgot about the new API docs and only looked at the old docs (http://www.prototypejs.org/api/element) where the method wasn't around yet. David Am 21.06.2010 08:37, schrieb T.J. Crowder: Hi, For cloning, there's always Element#clone[1]. That clones the node using the underlying DOM cloneNode function, and also handles anything Prototype might have stored on the node. Apart from cloning an element I also needed to move an element from one div to another and I came up with this function... [snip] I don't like the switch part very much and tried to use the position variable directly but that somehow didn't work...anyone knows why? [snip] newParent.insert({position: element}); Because that creates a property called position on the options object, exactly the way your earlier code newParent.insert({top: element}); ...creates a property called top on the options object. The left- hand side of a property initializer (and for that matter an assignment) is used as the name of the property (or variable) to create, not as a variable _containing_ the name of the property/ variable. It is possible to do what you want, though: Element.addMethods({ appendTo: function(element, newParent, position) { var options; element = $(element); newParent = $(newParent); options = {}; options[position] = element; newParent.insert(options); return element; }}); ...because the bracketed notation for property access uses strings for property names, and lets you get the property name string from a variable. [1] http://api.prototypejs.org/dom/element/clone/ HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Jun 20, 11:48 pm, David Behlerd.beh...@gmail.com wrote: Hi guys, while looking for a way to clone an element, I stumbled upon this thread from 2007: http://groups.google.com/group/prototype-core/browse_thread/thread/9e... Any chance this is some when gonna end up in the core? I think this is function might be pretty useful sometimes. Apart from cloning an element I also needed to move an element from one div to another and I came up with this function which is basically a wrapper for the insert() function: Element.addMethods({ appendTo: function(element, newParent, position) { element = $(element); newParent = $(newParent); switch(position) { case 'top': newParent.insert({top: element}); break; case 'bottom': newParent.insert({bottom: element}); break; case 'before': newParent.insert({before: element}); break; case 'after': newParent.insert({after: element}); break; } return element; } }); I don't like the switch part very much and tried to use the position variable directly but that somehow didn't work...anyone knows why? Element.addMethods({ appendTo: function(element, newParent, position) { element = $(element); newParent = $(newParent); newParent.insert({position: element}); return element; }}); $('test').appendTo('test2', 'top'); Using this function Firebug shows this error: insert is not a function. Anyway, maybe someone else finds this useful aswell :) David -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Cloning/moving an element!?
Hi guys, while looking for a way to clone an element, I stumbled upon this thread from 2007: http://groups.google.com/group/prototype-core/browse_thread/thread/9e943e4b54780d97 Any chance this is some when gonna end up in the core? I think this is function might be pretty useful sometimes. Apart from cloning an element I also needed to move an element from one div to another and I came up with this function which is basically a wrapper for the insert() function: Element.addMethods({ appendTo: function(element, newParent, position) { element = $(element); newParent = $(newParent); switch(position) { case 'top': newParent.insert({top: element}); break; case 'bottom': newParent.insert({bottom: element}); break; case 'before': newParent.insert({before: element}); break; case 'after': newParent.insert({after: element}); break; } return element; } }); I don't like the switch part very much and tried to use the position variable directly but that somehow didn't work...anyone knows why? Element.addMethods({ appendTo: function(element, newParent, position) { element = $(element); newParent = $(newParent); newParent.insert({position: element}); return element; } }); $('test').appendTo('test2', 'top'); Using this function Firebug shows this error: insert is not a function. Anyway, maybe someone else finds this useful aswell :) David -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Keep the state of the effect after refresh or reload.
I have a scriptaculous fold effect above the header that enables me to hide the flash movie once it has played. The problem is that once you navigate to a different part of the site (klick on an About link for example) the page reloads and the script resets so the movie is no longer hidden. What I would like is for the movie to stay hidden or shown, whatever the user chooses, no matter where on the page you are. This is the code (I just copy/pasted it from the demos) and it works just great: div id=fold ?php wp_swfobject_echo(http:/imagesx/logo303.swf, 900px, 300px); ?/div ul lia href=# onclick=Effect.Fold('fold'); return false;Hide/ a/li lia href=# onclick=$('fold').show(); return false;Show/a/ li /ul I am not a programmer, I'm a designer who wants to expand my knowledge, but I have only the very basic understanding about javascript, php and so on ... VERY basic. I hope someone could help me out - I get the feeling that this is a more advanced group, but I searched the net over and over and found no solution. Anyway - thank you in advance. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Ajax.Updater not working in IE, works fine in FF Chrome and Safari
Hey folks, maybe you can help me out with this. I got a simple function that I use to load sub-categories when clicking on a parent category: function toggleSubCats(cat, id) { /* Vars and stuff */ catObj = $(cat); var send=null; /* Now figure out the status of the element and open or close based on what's found */ if( catObj.getStyle('display') == 'none') { catObj.setStyle({display : 'block'}); } else { catObj.setStyle({display : 'none'}); return; } /* Let's first dump a loading image in the target div then send the AJAX request */ catObj.update(img src=' + base_images + loading_small.gif' /); var url= base + 'galleryback/showSubCat/'+id; new Ajax.Updater(catObj,url); /* Alternative to Ajax.Updater() call new Ajax.Request(url, { method: 'get', onSuccess: function(transport) { $(cat).update(transport.responseText); } }); */ } All it's supposed to do, is to get the element (in this case a div) with the id submitted in the cat parameter and display/hide it. If display is set to block, then an loading image is shown and ajax.updater is called to load the sub-categories to the higher category (id parameter). This works fine in FF3.6, Chrome and Safari, but in IE8 the loading image is not replaced with the loaded sub-categories. If I replace the Ajax.Updater call with an Ajax.Request call (see commented section below Ajax.Updater) it does not work either in IE8, but I can alert the responseText and the catObj.update() does not raise an error, it just doesn't have any effect. Not sure this is important but here is another info that might help you solving this: On intital loading of the page I display only the top categories, clicking on one of them calls the above shown function and displays the child categories. But clicking on one of the loaded child categories, it's where the problem starts and it does not work anymore in IE8. Do you think it's some weird problem caused by adding elements after the DOM was loaded? I really hope you can help me with this! Thanks in advance, David -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: Ajax.Updater not working in IE, works fine in FF Chrome and Safari
Hi, thanks for the quick answer. 1. I did not do that intentionally, it's some code I inherited from the former coder. I fixed that and now declare the variable inside the function, thanks for pointing it out. 2. As far as I can tell, there is no namespace conflict, the div has the id 'cat_1' and there is no other element with that id or name. The strange thing is, that the update works the first time when the loading image is displayed: catObj.update(img src=' + base_images + loading_small.gif' /); Any other ideas? David Am 16.03.2010 12:37, schrieb T.J. Crowder: Hi, Do you think it's some weird problem caused by adding elements after the DOM was loaded? No, people do that all the time. I'm not immediately seeing the problem, I think it's probably in the markup or code outside what you quoted. But some things to look for: 1. Unless you're intentionally using `catObj` as a global, you'll want to declare it in the function (there's no `var` that I see). Otherwise it becomes an implicit global, which is so high on my list of Bad Things(tm) I blogged about it[1] (which I don't often do). 2. IE has issues with conflating the namespaces of the `id` and `name` attributes, which should be separate. I see you're using IDs for the things to show/hide (perfectly normal, that). Is there *anything* on your page that has _either_ an `id` or a `name` with the value you're providing to `toggleSubCats` other than the element you're trying to show/hide? For instance, if you have a 'stuff' input field: input name='stuff' type='text' and then later in the document a 'stuff' div: div id='stuff'/div ...on IE, document.getElementById('stuff') will get you the input field element rather than the div, despite that being perfectly valid HTML markup. It's wrong, but that's the way it is, so it's worth looking whether that might be an issue. [1] http://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Mar 15, 11:28 pm, David Behlerd.beh...@gmail.com wrote: Hey folks, maybe you can help me out with this. I got a simple function that I use to load sub-categories when clicking on a parent category: function toggleSubCats(cat, id) { /* Vars and stuff */ catObj = $(cat); var send=null; /* Now figure out the status of the element and open or close based on what's found */ if( catObj.getStyle('display') == 'none') { catObj.setStyle({display : 'block'}); } else { catObj.setStyle({display : 'none'}); return; } /* Let's first dump a loading image in the target div then send the AJAX request */ catObj.update(img src=' + base_images + loading_small.gif' /); var url= base + 'galleryback/showSubCat/'+id; new Ajax.Updater(catObj,url); /* Alternative to Ajax.Updater() call new Ajax.Request(url, { method: 'get', onSuccess: function(transport) { $(cat).update(transport.responseText); } }); */ } All it's supposed to do, is to get the element (in this case a div) with the id submitted in the cat parameter and display/hide it. If display is set to block, then an loading image is shown and ajax.updater is called to load the sub-categories to the higher category (id parameter). This works fine in FF3.6, Chrome and Safari, but in IE8 the loading image is not replaced with the loaded sub-categories. If I replace the Ajax.Updater call with an Ajax.Request call (see commented section below Ajax.Updater) it does not work either in IE8, but I can alert the responseText and the catObj.update() does not raise an error, it just doesn't have any effect. Not sure this is important but here is another info that might help you solving this: On intital loading of the page I display only the top categories, clicking on one of them calls the above shown function and displays the child categories. But clicking on one of the loaded child categories, it's where the problem starts and it does not work anymore in IE8. Do you think it's some weird problem caused by adding elements after the DOM was loaded? I really hope you can help me with this! Thanks in advance, David -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: Ajax.Updater not working in IE, works fine in FF Chrome and Safari
Hi, I tried some more stuff and it's getting stranger and stranger: Using the Ajax.Request approach, it still does not work calling `$(cat).update(transport.responseText);` But calling this `$(cat).update('test');` actually works and replaces the loading image with the string 'test'. The returned responseText is a table with multiple rows and columns inside a div. The responseText was no valid html, but even after fixing that it does not work. I have neither Visual Studio nor InterDev, all I can use to debug javascript in IE8 are the built in Developer Tools and stepping through it looks fine to me. David Am 16.03.2010 15:25, schrieb T.J. Crowder: Hi, Any other ideas? From what you're saying, you've already verified (in your version using Ajax.Request) that: 1. `onSuccess` is getting triggered 2. The `response.responseText` has the correct markup 3. That `catObj.update(img ... /)` works (`catObj` having been set via `catObj = $(cat);`) 4. But the `$(cat).update(response.responseText);` within `onSuccess` doesn't work. With the quoted code, I don't see how all four of those statements can be true; I'd recommend double-checking (sorry! I know!). If they really are, you'll have to walk through it with Visual Studio or InterDev to see what's going wrong in the update call. Very strange! Good luck, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Mar 16, 11:53 am, David Behlerd.beh...@gmail.com wrote: Hi, thanks for the quick answer. 1. I did not do that intentionally, it's some code I inherited from the former coder. I fixed that and now declare the variable inside the function, thanks for pointing it out. 2. As far as I can tell, there is no namespace conflict, the div has the id 'cat_1' and there is no other element with that id or name. The strange thing is, that the update works the first time when the loading image is displayed: catObj.update(img src=' + base_images + loading_small.gif' /); Any other ideas? David Am 16.03.2010 12:37, schrieb T.J. Crowder: Hi, Do you think it's some weird problem caused by adding elements after the DOM was loaded? No, people do that all the time. I'm not immediately seeing the problem, I think it's probably in the markup or code outside what you quoted. But some things to look for: 1. Unless you're intentionally using `catObj` as a global, you'll want to declare it in the function (there's no `var` that I see). Otherwise it becomes an implicit global, which is so high on my list of Bad Things(tm) I blogged about it[1] (which I don't often do). 2. IE has issues with conflating the namespaces of the `id` and `name` attributes, which should be separate. I see you're using IDs for the things to show/hide (perfectly normal, that). Is there *anything* on your page that has _either_ an `id` or a `name` with the value you're providing to `toggleSubCats` other than the element you're trying to show/hide? For instance, if you have a 'stuff' input field: input name='stuff' type='text' and then later in the document a 'stuff' div: div id='stuff'/div ...on IE, document.getElementById('stuff') will get you the input field element rather than the div, despite that being perfectly valid HTML markup. It's wrong, but that's the way it is, so it's worth looking whether that might be an issue. [1]http://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Mar 15, 11:28 pm, David Behlerd.beh...@gmail.comwrote: Hey folks, maybe you can help me out with this. I got a simple function that I use to load sub-categories when clicking on a parent category: function toggleSubCats(cat, id) { /* Vars and stuff */ catObj = $(cat); var send=null; /* Now figure out the status of the element and open or close based on what's found */ if( catObj.getStyle('display') == 'none') { catObj.setStyle({display : 'block'}); } else { catObj.setStyle({display : 'none'}); return; } /* Let's first dump a loading image in the target div then send the AJAX request */ catObj.update(img src=' + base_images + loading_small.gif' /); var url= base + 'galleryback/showSubCat/'+id; new Ajax.Updater(catObj,url); /* Alternative to Ajax.Updater() call new Ajax.Request(url, { method: 'get', onSuccess: function(transport) { $(cat).update(transport.responseText); } }); */ } All it's
[Proto-Scripty] Ajax.Updater not working in IE, works fine in FF Chrome and Safari
Hey folks, maybe you can help me out with this. I got a simple function that I use to load sub-categories when clicking on a parent category: function toggleSubCats(cat, id) { /* Vars and stuff */ catObj = $(cat); var send=null; /* Now figure out the status of the element and open or close based on what's found */ if( catObj.getStyle('display') == 'none') { catObj.setStyle({display : 'block'}); } else { catObj.setStyle({display : 'none'}); return; } /* Let's first dump a loading image in the target div then send the AJAX request */ catObj.update(img src=' + base_images + loading_small.gif' /); var url= base + 'galleryback/showSubCat/'+id; new Ajax.Updater(catObj,url); /* Alternative to Ajax.Updater() call new Ajax.Request(url, { method: 'get', onSuccess: function(transport) { $(cat).update(transport.responseText); } }); */ } All it's supposed to do, is to get the element (in this case a div) with the id submitted in the cat parameter and display/hide it. If display is set to block, then an loading image is shown and ajax.updater is called to load the sub-categories to the higher category (id parameter). This works fine in FF3.6, Chrome and Safari, but in IE8 the loading image is not replaced with the loaded sub-categories. If I replace the Ajax.Updater call with an Ajax.Request call (see commented section below Ajax.Updater) it does not work either in IE8, but I can alert the responseText and the catObj.update() does not raise an error, it just doesn't have any effect. Not sure this is important but here is another info that might help you solving this: On intital loading of the page I display only the top categories, clicking on one of them calls the above shown function and displays the child categories. But clicking on one of the loaded child categories, it's where the problem starts and it does not work anymore in IE8. Do you think it's some weird problem caused by adding elements after the DOM was loaded? I really hope you can help me with this! Thanks in advance, David -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] prototype and Konqueror
It would appear that my local doctors surgery has decided to use a system for repeat prescriptions and appointment booking which does a test to make sure that Javascript is enabled on my browser, and it does this by sending a message to the server using Ajax.request. I am a KDE user, and my normal browser is Konqueror. I am running 4.3.2. I have Javascript enabled globally. But Ajax.request fails and so the service reports that I do not have Javascript enabled. Has any work been done to make sure that prototype works properly with Konqueror? If not do you wish to be able to support this, and is there anything I can do to 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 to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Only fire event once on mouseover
Try onmouseenter instead. It should only fire when the mouse enters the element. David Am 17.02.2010 22:40, schrieb louis w: Refer to the link below. I have a dropdown html element which has an event observer looking for mouseover. It's working, but it continuously fires mouseover events while you are mousing over the other elements inside it. I am guessing this is because of bubbling. Is there a way to only make it fire the event on the initial mouseover? I want it to do an Effect and this is breaking the effect. I am sure it's just something basic I am not doing. Thanks for the help. http://tinyurl.com/y88rcrz (open firebug) -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: ASP, MySQL, and Sortables
Hi vElentari, If your looking some ASP code, you should better go on a ASP group. If you'll have some HTML code and can't figure out how to start with scriptaculous, just start at the beggining: http://wiki.github.com/madrobby/scriptaculous/sortable And if you have trouble to achieve what your trying to do, just post code and someone will hapilly help you :)) -- david On 13 jan, 16:23, vElentari jackien1...@gmail.com wrote: I'm learning ASP, MySQL, and javascript all crash-course style right now, so please forgive me ahead of time for my ignorance! :) I'd like to use the Sortable feature on a page to reorder list elements. The elements are in a MySQL database, and the site is ASP. I have a basic HTML table that displays the list now. Each record contains the unique ID, the name of the element, a boolean value for whether the item should be Active or not, and an OrderBy field. I'd like to hide that OrderBy field on the page, and instead of having the user manually reorder the list, use the sortable drag/drop feature. I'm just looking for sample code on using classic ASP with a MySQL database to grab the records, create the list and use scriptaculous to handle the reordering for the user, and then write the new order back to the database. I've found a bunch of examples out there of people using PHP and I'm sure I can figure it out but if I don't need to recreate the wheel... Thanks -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Help with blindup/blinddown effect using mouseover/mouseout events
Hi Paul, sorry, I made a mistake, in your case, it return the Element and not a scriptaculous Effect Object. I take your code and modify it :(( Why, Because I think it's more flexible to use the Morph Effect instead of those packaged Effect (it's my personnal opinion). So go to pastie, and see the change I made: http://pastie.org/776764 If some explaination is needed, just write it back on this thread, I will try to follow it. My first reason is when moving in and out the mouse quickly on the element will lost the real height of thge element and Effects where lost ... So, quickly, I use the Morph Effect and animate the Height property of the peekaboo to 50px and set it back to 0px for the blindDown. -- david On 12 jan, 20:31, Paul Kim kimba...@gmail.com wrote: Hi David, thank you for your response and what you explained is exactly what I'm trying to do. I have tried your code sample, but I get an error from the Firebug console: effectInExecution.cancel is not a function. Here is the code that I have used:http://pastie.org/775288. It seems that effectInExecution=$('peekaboo').blindUp({ duration: 0.3 }); does not reference the Scriptaculous Effect object, which is what is needed to call the cancel() method. However, I don't know how to reference the Effect object using the effectInExecution variable. I've tried: if(effectInExecution) effectInExecution*.effect*.cancel(); but it returns an 'undefined', not the Effect object. Thanks for your time and I hope I can find a solution to this problem. On Tue, Jan 12, 2010 at 10:01 AM, david david.brill...@gmail.com wrote: hi kimbaudi, This is a common mistake with animation. Let me explain. When you mouseover element, you'll start animation. If you mouseout, after animation is finished, no problem, mouseout animation will be executed. But now if you repeatedlly move mouse over/out/over/out, if you did not manage global animations, you'll have 2 blinddown and 2 blindup executing concurrently. In your code exemple, you'll set the queue parameter so each animation is stack and play one after the other ... but this is not what you want ?? And to lmimit execution code, you set the limit parameter, which prevent having more tahn 1 animation in the queue. But that's not like that it should be handle. What you should do is: script type=text/javascript document.observe(dom:loaded, function() { var effectInExecution=null; $('observearea').observe('mouseover', function() { if(effectInExecution) effectInExecution.cancel(); effectInExecution=$('peekaboo').blindDown({ duration: 0.3 }); } $('observearea').observe('mouseout', function() { if(effectInExecution) effectInExecution.cancel(); effectInExecution=$('peekaboo').blindUp({ duration: 0.3 }); } }); /script In fact, you just save the scriptaculous object and cancel it if another animation should execute. Is that what your trying to do ?? -- david On 9 jan, 23:05, kimbaudi kimba...@gmail.com wrote: Hi, I have a hidden block element absolutely positioned to the bottom right of my webpage. I am trying to display this block element when I mouseover that area and hide this block element when I mouseout from that area using Effects.BlindUp and Effects.BlindDown. At first glance, my webpage seems to work okay. However, if I repeatedly mouseover/mouseout of the area quickly, the block element becomes visible once I mouseout of that area even though the block element should be hidden. Can anybody tell me what is wrong with my code? Can anybody point me to a website or share some example code that would achieve the results that I am trying to pull? Thanks. I would have provided the sample code on pastie.org, but the site is down. Here is my sample code: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html;charset=utf-8 / titleBlind Test/title script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/prototype/1.6.1.0/prototype.js/script script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/scriptaculous/1.8.3/scriptaculous.js/script script type=text/javascript document.observe(dom:loaded, function() { $('observearea').observe('mouseover', function() { if ($('peekaboo').visible()) { $('peekaboo').blindUp({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } else { $('peekaboo').blindDown({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } }); $('observearea').observe('mouseout', function
[Proto-Scripty] Re: Ajax Issue
Hi Sanil Music, What TJ (it's not CORWDER) want to explain is that you can't do what you're trying to do or use the ajax request in synchronous mode . In execution mode, the JS thread in the browser will execurt the AJAX.Request, and continue like if nothing was done by this function. There is just a mechanism inside the browser which get the thread back on the receveid value. And at that time the defined callback for ONSUCCESS or ONFAILURE or ... will just be launch with the result as first parameter. So you need to split ypour code to handle the behaviour you want. I think you should re-read TJ response, he gives you the answer. -- david On 12 jan, 15:34, Sanil Music music.sa...@gmail.com wrote: I use instead of amp;, but I don't know why you can't see it here. For you Cowder, that I wanted a Ajax Request like that, I would use it. I want something else. As in my code, I want to create a one function for all ajax requests. So, I just call that function, and in it I define callback function, url. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Can not display flash when use Ajax.Updater
Hi Song, What kind of error do you have i firebug ??? While reading code, I can say that the ajax.update will insert HTML inside a DOM element. But what your trying to do is insert inside a div an iFrame. So beside that, I suggest not using the ajax.update, but simply an iframe. So the code become: Filename : heloajax.html html head script src=js/prototype.js/script script src=fusioncharts/JSClass/FusionCharts.js/script /head body a href=javascript:void loadTab( 'heloajax_1.html' )Tab 1/a | a href=javascript:void loadTab( 'tab2.html' )Tab 2/a | a href=javascript:void loadTab( 'tab3.html' )Tab 3/a iframe id=content style=padding:5px;border:2px solid black; src=about:blank/divscript function loadTab( tab ) { $('content').src=tab; } loadTab( heloajax_1.html' ); /script /body /html the code of heloajax_1.html: html head script language=JavaScript src=../fusioncharts/JSClass/ FusionCharts.js/script /head body div id=chartDivTopSigInt_Live align=centerXX/div script type=text/javascript var myChart1 = new FusionCharts(fusioncharts/Charts/Pie3D.swf, myChartId, 550, 250); myChart1.setDataURL(intdatalive_db.xml); myChart1.render(chartDivTopSigInt_Live); /script /body /html and it should work like that. -- david On 8 jan, 09:16, Song chen.so...@gmail.com wrote: Hi, I use below code to display a page which including flash in a table, Filename : heloajax.html html head script src=js/prototype.js/script script src=fusioncharts/JSClass/FusionCharts.js/script /head body a href=javascript:void loadTab( 'heloajax_1.html' )Tab 1/a | a href=javascript:void loadTab( 'tab2.html' )Tab 2/a | a href=javascript:void loadTab( 'tab3.html' )Tab 3/a div id=content style=padding:5px;border:2px solid black;/ divscript function loadTab( tab ) { new Ajax.Updater( 'content', tab, { method: 'get' } ); } loadTab( heloajax_1.html' ); /script /body /html the code of heloajax_1.html: html head script language=JavaScript src=../fusioncharts/JSClass/ FusionCharts.js/script /head body div id=chartDivTopSigInt_Live align=centerXX/div script type=text/javascript var myChart1 = new FusionCharts(fusioncharts/Charts/Pie3D.swf, myChartId, 550, 250); myChart1.setDataURL(intdatalive_db.xml); myChart1.render(chartDivTopSigInt_Live); /script /body /html The page heloajax_1.html can display normal when I access it directly , but can not display flash when access it via heloajax.html. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Element feature Requests
Hi shellster, I think what you do is good. If you think it could be usefull for others, create a prototype plug- in that will does that and send it to everybody with scripteka. -- david On 6 jan, 19:02, shellster shellsterd...@gmail.com wrote: Hello, First let me say that prototype js is a godsend. I use it on every project I do now. I repeatedly find myself having to do something like this: var firstDiv = new Element('div', { id: 'theID', className: 'theClassName' }).update(content); var replacement = new Element('div').update(firstDiv); oldElement = htmlText.replace(RegExp.escape(searchString), replacement.innerHTML); Or sometimes I want to find how long the text of the new element will be. In both cases I end up having to create a wrapper div, then call innerHTML on the new div to get the text content of the original element. What I would like to see (unless I don't know of a feature that already exists) would be a replication of IE's outerHTML feature. Maybe call the method htmlText(). Using firstDiv from above, it would work like this: firstDiv.htmlText() or Element.htmlText(firstDiv) would return div id=\theID class=\theClassName\[content]/div The closest feature I can find to this is Element.inspect(), but it only returns (in this example): div id=\theID class=\theClassName \ Thanks, in advance. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Help with blindup/blinddown effect using mouseover/mouseout events
hi kimbaudi, This is a common mistake with animation. Let me explain. When you mouseover element, you'll start animation. If you mouseout, after animation is finished, no problem, mouseout animation will be executed. But now if you repeatedlly move mouse over/out/over/out, if you did not manage global animations, you'll have 2 blinddown and 2 blindup executing concurrently. In your code exemple, you'll set the queue parameter so each animation is stack and play one after the other ... but this is not what you want ?? And to lmimit execution code, you set the limit parameter, which prevent having more tahn 1 animation in the queue. But that's not like that it should be handle. What you should do is: script type=text/javascript document.observe(dom:loaded, function() { var effectInExecution=null; $('observearea').observe('mouseover', function() { if(effectInExecution) effectInExecution.cancel(); effectInExecution=$('peekaboo').blindDown({ duration: 0.3 }); } $('observearea').observe('mouseout', function() { if(effectInExecution) effectInExecution.cancel(); effectInExecution=$('peekaboo').blindUp({ duration: 0.3 }); } }); /script In fact, you just save the scriptaculous object and cancel it if another animation should execute. Is that what your trying to do ?? -- david On 9 jan, 23:05, kimbaudi kimba...@gmail.com wrote: Hi, I have a hidden block element absolutely positioned to the bottom right of my webpage. I am trying to display this block element when I mouseover that area and hide this block element when I mouseout from that area using Effects.BlindUp and Effects.BlindDown. At first glance, my webpage seems to work okay. However, if I repeatedly mouseover/mouseout of the area quickly, the block element becomes visible once I mouseout of that area even though the block element should be hidden. Can anybody tell me what is wrong with my code? Can anybody point me to a website or share some example code that would achieve the results that I am trying to pull? Thanks. I would have provided the sample code on pastie.org, but the site is down. Here is my sample code: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html;charset=utf-8 / titleBlind Test/title script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/prototype/1.6.1.0/prototype.js/script script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/scriptaculous/1.8.3/scriptaculous.js/script script type=text/javascript document.observe(dom:loaded, function() { $('observearea').observe('mouseover', function() { if ($('peekaboo').visible()) { $('peekaboo').blindUp({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } else { $('peekaboo').blindDown({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } }); $('observearea').observe('mouseout', function() { if ($('peekaboo').visible()) { $('peekaboo').blindUp({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } else { $('peekaboo').blindDown({ duration: 0.3, queue: { position: 'end', scope: 'modalbtnscope', limit: 1 } }); } });}); /script style type=text/css body {margin:0; padding:0;} #peekaboo { position:absolute; bottom:0px; right:10px; z-index:; width:100px; height:20px; background:pink; text-align:center;} #observearea { position:absolute; bottom:0px; right:10px; z-index:; width:100px; height:20px;} /style /head body div id=peekaboo style=display:none;divPeek-A-Boo/div/div div id=observearea/div /body /html -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: instantiate class problem on IE
Hi RobG, Thanks to point it out, all should read HOST OBJECT :)) Can you imagine the ramifications of IE not allowing native objects to have methods? :-) No, I prefer not thinking to that. IE have so much pain for developper that it didn't need this one. -- david On 23 déc 2009, 03:31, RobG rg...@iinet.net.au wrote: On Dec 23, 4:17 am, david david.brill...@gmail.com wrote: Hi Loris, I think that your trouble is normal, because IE don't allow to instantiate method on native object. You might need to re-think that statement. From ECMA-262: Native Object A native object is any object supplied by an ECMAScript implementation independent of the host environment. Standard native objects are defined in this specification. Some native objects are built-in;others may be constructed during the course of execution of an ECMAScript program. Can you imagine the ramifications of IE not allowing native objects to have methods? :-) Perhaps you meant host object. But if that were true, most of Prototype.js would not work at all in IE. Generally it's not a good idea to extend native objects because your not sure that another JS will not use the same method name !! Perhaps you did mean host object. Yes, it's a bad idea to add *non- standard* properties to host objects. How do you reconcile that notion with the use of Prototype.js's $() function? -- Rob -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: instantiate class problem on IE
Hi Loris, I think that your trouble is normal, because IE don't allow to instantiate method on native object. Generally it's not a good idea to extend native objects because your not sure that another JS will not use the same method name !! -- david On 19 déc, 00:36, Loris loris.men...@gmail.com wrote: hello, sorry for my bad English. I try to explain: I try to instantiate a class when the page loads, but when I happened on most browsers, I can not do it in Internet Explorer 7 or 6 I call the script in my template, like this: script type=text/javascript src=/js/veicoli-random.class.js/ script script type=text/javascript new VeicoliRandom('wrap-cont_veicoli_random', 'cont_veicoli_random', '{$url_pagina}'); /script And the script contains: Random = Class.create(); Random.prototype = { wrap : null, nomeWrap : null, container : null, nomeContainer : null, url : null, initialize : function(wrap, container, url) { this.wrap = $(wrap); this.nomeWrap = wrap; this.container = $(container); this.nomeContainer = container; this.url = url; if ( this.url == '' ) this.url = '/'; if (!this.container || !this.wrap) return; this.arrotola.bind(this).delay(10); }, arrotola : function() { // nascondo la scritta sold, per IE var ElementiNIE = $$('#' + this.nomeContainer + ' div.timbro-venduto- random'); ElementiNIE.each( function(div) { div.addClassName('invisibileIE'); }); // arrotolo su Effect.BlindUp(this.wrap, { duration: 3 }); this.aggiorna.bind(this).delay(5); }, aggiorna : function () { // aggiorno var options = {onComplete : this.srotola.bind(this).delay(1)}; new Ajax.Updater(this.container, this.url, options); }, srotola : function() { this.wrap.setStyle({ display: 'none' }); // srotolo giù Effect.BlindDown(this.wrap, { duration: 3 }); this.arrotola.bind(this).delay(15); }, }; Object.extend(document, { isDocReady: false, isDocLoaded: false, ready: function(fn) { Event.observe(document, doc:ready, fn); }, load: function(fn) { Event.observe(document, doc:loaded, fn); }}); Event.observe(document, dom:loaded, function() { Event.fire(document, doc:ready); document.isDocReady = true; if (document.isDocLoaded) Event.fire(document, doc:loaded);}); Event.observe(window, load, function() { document.isDocLoaded = true; if (!document.isDocReady) return; Event.fire(document, doc:loaded); }); // fa partire la vera classe al load della pagina VeicoliRandom = Class.create(); VeicoliRandom.prototype = { initialize : function(wrap, container, url) { // Event.observe(window, 'load', new Random(wrap, container, url)); //document.observe('dom:loaded', new Random(wrap, container, url)); document.load( a = new Random(wrap, container, url) ); }, }; I can not understand why the class called random is not instantiated or otherwise IE does nothing. While with fire-fox or other browsers, seems to work properly. What could be my mistake? Thank you for your attention. Regards Loris -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: BlindDown/Up rendering wrong
Hi Lenni, Do you have any code whe can play with ?? the HTML used and CSS applyied on HTML element :)) -- david On 21 déc, 15:01, Lenni leonard.ehrenfr...@web.de wrote: Hi, I'm trying to use the BlindDown/Up effect but it it renders stuttery and weird on all the major (FF 3.5, IE 8, Chrome 4) Browsers. Basically, the background div that is is referenced in the function call, doesn't extend all the way down. It's contents are shown fine. Also, it works fine for the first time, but every susequent BlindDown is borked. Screenshot:http://www.flickr.com/photos/24003...@n00/4203465158/sizes/o/ My suspicion is that there is some stray CSS that the effect doesn't aggree with, but I played around with it in Firebug but couldn't get to the bottom of it. I did make one observation though: Whenever I roll the div up, even in the hidden state it still has a height CSS attribute with a value of something like 80px. If I manually remove the attribute the BlindDown looks as intended. Anybody care to enlighten me as to what I'm doing wrong? -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Extending a class
Hi Greg, While reading my answer, I missed sometyhing :(( You could not use unser*ialize with the $F utility ? $F is an alias for Form.Element.Methods.getValue and it return a string, not an extend object like the $() function. So output of $F is a string, and if you want to use the unserialize chained with the $F, you should extend the Object it is return by the $F() function, so as it is said, STRING. try this, Object.extend(String.prototype,{ unserialize: function(element, source) { if (!(element = $(element))) throw new Error('DOMElement is required'); source = Object.isString(source) ? source.toQueryParams() : source; element.getElements().each(function(element) { for (var name in source) { if (name == element.name) element.setValue(source[name]); } }) return element; } }); But take care, if now the $F() return anything but not a string it does not work, or you could extend Array.prototype also. So now, call it with: $F('formElementId').toString().unserialize() or if your sure that it's string, $F('formElementId').unserialize() -- david On 17 nov, 16:47, david david.brill...@gmail.com wrote: Hi greg, try this: Object.extend(Form.Methods,{ unserialize: function(element, source) { if (!(element = $(element))) throw new Error('DOMElement is required'); source = Object.isString(source) ? source.toQueryParams() : source; element.getElements().each(function(element) { for (var name in source) { if (name == element.name) element.setValue(source[name]); } }) return element; } }); as you extend the Form.method, this method could not be used with the $ utility, but with the $F utility, so call it with: $F(form1).unserialize(form1,data) verify the syntax, this is not tested. If trouble, repost, I could do some test to set the correct syntax :)) - david On 13 nov, 00:31, greg g...@reservation-net.com wrote: Some kind soul out there has created a form unserialize method (below) that I would like to use. Being a newbie I can't figure out how to do that. My first kick at the can was Object.extend(Form.Methods, Form.Methods.unserialize); and to use it was: $(form1).unserialize(form1,data) but that didn't work. I've since tried various permutations and combinations of this, to no avail. I did get it to work by simply making it a function, but a method would be nicer. Can anyone point me in the right direction? Thank you! /** * Form#unserialize(@element, source) - Element * - @element(FormElement): Form element to fill with values * - source(Object | String): Source object where field values are taken from * * Fills form with values of a given object `source`. * Each propertie name of `source` is compared to name attribute of a form element. * * $('myForm').unserialize() * **/ Form.Methods.unserialize = function(element, source) { if (!(element = $(element))) throw new Error('DOMElement is required'); source = Object.isString(source) ? source.toQueryParams() : source; element.getElements().each(function(element) { for (var name in source) { if (name == element.name) element.setValue(source[name]); } }) return element; }; -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Issues with drag and drop using Sortable on IE
Hi Abhi, If you'll have code, it could be great. so we can catch the error :)) -- david On 17 déc, 01:15, abhi abhi...@gmail.com wrote: Hi, I am using the Sortable for drag and drop for the first time and the drag and drop works great on Firefox, Safari and Chrome but i am having the following issues on IE. 1) On dragging and dropping an element the element does not get released from the cursor. 2) On dragging the element to an open position the element does not snap back to its open position. I can post the HTML and css if required. Really appreciate help in this regards Thanks Abhi -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: An invalid or illegal string was specified code: 12 with protoaculous1.8.3
Hi Wen, Are you sure about the charset value on the script tag ?? couldn't you delete it ? I'm not sure it will resolve your trouble, but it can. Next, do you have a live exemple or the link to protoculous 1.8.3. -- david. On 16 déc, 22:39, Wen wenchen@gmail.com wrote: Hi I was trying to use protoaculous1.8.3.min.js like I did before in my template, include it in the following format script src=scripts/ protoaculous.1.8.3.min.js charset=iso-8859-1 type=text/javascript/script but then I got the error message Error: uncaught exception: [Exception... An invalid or illegal string was specified code: 12 nsresult: 0x8053000c (NS_ERROR_DOM_SYNTAX_ERR) location: http://newped2.auckland.ac.nz/ coursebuilder/scripts/prototype+scriptaculous.js Line: 3373] //this is the error while I try to use the original source code. Not sure what is the cause Have anyone here seen issue before or know what will be the trick to solve it? Thanks in advance. Wen -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Multiple prototype calls
Hi cannonballer , First why do you need two prototype on the same page, if you need to modify a behaviour of a particular method, just use the magic wrap() function's method. To answer to your question, I'm not sure it's so easy to put prototype two times in your pages. -- david On 15 déc, 11:36, cannonballer shenaldev...@gmail.com wrote: Hi, We are using prototype.js on our site and we call a function called Array.prototype.toString() - this function is also called fromhttp://www.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php when a user tries to communicate with facebook connect the JS error we see is: Message: Object doesn't support this property or method Line: 13 Char: 1273 Code: 0 URI:http://www.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php this error is seen in IE and google chrome This was not happening a week ago, so it looks like Facebook have changed something on their end. I have submitted a bug report to their developer site, but am not sure if they will change fix it. Is there a way to have 2 copies of prototype.js working on the same page? Cheers. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Using cropping on images and affects
Hi Ralph, if you want to do the text effect on the 2 differents box on the exemple you 'll give us ? In fact I don't understand why you'll need to crop the image ? CSS can do it for you with the overflow:visible; property. I perhaps miss something :(( but I think you could do such an effect directly. -- david On 15 déc, 20:58, Topsoft Design Studio i...@topsoftweb.com wrote: On example I can give of what I mean is found here on the home page of this site: http://www.carlsonveit.com/ Ralph Brickley Owner logo-small 435 NE Evans St Ste 115 P.O. Box 510 McMinnville, OR 97128 (503) 583-1830 Cell | (503) 472-7914 Office | (800) 986-0276 Fax http://www.topsoftweb.com/www.topsoftdesignstudio.com From: Topsoft Design Studio [mailto:i...@topsoftweb.com] Sent: Tuesday, December 15, 2009 11:44 AM To: prototype-scriptaculous@googlegroups.com Subject: [Proto-Scripty] Using cropping on images and affects I want to cause a few images of text to slide around within a colored box div region. When these images slide across the bounding box I want them to crop to that back to give the affect they are contained inside the region. Does anyone know a good way to set that up so I can use New Affect.Move('image'.) and it will auto-crop? Ralph Brickley Owner logo-small 435 NE Evans St Ste 115 P.O. Box 510 McMinnville, OR 97128 (503) 583-1830 Cell | (503) 472-7914 Office | (800) 986-0276 Fax http://www.topsoftweb.com/www.topsoftdesignstudio.com -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/prototype-scriptaculous?hl=en. image001.png 5KAfficherTélécharger -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Observer problem
Hi rui, Your problem could be resolved using event delegation, you set the event on the body of you document. Whne the observed event is fired, you can know on which element it is applied. If the element is the element you *really* want to observe, just launch your code that handle that event. In that case, element could be removed (no more event could be fired) and can be re-inserted. In that last case, the element have changed, but for the event delegation, the only important thing is that the element.id exist, and the event is well fired without anything to do. -- david On 14 déc, 01:15, Rui Campos ruirccam...@gmail.com wrote: Thanks for the reply, it solved my problem :) I moved the input box away from the part that I want to update and it worked. Thanks again, Rui Campos. On Dec 13, 10:03 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi, If you're replacing the element you're observing, that's your problem -- events are observed on instances. Even if you replace an element with the ID X with another element with the ID X, they're different elements. From your description, it sounds like you're replacing more than you really should be, but it's hard to tell without code. If it's not that you're replacing the element you're observing, I'd suggest replicating the problem in a small, self-contained example[1]. [1]http://proto-scripty.wikidot.com/self-contained-test-page HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Dec 13, 5:27 pm, Rui Campos ruirccam...@gmail.com wrote: Hello, I'm currently doing a college project on ruby on rails and I have to do a common Tag system for wiki pages. I have an observer observing a input field to check if a tag that the user is trying to add already has a similar one on the system, if there is one, a text box appears asking if the user wants to replace the tag introduced by the already in the system. The tag adding is made with ajax. The problem is that after the user adds a tag, meaning he clicks the add button and the ajax call refreshes the tag box, the observer stops working and i have to refresh the page. I'm not sure if this is a bug with my code or if it is intended. If it is intended, is there a work around? If there is already a discussion about a similar issue, I was unable to find it. Please direct me to it if possible : ) Thanks, Rui Campos. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: A class called Queue()
Hi Cyril, I think first that it's in the prototype core group that you should ask such a question. it's at: http://groups.google.com/group/prototype-core?hl=fr Next, it's at scripteka: http://scripteka.com/ that you should send any extension to prototype. I think in case the extension is very usefull, it could extend prototype. But the original idea is to keep prototype smaller as possible. -- david On 10 déc, 12:27, Hugeen norus.i...@gmail.com wrote: Hi guys, Firstly I said that I am French. I'll try to speak best in English, be indulgent. I recently developed a class based on Prototype for a application web. I called this class Queue(); This allows you to stack multiple Ajax.Request (or Update) to they are treated to the chain via the onComplete. This allows them allows you to do several things at different times. For example: function fooBar() { MyQueue.add(new Hash({update: 'myDiv', idBhv: 'myBhv', myParams: 'foo' })); MyQueue.add(new Hash({update: 'mySecDiv', idBhv: 'mySecBhv', myParams: 'bar' })); } This function will stack 2 behaviors to be implemented immediately one after the other. I was wondering if this feature would be added in future version of prototype? If yes, I can provide code and ideas. Have fun, See you Cyril Bogaert (http://www.mental-orb.com/) -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Event ordering for cross domain frames
Hi sumit, as explain in the previous post, I have not tested any code, and could not do any test actually. Do you have any live page we can test? It could be easier this way :)) -- david On 9 déc, 13:36, Sumit skbrnwl-...@yahoo.com wrote: Hi, So i finally came up with protoype based implementation for crossdomain iframe communication based on Julien's example as can be seen live inhttp://www.julienlecomte.net/blogfiles/cross-frame/For quick reference, lets say an iframe from domain B is hosted on main site from domain A. In order to talk to the main site, iframe creates an iframe loading proxy file from domain B which passes on the message from its current location to the main site using custom event notification mechanism (because both belong to the same domain B). As soon as the message is delivered (part of loading of the iframe's body), in iframe's onload event, iframe is destroyed after cleaning up the listeners attached to it. Now comes my problem. These messages are reaching fine across different domains. But the order is not guaranteed. I think this is more so because of the loading order of the iframes that are dynamically created for each message and then destroyed. Is there a way i could ensure the ordered delivery? I tried to reuse the iframes for multiple messages (not destroying at the end of the message delivery); but then location update is not communicated to the iframe (should have happened in onload listener, but it doesn't). Any idea what could be done? For more reference on crossdomain communication with iframes, please seehttp://softwareas.com/cross-domain-communication-with-iframes Thanks in advance for any pointers. -Sumit -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Event ordering for cross domain frames
Hi sumit, !! repost, it seems that an error delete my previous response !! As I said, I did not have possibility to test what you're trying to do, Could we have a live page so that it will be easier to point the trouble ?? -- david On 9 déc, 19:36, Sumit skbrnwl-...@yahoo.com wrote: Hi, So i finally came up with protoype based implementation for crossdomain iframe communication based on Julien's example as can be seen live inhttp://www.julienlecomte.net/blogfiles/cross-frame/For quick reference, lets say an iframe from domain B is hosted on main site from domain A. In order to talk to the main site, iframe creates an iframe loading proxy file from domain B which passes on the message from its current location to the main site using custom event notification mechanism (because both belong to the same domain B). As soon as the message is delivered (part of loading of the iframe's body), in iframe's onload event, iframe is destroyed after cleaning up the listeners attached to it. Now comes my problem. These messages are reaching fine across different domains. But the order is not guaranteed. I think this is more so because of the loading order of the iframes that are dynamically created for each message and then destroyed. Is there a way i could ensure the ordered delivery? I tried to reuse the iframes for multiple messages (not destroying at the end of the message delivery); but then location update is not communicated to the iframe (should have happened in onload listener, but it doesn't). Any idea what could be done? For more reference on crossdomain communication with iframes, please seehttp://softwareas.com/cross-domain-communication-with-iframes Thanks in advance for any pointers. -Sumit -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Progressive update messages from single request
Hi joe, I think that what you try to do could not be handle with AJAX.request (). In fact you'll receive control on a callback in the AJAX.request() when the response is complete in the browser. What you could do is a pure HTML solution: create an iFrame inside your page, and set its location to the request you made, next treat this request in server and use flush() function to send a part of the response a On 9 déc, 22:51, joe t. thooke...@gmail.com wrote: Thanks for the response Walter. i can see where you're going with that, but in those successively created new Ajax.Request calls, it's generating a new request to the server, which runs the server-side routine from the beginning, right? In my concept, the first call commands the server to run all three steps: Client Request 1 -- Collect the data (send feedback to client) -- Create the PDF (send feedback to client) -- Attach to an email and send (send final feedback) End Where your structure more resembles: Client Request 1 -- Collect data (send Feedback 1) -- Client Request 2 -- Create PDF (send Feedback 2) -- Client Request 3 -- Attach and email (send Feedback 3) End Am i correct? If so, that works only to the amount of detail i provide nested invocations of Ajax.Request to check/perform one specific detail of progress. Keep in mind this is only an example: what if i need feedback during the attachment process (attaching 1 of 100 files)? For one, it would be nasty to nest that many Ajax.Request calls, and more importantly, that email object only exists within the request that creates and processes it. The second request to attach file 2 of 100 isn't working on the same email object (as i understand it). i did find one QA similar to this where it was suggested to use $_SESSION for the current progress message... The initial Request gets the server going on the task, and also creates a second Request that repeats (eg, Ajax.PeriodicalUpdater). That one does nothing more than check $_SESSION for the latest message (which gets updated by the task being performed). That feels slightly better to me, despite the potential traffic overhead for longer requests (hence the {decay} option, i suppose). Something for me to chew on, i suppose. Thanks again, -joe t. On Dec 9, 1:22 pm, Walter Lee Davis wa...@wdstudio.com wrote: I would do this with chained onSuccess handlers. Each one would trigger a new request to a different endpoint, carrying some token to identify the visitor. $('button').observe('click',function(evt){ //do your lookup new Ajax.Request('lookup.php',{ parameters:{id:'?=$id?'}, onCreate:function(){ $('message').update('searching...');; }, onSuccess:function(transport){ //make your pdf $('message').update('making PDF...');; new Ajax.Request('pdf.php',{ parameters:{id:'?=$id?'}, onCreate:..., //you get the idea onSuccess:... }); } }}; }); Walter On Dec 9, 2009, at 11:11 AM, joe t. wrote: i think i've seen examples of this, but can't recall where, and could use some guidance. Obviously it's easy to handle a 1:1 Request/Response How can i do a true 1:many process? For instance: Client takes a single action which requires the server to perform 3 tasks: * Query database * Generate PDF * Generate email, attach PDF, and send How can i respond to the client as EACH task is accomplished without ending the request chain? Looking up your data . . . (time-based dots as delay indicator) Creating PDF . . . Email sent (or failed, as the case may be) Is this done with HTTP 2xx headers? Recursive callbacks? If anyone can point me in the right direction (which include samples), i'd be grateful. Thanks. -joe t. -- 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 prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group athttp://groups.google.com/group/prototype-scriptaculous?hl=en . -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Progressive update messages from single request
Hi again, I'm having big finger this morning :)) so let's continue: What you could do is a pure HTML solution: create an iFrame inside your page, and set its location to the request you made, next treat this request in the server and use flush() function (in PHP) to send a part of the response. This could be Looking up your data and at each server styep, just flush() a dot to indicate progression. Then continue like this to indicate the progression inside the iFrame. When finish, just remove the iFrame to indicate it's finished to the user. -- david On 10 déc, 09:13, david david.brill...@gmail.com wrote: Hi joe, I think that what you try to do could not be handle with AJAX.request (). In fact you'll receive control on a callback in the AJAX.request() when the response is complete in the browser. What you could do is a pure HTML solution: create an iFrame inside your page, and set its location to the request you made, next treat this request in server and use flush() function to send a part of the response a On 9 déc, 22:51, joe t. thooke...@gmail.com wrote: Thanks for the response Walter. i can see where you're going with that, but in those successively created new Ajax.Request calls, it's generating a new request to the server, which runs the server-side routine from the beginning, right? In my concept, the first call commands the server to run all three steps: Client Request 1 -- Collect the data (send feedback to client) -- Create the PDF (send feedback to client) -- Attach to an email and send (send final feedback) End Where your structure more resembles: Client Request 1 -- Collect data (send Feedback 1) -- Client Request 2 -- Create PDF (send Feedback 2) -- Client Request 3 -- Attach and email (send Feedback 3) End Am i correct? If so, that works only to the amount of detail i provide nested invocations of Ajax.Request to check/perform one specific detail of progress. Keep in mind this is only an example: what if i need feedback during the attachment process (attaching 1 of 100 files)? For one, it would be nasty to nest that many Ajax.Request calls, and more importantly, that email object only exists within the request that creates and processes it. The second request to attach file 2 of 100 isn't working on the same email object (as i understand it). i did find one QA similar to this where it was suggested to use $_SESSION for the current progress message... The initial Request gets the server going on the task, and also creates a second Request that repeats (eg, Ajax.PeriodicalUpdater). That one does nothing more than check $_SESSION for the latest message (which gets updated by the task being performed). That feels slightly better to me, despite the potential traffic overhead for longer requests (hence the {decay} option, i suppose). Something for me to chew on, i suppose. Thanks again, -joe t. On Dec 9, 1:22 pm, Walter Lee Davis wa...@wdstudio.com wrote: I would do this with chained onSuccess handlers. Each one would trigger a new request to a different endpoint, carrying some token to identify the visitor. $('button').observe('click',function(evt){ //do your lookup new Ajax.Request('lookup.php',{ parameters:{id:'?=$id?'}, onCreate:function(){ $('message').update('searching...');; }, onSuccess:function(transport){ //make your pdf $('message').update('making PDF...');; new Ajax.Request('pdf.php',{ parameters:{id:'?=$id?'}, onCreate:..., //you get the idea onSuccess:... }); } }}; }); Walter On Dec 9, 2009, at 11:11 AM, joe t. wrote: i think i've seen examples of this, but can't recall where, and could use some guidance. Obviously it's easy to handle a 1:1 Request/Response How can i do a true 1:many process? For instance: Client takes a single action which requires the server to perform 3 tasks: * Query database * Generate PDF * Generate email, attach PDF, and send How can i respond to the client as EACH task is accomplished without ending the request chain? Looking up your data . . . (time-based dots as delay indicator) Creating PDF . . . Email sent (or failed, as the case may be) Is this done with HTTP 2xx headers? Recursive callbacks? If anyone can point me in the right direction (which include samples), i'd be grateful. Thanks. -joe t. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send
[Proto-Scripty] Re: Check a mouse button
Hi Frédéric, When observing an event with: Event.observe('mousemove',function(evt){ if(evt.isLeftClick) alert('left button clicked'); if(evt.isMiddleClick) alert('middle button clicked'); if(evt.isRightClick) alert('right button clicked'); }) there is inside the event object some shortcut to know at the moment the event is fired if a button is clicked. And the same existe in case of a key pressed. -- david On 8 déc, 15:07, Frédéric f...@gbiloba.org wrote: Le mardi 8 décembre 2009 13:54, Alex McAuley a écrit : ...observe('mousemove',function(e) { $('SomeElement').observe('click',function() { doSomethingWIthyourClick(); Ok, so I have to register both events... Thanks :o) -- Frédéric -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Check a mouse button
Hi Samuel, Thanks to point my mistake. It's effectivelly a method and not a property. Sorry frédéric. -- david On 9 déc, 18:35, Frédéric f...@gbiloba.org wrote: On mercredi 09 décembre 2009, david wrote: When observing an event with: Event.observe('mousemove',function(evt){ if(evt.isLeftClick) alert('left button clicked'); if(evt.isMiddleClick) alert('middle button clicked'); if(evt.isRightClick) alert('right button clicked'); }) there is inside the event object some shortcut to know at the moment the event is fired if a button is clicked. And the same existe in case of a key pressed. I have to check again, but in my previous tests, the isLeftClick() always returned true, and other always returned false... -- Frédéric -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Element initialisation
Hi speedpacket, First of all thanks for taking the time to trying to understand me ;) Basically what I'm trying to do is the following. I think this forum is done for that :)) Whenever I want to add special behaviour to elements on the form, I add classes to the element, or add (I know this isn't compliant, but I have yet to find a better way) custom attributes, for instance: input type=text name=nameID id=nameID value=blablabla validation={required}/ I see at least two better way: first use the new prototype Element.storage, so you should keep outside the DOM the private information. But as you'll have to walk through the DOM after to reach each element and find if some attribute is set, I definitelly think to the second solution: Use an object where you'll store each private property for each element. Depending on how you'll walk the DOM, it could be something like: var myProperty={ 'formName_1':{ 'elementId_1':'set your parameter here in an object, array, ... depending on what kind of property you'll need', 'elementId_2':'..' } } So that you'll have no more to walk through the DOM, but just have tio iterate on myProperety object. I attached an elementInitialisation() function to the onload of the document. Once the document loaded, I have one function that does the initialisation on the element. I would loop over all elements that require initialisation in some way, and call the initialiseElemen(el) method. In that element, I do all checks (does the element need validation added, does it require extra behaviour, ...) and I modify the element adding the desired behaviour. This works fantastically... so this part is OK :)) my contribution is just a way to do this ! Unfortunately however, I also update the contents of my page using ajax on several occasions which might also add elements to the document that would require initialisation. These elements would need to be going through the initialiseElement(el) function as well... In this condition, it could be hard to maintain to use the same object to store original element and the one added with AJAX. But if you modify a little bit your initialiseElement(el) function to initialiseElement(OBJECT), than your first call will pass the original object that could create some other DOM element and each onComplete callback of the AJAX request will call the initialiseElement() function with a newly created object only containing element that were created inside each AJAX request. this could be a way to do what you'll need. What do you think ? -- david On Dec 7, 1:06 pm, david david.brill...@gmail.com wrote: Hi speedpacket, Is there a way to observe the dom and automatically run newly created elements through the initialise function? could you please explain a little more what is expected ! Or perhaps if you have some available code ? -- david On 4 déc, 13:19, speedpac...@gmail.com speedpac...@gmail.com wrote: Hello there, I have another question that I hope someone can give me some insight too... As I want all javascript code to be in a seperate file, I wrote a function initialiseElements which literally takes an element and initialises its behaviour based upon some attributes (classname for instance). Basically it takes the elemen, checks whether el.readAttribute (isInitialised) == false, and in that case processes the element (adding tooltips for action images, adding onclick behaviour, onmouseover behaviour, add validators to inputs and so on...) When processed we set el.writeAttribute(isInitialised) = true so that it will only process one element a single time... I found this way of working to be going great, and I basically call the initialiseElement method for each element upon loading the form, making it a very generic process... However (yes, there is a but!!!), I do have an issue of course when I cal some ajax to update the content; in that case I need to initialise the elements that have been added... Is there a way to observe the dom and automatically run newly created elements through the initialise function? Would this be a good approach? How do you guys deal with stuff like this? thanks so much in advance again for your much appreciated feedback. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: document.write() vs Element/appendChild()
Hi all, I was under the impression that it would not actually be added to the DOM when using innerhtml. And it therefore cannot be manipulated as a DOM element. In fact, it's faster than any JS implementation, prototype or other. Browser are optimize to parse HTML string in an unbeatable way ! And of course it could be manipulate as a DOM element, but you'll have first to retrieve it from DOM using $() or $$(). -- david -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Custom events with iframes
Hi sumit, Just a though, I didn't test it. you don't use custom event it has the form namespace:eventName. What you could do ?? is to define in frame A: document.observe(FrameB:message, function(e){ console.log(11+e); }); And send from Frame B: Event.fire(document,'FrameB:message','message to send',true); It could work, but my question is about frame and crossdomain ?? -- david On 8 déc, 20:31, Sumit skbrnwl-...@yahoo.com wrote: Hi, I've certain iframes loaded on my page (same domain) and i want to fire custom events from one of them to the other for which those iframes are already listening. Somehow the following implementation doesn't work (sadly the firebug console doesn't show anything): In the iframe A, i'm doing- document.observe(message, function(e){ console.log(11+e); }); In the iframe B (same as domain A), i'm doing- Event.fire(parent.frames[frame11],message,frame12, true); Any idea what i might be doing wrong? Thanks in advance. -Sumit -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Solving IE and onResize
Hi Rob, in fact there is two different trouble: first you'll set the onresize event to many element == think using event delegation ! next, the onresize event in FF for exemple is send one the mouse have stop mouving (even if the event is not finished yet, means you did not release the mouse button) BUT in IE, the onresize event is submit every time the mouse is mouving, like the mousemove event :(( So use event delegation and in IE set a sorte of timeout to wait a certain time before recalculate this event ! -- david On 8 déc, 19:03, Rob Cluett rob.clu...@gmail.com wrote: I'm posting this here because with all of the element resizing I am doing with prototype I am running into the IE bug where onResize is fired on all elements when the IE browser window is resized. It basically brings my application to a halt. Is there anything within prototype that corrects this behavior in IE or is there an adequate workaround that anyone came up with? My apologies if this is deemed off-topic. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Delay or defer ajax requests
Hello. I'm using animations on my website, and i want to start an Ajax request after a animation has finished. So i want to use Function.defer (...) on the Ajax.Updater function. The problem is that the Ajax.Updater must be initiated using the new keyword, but then Ajax.Updater isn't working. I tried it like this: new Ajax.Updater.defer(5,'main_body', '?topic='+topic, { evalScripts: true }); I don't want to create a new function for using the delay: var submit_ajax = function(topic) { new Ajax.Updater('main_body', '?topic='+topic, { evalScripts: true }); } submit_ajax.delay(0.7,topic); How is it possible to run functions that require new after a delay. Thanks. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Sliders freeze when the window is resized
Hi wonderingwout, It seems not to be a known problem (as there is no reply). Is it possible to have a test page, or a code we can test at pastie.org ?? -- david On 4 déc, 12:31, wonderingwout wonderingw...@gmail.com wrote: Hi, I've got an odd problem which I'm not able to fix. All my sliders freeze the moment I resize the browser window. I can't move the handle itself, but when I click on the slider track the handle jumps to the right position. So it seems like the Draggable on the handle fails after the window resize. In my document i've got a few text fields which are provided with a slider the moment the dom is loaded. All the elements are generated via javascript and all are put in a wrapper with position:absolute, a high zIndex and left and top 0. Is this a known issue? Or what am I doing wrong? -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Element initialisation
Hi speedpacket, Is there a way to observe the dom and automatically run newly created elements through the initialise function? could you please explain a little more what is expected ! Or perhaps if you have some available code ? -- david On 4 déc, 13:19, speedpac...@gmail.com speedpac...@gmail.com wrote: Hello there, I have another question that I hope someone can give me some insight too... As I want all javascript code to be in a seperate file, I wrote a function initialiseElements which literally takes an element and initialises its behaviour based upon some attributes (classname for instance). Basically it takes the elemen, checks whether el.readAttribute (isInitialised) == false, and in that case processes the element (adding tooltips for action images, adding onclick behaviour, onmouseover behaviour, add validators to inputs and so on...) When processed we set el.writeAttribute(isInitialised) = true so that it will only process one element a single time... I found this way of working to be going great, and I basically call the initialiseElement method for each element upon loading the form, making it a very generic process... However (yes, there is a but!!!), I do have an issue of course when I cal some ajax to update the content; in that case I need to initialise the elements that have been added... Is there a way to observe the dom and automatically run newly created elements through the initialise function? Would this be a good approach? How do you guys deal with stuff like this? thanks so much in advance again for your much appreciated feedback. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Custom signal
Hi fma, If you test exemple you'll gave, it could result in something like that: function func2(arguments) { alert(arguments); alert($A(arguments)); } function func1() { func2(arguments); } func1('a1','b2'); The body of func2 will alert the arguments received, which ius of course the one you create in the call to func1. in first alert, you'll receive the native arguments. It is in fact not a real object, but a fake Array. It means, that it's an array with only some Array's methods (like length). But thanks to prototype, you could convert it in a REAL array with standard method, and prototype method. An now it's a pleasure playing with arguments :)) -- david On 7 déc, 12:53, fma f...@gbiloba.org wrote: Good! Is it possible to pass again this var to another function? What if I do: function func2(arguments) { ... } function func1() { func2(arguments); } func1(a, b); Does it work? -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Delay or defer ajax requests
Hi David, You could also modify the AJAX Base class to accept a delay parameter, but it's more complex comparing to create an anonymous (or not) function ! I did not see any other choice. But I think that you should refine your question, because if your using scriptaculous, TJ response is the ONE :)) -- david On 7 déc, 09:38, T.J. Crowder t...@crowdersoftware.com wrote: Hi, I'm using animations on my website, and i want to start an Ajax request after a animation has finished. So i want to use Function.defer (...) on the Ajax.Updater function. Your animations don't provide an `afterFinish` callback or similar? (Script.aculo.us' do, but you didn't say you were using script.aculo.us, so I'm not assuming.) I don't want to create a new function for using the delay: Pretty sure that's your only choice. What's your objection to it? HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Dec 6, 10:51 pm, David S. evil.zweitaus...@googlemail.com wrote: Hello. I'm using animations on my website, and i want to start an Ajax request after a animation has finished. So i want to use Function.defer (...) on the Ajax.Updater function. The problem is that the Ajax.Updater must be initiated using the new keyword, but then Ajax.Updater isn't working. I tried it like this: new Ajax.Updater.defer(5,'main_body', '?topic='+topic, { evalScripts: true }); I don't want to create a new function for using the delay: var submit_ajax = function(topic) { new Ajax.Updater('main_body', '?topic='+topic, { evalScripts: true });} submit_ajax.delay(0.7,topic); How is it possible to run functions that require new after a delay. Thanks. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: document.write() vs Element/appendChild()
Hi All, This is not the original question, but to insert elements in the DOM, you should do: $('myContent').innerHTML='div .. /div' It's faster in execution than creating an element with a new.Element a set each needed property. -- david On 7 déc, 12:00, Alex McAuley webmas...@thecarmarketplace.com wrote: There is a known bug in IE8 regarding new Element and adding the class toit in the scope... To overcome it simply use addClassName('My-Class'); after or instead of the scope Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: ColinFine colin.f...@pace.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Monday, December 07, 2009 10:53 AM Subject: [Proto-Scripty] Re: document.write() vs Element/appendChild() On Dec 4, 10:36 pm, fma f...@gbiloba.org wrote: Ok, I found something... If I look at the HTML tree in the IE debugger, on the left panel I can't see any 'class' attribute. However, it does appear on the right panel (called Attributs), with the correct value. But IE does not seems to use it. I found that I can add an attribute to the div in the left panel. So I tried to add an attribute named 'class', and I set its value: this fixes the problem, and IE can apply the CSS!!! Then, I tried something else... I used the old-style to build the DOM tree: this.content = document.createElement('div'); Element.extend(this.content); this.content.setAttribute('id', this._name + _content); this.content.setAttribute('class', fullContent); document.body.appendChild(this.content); I don't know if this is relevant to the problem, but you don't need to use 'setAttribute' for built-in attributes of HTML element: this.content.id = this._name + _content; avoids an unnecessary function call. For the DOM attribute 'class', the Javascript binding requires you to use 'className', because 'class' is a reserved word in Javascript: this.content.class = fullContent; (or, using a Prototype method) this.content.addClassName('fullContent'); This is not quite the same, because if you already have a class on the element, this will add the new class, whereas the simple assignment will replace it. But since you have just created the element, there is no difference. instead of the new-style: this.content = new Element('div', {'id': this._name + _content, 'class': fullContent}); and it worked!!! At first, I didn't put the quotes arround the attributes names, in the hash: this.content = new Element('div', {id: this._name + _content, class: fullContent}); but IE does not like this syntax (it asks for an int or a string). But as you can see, giving a string does not seems to work well. IE objects (correctly) to your using the Javascript reserved word 'class' as an object key: Firefox is more lax and lets it through. 'id' will work without quotes. Am I doing something wrong with the new-style method? Or is it a known issue in Prototype? I don't know. Your example seems to match that in the Prototype documentation. I would try it with 'className' instead of 'class' and see whether this works. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/prototype-scriptaculous?hl=en. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: storing a closure as the value in a Hash (and then calling it later)
Hi Wil, info.key.info.value(this)); have two closed brace, but I'm sure that it's a cut paste error :)) Something surprise me, you call info.key.info.value as an object and you say that info.key and info.value is defined. It's strange, because you should have say info.key.info.value is an existing object. But, the real problem is that you call this inside an anonymous function: observerInfo.each(function(info) { info.key.info.value(this)); }); this should refer to your objectOfMyObservableClass? is that rigth ? But inside the anonymous function, it lost its binding to the defined class and refer the function (so in fact is the window object) To keep the reference to this inside the anonymous function, there is a first way: var that=this; observerInfo.each(function(info) { info.key.info.value(that)); }); And another way could be done in a more prototypish way: var myFunction=(function(info) { info.key.info.value(this)); }).bind(this); observerInfo.each(myFunction); -- david On 3 déc, 22:00, Wil wil.tur...@gmail.com wrote: Hi all, I'm trying to implement a somewhat generic way for my controller objects to listen for changes to various properties of my model objects. I'm not a javascript expert, so there is quite possibly a Better Way™ of solving the bigger problem - I'm open to pointers in that direction, if my current approach is not a good idea. Here's the machinery I currently have in place: MyClass.prototype.observeValueChange = function(observer, property, callback) { if (this.observableChanges == null) this.observableChanges = new Hash(); if (this.observableChanges.get(property) == null) this.observableChanges.set(property, new Hash()); this.observableChanges.get(property).set(observer, callback); } MyClass.prototype.fireValueChanged = function(property) { if (this.observableChanges == null) return; var observerInfo = this.observableChanges.get(property); if (observerInfo == null) return; observerInfo.each(function(info) { info.key.info.value(this)); }); } Here's an example of registering to listen: objectOfMyObservableClass.observeValueChange(this, 'foo', function (destination) { alert(observed change in foo); }); objectOfMyObservableClass.fireValueChanged(foo); Tracing through the code, everything appears fine up to the point where I try to call the stored callback. This line: info.key.info.value(this)); info.key and info.value are both valid objects, but nothing happens. Thanks in advance! -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: element.insert not working in safari 4.0.3 (OS X)
Hi jjaayy, first, do you have trry an alert inside the oncomplete function, so it indicate that the AJAX request work. Next, does your AJAX.Request return something (transport.responseText contain something) ? that is some question you did not answer, but it could be so much think !! Any chance to have a live view of the problem ?? -- david On 3 déc, 16:26, jjaayy jan.gloeck...@gmail.com wrote: hi everybody, I'm not sure I my code is wrong or if this is a problem with safari (it's working in FF): In a Ajax.Request statement I have onComplete: function(transport) { $('container_td_loading').insert({ after: transport.responseText }); } But this hangs in Safari without any error. Whats wrong or can confirm someone this behaviour in Safari? Thanks for any tips. J -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: storing a closure as the value in a Hash (and then calling it later)
Hi, Thanks to TJ answer, I forgot THE each second argument to automatically bind the called function to a context. -- david. On 4 déc, 12:22, T.J. Crowder t...@crowdersoftware.com wrote: Hi, Tracing through the code, everything appears fine up to the point where I try to call the stored callback. This line: info.key.info.value(this)); info.key and info.value are both valid objects, but nothing happens. Your 'info.key' property is your observer, which I tend to suspect doesn't then have a property called 'info' on it, but that's what info.key.info retrieves. Then you retrieve the 'value' property from that and try to call it (info.key.info.value(this)). You're also passing in a 'this' value which refers to the browser window, whereas I suspect you wanted to refer to the observable object. I think this is what you meant: observerInfo.each(function(info) { info.value.call(info.key, this); }, this); ...which will call the callback setting the observer as the context (the 'this' value within the callback) and passing in the observed object -- note that to do that, I had to pass 'this' into #each as its second argument because otherwise context is lost when you call #each. But the above, by itself, won't solve the problems because I think you probably have an issue here: this.observableChanges.get(property).set(observer, callback); Hash#set is documented as accepting a String for the key, but you're passing in other kinds of objects, not just strings. You can't rely on the key not getting converted to a string (a string that will probably be [Object] or similar). FWIW, I probably wouldn't use Hash for this at all, it's overkill for the 'observableChanges' property and mis-matched for the values within that. I'd probably just use a plain JavaScript object for 'observableChanges' using the property name as the key, with the value being an array of tuples for the callbacks to make. HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Dec 3, 9:00 pm, Wil wil.tur...@gmail.com wrote: Hi all, I'm trying to implement a somewhat generic way for my controller objects to listen for changes to various properties of my model objects. I'm not a javascript expert, so there is quite possibly a Better Way™ of solving the bigger problem - I'm open to pointers in that direction, if my current approach is not a good idea. Here's the machinery I currently have in place: MyClass.prototype.observeValueChange = function(observer, property, callback) { if (this.observableChanges == null) this.observableChanges = new Hash(); if (this.observableChanges.get(property) == null) this.observableChanges.set(property, new Hash()); this.observableChanges.get(property).set(observer, callback); } MyClass.prototype.fireValueChanged = function(property) { if (this.observableChanges == null) return; var observerInfo = this.observableChanges.get(property); if (observerInfo == null) return; observerInfo.each(function(info) { info.key.info.value(this)); }); } Here's an example of registering to listen: objectOfMyObservableClass.observeValueChange(this, 'foo', function (destination) { alert(observed change in foo); }); objectOfMyObservableClass.fireValueChanged(foo); Tracing through the code, everything appears fine up to the point where I try to call the stored callback. This line: info.key.info.value(this)); info.key and info.value are both valid objects, but nothing happens. Thanks in advance! -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Trouble removing a select
Hi srufle, it works for me in FF3.5. Don't you have modified the remove() merthod in the specified object. Because myElement.remove() ans Element.remove('myElementId') are the same function. -- david On 1 déc, 15:54, srufle sru...@gmail.com wrote: I am not sure I may have found an issue. On FF35 Does not work: var dd = $('some_dropdown'); dd.remove(); - I end up in emptyFunction Does work: var dd = $('some_dropdown'); Element.remove(dd); select id=some_dropdown style=width: 135px; name=some option selected= value=VALValText/option /select BUT I was able to make the element.remove() calls on elements that were not selects. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: background-color stucked after an highlight effect
Hi Eric, do you try to reset the element style property for background-color ?? try this new Effect.Highlight('b',{queue: 'end', afterFinish: function() { $('b').setStyle({backgroundColor:''});}}); -- david On 4 déc, 12:55, Eric lefauv...@gmail.com wrote: Hi, I have a table with even rows having an even class name. even changes the background color of the row: tr.even { background-color: #def; } My concern is that after using a Effect.Highligth on some rows, if I add or remove the even className to them, their background color doesn't change anymore. I tried without success those 3 approaches: new Effect.Highlight(tr,{queue: 'end', afterFinish: function() { tr.style.backgroundColor = undefined;}}); new Effect.Highlight(tr,{queue: 'end', afterFinish: function() { tr.setStyle({'background-color: 'none'});}}); new Effect.Highlight(tr,{queue: 'end', afterFinish: function() { tr.setStyle({'background-color': 'inherit'});}}); Can anyone tell me what I am doing wrong? Eric -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Prototype conflict solution
Sorry, Should read ... GenevaJS, a port of jquery syntax using prototype at http://genevajs.com/ -- david On 2 déc, 13:42, david david.brill...@gmail.com wrote: Hi both, What is funny with the JQuery compatibility mode is that it breaks plugin, and standard JQuery code. What I propose is a different approach, suppress Jquery, and only use Prototype with GenevaJS, a port of jquery using prototype athttp://genevajs.com/ btw, it's not as simple. -- david On 30 nov, 13:01, Rafal Zarajczyk rzarajc...@gmail.com wrote: As far as I know there is no such thing in prototype, but definitely it would be usefull sometimes! When I need a single method from Prototype in a jQuery-driven site (let's say I want to use unescapeHTML ()) I just copy-paste implementation... which is sometimes easy, sometimes hard. I'm looking forward to this feature! Rafał Zarajczyk Ps. The solution switch everything do Prototype is not always possible :-P On 24 Lis, 14:58, markojakic jakicmeis...@gmail.com wrote: I am working on some site, which has jquery support, but I added Prototype (autocomplete component with xml loading) and it's not working when JQuery is loaded. I know that JQuery has that support with JQuery.noconflict but it's hard to change ALL the .js files and ALL the $ functions. So, does Prototype have such support? I'd only need to change a little one .js file which handles with autocompleter. Regards -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Getting the coordinates of a draggable in the droppable
Hi sethammons, In fact you can pick every element position with prototype, not just for a draggable. The method to use is Element.cumulativeOffset at http://api.prototypejs.org/dom/element.html#cumulativeoffset-class_method If there is a scroll bar that modify position of the element, prefer the Element.cumulativeScrollOfset at http://api.prototypejs.org/dom/element.html#cumulativescrolloffset-class_method of course both method could be call with element#cumulative... -- david On 25 nov, 01:43, sethammons seth.amm...@gmail.com wrote: Hi all! I'm a php person, and relatively new to javascript -- so I appreciate any help I can get! My question: How do I get the center coordinates and/or the top left coordinates of a draggable after it is dropped in the droppable? Here is my situation: I am letting users upload images. In their image, they specify a given area. Later, another user then either clicks or drags a draggable -- I haven't chosen yet -- in the area that they think the originator put their selected area, and the php checks the results after the page reloads. For example, the originator uploads a picture of the solar system, and specifies where Earth is. I then have the coordinates of a box that surrounds Earth stored in the database. Later, a user comes by and attempts to identify Earth by either clicking or dragging a pointer or circle or box within the earlier specified and stored coordinates. The second user then submits the page, and I can compare to see if the coordinates of the second user fall within the coordinates of the given area from the original user. I hope that this does not sound too convoluted. Thanks for any help you guys can offer! --Seth -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Attempting to extend a prototype method
Hi Hippyjim Starbrook, this is not the way you should do. It's better to use a wrapper to t (he native function. First because you did not modify the standard behaviour of prototype, and also because you still have the capability to call the original function. Have a look to the wrap() function at http://api.prototypejs.org/language/function.html#wrap-instance_method In you case, you could do something like that: Form.Element.Methods.disable=Form.Element.Methods.disable.wrap( function(OriginalCall,ExtraParameters){ //do what you want here, //this refer to a Form.Element.Methods object. ... //call original method and return it's value if needed. return OriginalCall(this); } ); The OriginalCall is the original prototype function you overide. You can (or of course not) call it. hope that help. -- david On 25 nov, 22:30, Hippyjim Starbrook hippyjim.starbr...@gmail.com wrote: Hi All I'm attempting to extend the Form.Element.disable() method, so that it adds a disabled class to any element is disables. I'm attempting to replace the existing prototype function with one of my own, using the following code in a javascript file loaded after prototype.js: Form.Element.Methods.disable = function(element) { element = $(element); element.blur(); element.disabled = true; element.addClassName(disabled); return element; } But it doesn't seem to replace the original prototype method. Am I missing something? -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: element.attachEvent is not a function error in Prototype with Low Pro
Hi darth, an idea is to get the latest version from the github website. The DanWeb site have a link to the low pro version in GitHub (it seems that the version have some trouble with FF 3.5). -- david On 24 nov, 09:38, Alex McAuley webmas...@thecarmarketplace.com wrote: Evidently not else it wouldn't be conflicting ! Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: david david.brill...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Tuesday, November 24, 2009 7:00 AM Subject: [Proto-Scripty] Re: element.attachEvent is not a function error in Prototype with Low Pro Hi Alex, Low Pro 0.5 supports Prototype 1.6. so should have no conflict with both inclusion. -- david On 24 nov, 00:15, Alex McAuley webmas...@thecarmarketplace.com wrote: Its probably conflicting with each other ... I use Jquery and Prototype together in alot of apps and i get the same error unless i tell jQuery to not conflict Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: darth darthd...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Saturday, November 21, 2009 8:03 AM Subject: [Proto-Scripty] element.attachEvent is not a function error in Prototype with Low Pro I'm having problem with Prototype working together with Low Pro. Just by adding Low Pro, I get JS error in prototype element.attachEvent is not a function on line 4536. When I remove Low Pro, there is no error. The lin in Prototype where error occurs is element.attachEvent(on + actualEventName, responder); where actualEventName contains unload I'm using Prototype 1.6.1 and Low Pro 0.5, the same error occured also with Prototype 1.6.0.3 -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Sychronize many asynchronous Ajax.Request
Yes your right Alex, but the case of maalek did not mention such numbers of request. I think in his case using one array is better than using a lot (~14 differents variables). btw, I'm interrest in In fact the actal request stays in memory unless you null the object and after reflexion, that is logical, but is it normal ?? -- david On 24 nov, 09:37, Alex McAuley webmas...@thecarmarketplace.com wrote: Arrays are stored in memory, they are not a cookie so they do not get stored on the client machine .. (and you yourself say that even if it was its not cross browser) To test .. Do 100 requests with large responses and save them all into an array and see how much memory the web browser is eating each time you do one... In fact the actal request stays in memory unless you null the object - i wrote a post on this in TJ's proto scripty wiki which has test cases to prove it. I dont see any reason ever to save the response of multiple requests in an object that is saved in memory of the client's browser what happens if they are on an iPhone or somehting with not alot of memory ? Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: david david.brill...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Tuesday, November 24, 2009 7:24 AM Subject: [Proto-Scripty] Re: Sychronize many asynchronous Ajax.Request I'm sorry Alex, but I definitely not agree with you ! First because there is existing method to cache the Ajax request and they use local object to save the result (we have now some new way to save locally a variable but it's not cross-browser). And next, because an array is much more flexible than variables. you could access each element independantly and have the length method (In our exemple, to know how much elements have been saved). And if each request should have a specific position in the array, length is no more working, but Prototype have sugaristic method that help you playing with Array the way you need. But there is I think plenty way to do this. -- david On 23 nov, 23:44, Alex McAuley webmas...@thecarmarketplace.com wrote: It would polute the variable and seriously eat RAM to save every result response in an array, i would highly recommend staying away from it.. Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: david david.brill...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Monday, November 23, 2009 8:00 PM Subject: [Proto-Scripty] Re: Sychronize many asynchronous Ajax.Request Hi all, if you need to save all returned value, just save each request result in an array. Check the length of the result list to know when all request are finished. But we still turn around the same idea. -- david On 23 nov, 15:59, Alex McAuley webmas...@thecarmarketplace.com wrote: The main problem is that due to the ansynchronous and the wait times / serverside processing times ... you never know which will finish first nd if the last request relies on the first one completing then its going to hard fail !!... Each one needs to set a variable to say its complete ! Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: Eric lefauv...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Monday, November 23, 2009 2:30 PM Subject: [Proto-Scripty] Re: Sychronize many asynchronous Ajax.Request Hi, I'd launch all Ajax.Request except the last one with a onSuccess handler that: - set a flag - if all flags are set, launch the last Ajax.Request This way, you don't have to use timer, or loop calling yourself recursively. Eric NB: I didn't test it, but you may increment a counter instead of using many flags On 21 nov, 23:31, T.J. Crowder t...@crowdersoftware.com wrote: Hi, Synchronous is simple way but object create time increses x3. How function use to wait until all object is ready ? setInterval ? Probably setTimeout, but yeah; or setTimeout's Prototype wrappers Function#defer / Function#delay. Have the code in question check its preconditions, and if they're not met, setTimeout/defer/delay itself. -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Nov 21, 2:33 pm, maalek maaa...@gmail.com wrote: Synchronous is simple way but object create time increses x3. How function use to wait until all object is ready ? setInterval ? maaalek On 21 Lis, 14:32, Alex McAuley webmas...@thecarmarketplace.com wrote: Ask it to check a variable that is set as ready by all the others .. or make it defer and be synchronous .. Alex Mcauleyhttp://www.thevacancymarket.com
[Proto-Scripty] Re: Scriptaculous adds green color to upper-case fonts
Hi Kenny, I tested the link with FF3.5 and it works :)) Which version has this problem ?? btw, one suggestion is to be sure that the starting color is defined in the CSS before the effects start. But default color in scriptaculous is white so -- david On 23 nov, 01:48, Kenny kennypres...@gmail.com wrote: Hello: I'm glad to have found this group as I'm very eager to get Sciptaculous working properly. I recently discovered Scriptaculous, and I tested version 1.6.4 on a website I built for my friend, using body onLoad=appearFromInvisible(). It worked perfectly in IE, but in Firefox, upper-case letters (especially of white fonts) displayed half green when they completed fading in. Now that I upgraded to the latest version of Scriptaculous 1.8.3, the green color only flashes momentarily onto the white fonts just before completeley fading in. Are you familiar with this problem? Is there a way to correct it? The test page showing the problem:http://www.billyjoeconor.com/home-test.html Thanks -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=.
[Proto-Scripty] Re: element.attachEvent is not a function error in Prototype with Low Pro
Hi darth, could we have an live exemple page ?? To see if we can do something. I see that you've try to send a message to the low pro Google Groups, but seems to have been spammed :(( Did you try to send a message directly to the webmaster of danweb site ?? -- david On 21 nov, 09:03, darth darthd...@gmail.com wrote: I'm having problem with Prototype working together with Low Pro. Just by adding Low Pro, I get JS error in prototype element.attachEvent is not a function on line 4536. When I remove Low Pro, there is no error. The lin in Prototype where error occurs is element.attachEvent(on + actualEventName, responder); where actualEventName contains unload I'm using Prototype 1.6.1 and Low Pro 0.5, the same error occured also with Prototype 1.6.0.3 -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=.
[Proto-Scripty] Re: Scriptaculous adds green color to upper-case fonts
Hi again, I've checked on on another computer, and I see a problem in the menu when first overing an element. What I see is not a color problem, but an opacity problem. Menu element's opacity is not set at page definition, so when the first effect appears, scriptaculous set by default opacity to 1. For other effects, no problem as the value is set at the element's level. -- david On 23 nov, 18:36, david david.brill...@gmail.com wrote: Hi Kenny, I tested the link with FF3.5 and it works :)) Which version has this problem ?? btw, one suggestion is to be sure that the starting color is defined in the CSS before the effects start. But default color in scriptaculous is white so -- david On 23 nov, 01:48, Kenny kennypres...@gmail.com wrote: Hello: I'm glad to have found this group as I'm very eager to get Sciptaculous working properly. I recently discovered Scriptaculous, and I tested version 1.6.4 on a website I built for my friend, using body onLoad=appearFromInvisible(). It worked perfectly in IE, but in Firefox, upper-case letters (especially of white fonts) displayed half green when they completed fading in. Now that I upgraded to the latest version of Scriptaculous 1.8.3, the green color only flashes momentarily onto the white fonts just before completeley fading in. Are you familiar with this problem? Is there a way to correct it? The test page showing the problem:http://www.billyjoeconor.com/home-test.html Thanks -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=.
[Proto-Scripty] Re: Sychronize many asynchronous Ajax.Request
Hi all, if you need to save all returned value, just save each request result in an array. Check the length of the result list to know when all request are finished. But we still turn around the same idea. -- david On 23 nov, 15:59, Alex McAuley webmas...@thecarmarketplace.com wrote: The main problem is that due to the ansynchronous and the wait times / serverside processing times ... you never know which will finish first nd if the last request relies on the first one completing then its going to hard fail !!... Each one needs to set a variable to say its complete ! Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: Eric lefauv...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Monday, November 23, 2009 2:30 PM Subject: [Proto-Scripty] Re: Sychronize many asynchronous Ajax.Request Hi, I'd launch all Ajax.Request except the last one with a onSuccess handler that: - set a flag - if all flags are set, launch the last Ajax.Request This way, you don't have to use timer, or loop calling yourself recursively. Eric NB: I didn't test it, but you may increment a counter instead of using many flags On 21 nov, 23:31, T.J. Crowder t...@crowdersoftware.com wrote: Hi, Synchronous is simple way but object create time increses x3. How function use to wait until all object is ready ? setInterval ? Probably setTimeout, but yeah; or setTimeout's Prototype wrappers Function#defer / Function#delay. Have the code in question check its preconditions, and if they're not met, setTimeout/defer/delay itself. -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Nov 21, 2:33 pm, maalek maaa...@gmail.com wrote: Synchronous is simple way but object create time increses x3. How function use to wait until all object is ready ? setInterval ? maaalek On 21 Lis, 14:32, Alex McAuley webmas...@thecarmarketplace.com wrote: Ask it to check a variable that is set as ready by all the others .. or make it defer and be synchronous .. Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: maalek maaa...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Saturday, November 21, 2009 12:59 PM Subject: [Proto-Scripty] Sychronize many asynchronous Ajax.Request Hello I have problem. When my page is load I build many objects (aprox 15) by Ajax.Request (asynchronous : true) but last object I can create when all previous object is ready. Any idea how do that ? maaalek -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/prototype-scriptaculous?hl=. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=.
[Proto-Scripty] Re: Local autocomplete issue when searching for 'IN' string
Hi manuel, the autocomplter check on the string you enter in the array, not inside the generate code. I only think to one thing, delete the HTML markup inside the autocomplter. this autocompleter does almoth the same as yours: new Autocompleter.Local('search_stpr', 'div_search_stpr',['WI - Wisconsin','GA - Georgia','MD - Maryland','ME - Maine'], {fullSearch:true}); But if you still need some styling, just set the HTML code and styling will match elements by using CSS selectors. But in that case if you still enter sp, spa, span, all elements are returned There is the possibility to pass instead of the array of possibles values a function which will do the checking, but that more difficult. Or one possibility is to set the partialSearch parameter to false so that the autocompleter will only check at the beginning of the string to find a match. but entering 3 letter will have no effects. Or invert the initial of the state with it's name, and style by defaul the name and add some HTML code to style the initial (the partialSearch parameter is still set to false). hope that help. -- david On 18 nov, 15:44, Manuel Corrales manuelcorra...@gmail.com wrote: Hello, I am using a local autocomplete and everything is working fine except when I search using the IN letters. When I search like that, the drop down menu show the first match and then other 9 items that do not match the search. This is only happening with this string. I think this maybe because I have this setup and the word informal is in all items? How can I solve this? new Autocompleter.Local('search_stpr', 'div_search_stpr', ['WIspan class=informal - Wisconsin/span','GAspan class=informal - Georgia/span','MDspan class=informal - Maryland/span','MEspan class=informal - Maine/span',], {fullSearch:true}); Thanks in advance!! -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=.
[Proto-Scripty] Re: Documentation 1.6. 1CHM version
Hi foolged, That was a personnal contribution to prototype, so ... Maybe the webmaster of samesystem.dk will update it's version with the latest documentation version. the official documentation version is done with pDoc, which could (I think) be used offline, but that need some extra work. -- david On 16 nov, 04:23, foolged fool...@gmail.com wrote: When be exist Documentation in CHM version for Prototype 1.6.1 likehttp://show.samesystem.dk/public/Prototype-v1.6.0.chm -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=.
[Proto-Scripty] Re: element.attachEvent is not a function error in Prototype with Low Pro
Hi Alex, Low Pro 0.5 supports Prototype 1.6. so should have no conflict with both inclusion. -- david On 24 nov, 00:15, Alex McAuley webmas...@thecarmarketplace.com wrote: Its probably conflicting with each other ... I use Jquery and Prototype together in alot of apps and i get the same error unless i tell jQuery to not conflict Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: darth darthd...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Saturday, November 21, 2009 8:03 AM Subject: [Proto-Scripty] element.attachEvent is not a function error in Prototype with Low Pro I'm having problem with Prototype working together with Low Pro. Just by adding Low Pro, I get JS error in prototype element.attachEvent is not a function on line 4536. When I remove Low Pro, there is no error. The lin in Prototype where error occurs is element.attachEvent(on + actualEventName, responder); where actualEventName contains unload I'm using Prototype 1.6.1 and Low Pro 0.5, the same error occured also with Prototype 1.6.0.3 -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Sychronize many asynchronous Ajax.Request
I'm sorry Alex, but I definitely not agree with you ! First because there is existing method to cache the Ajax request and they use local object to save the result (we have now some new way to save locally a variable but it's not cross-browser). And next, because an array is much more flexible than variables. you could access each element independantly and have the length method (In our exemple, to know how much elements have been saved). And if each request should have a specific position in the array, length is no more working, but Prototype have sugaristic method that help you playing with Array the way you need. But there is I think plenty way to do this. -- david On 23 nov, 23:44, Alex McAuley webmas...@thecarmarketplace.com wrote: It would polute the variable and seriously eat RAM to save every result response in an array, i would highly recommend staying away from it.. Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: david david.brill...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Monday, November 23, 2009 8:00 PM Subject: [Proto-Scripty] Re: Sychronize many asynchronous Ajax.Request Hi all, if you need to save all returned value, just save each request result in an array. Check the length of the result list to know when all request are finished. But we still turn around the same idea. -- david On 23 nov, 15:59, Alex McAuley webmas...@thecarmarketplace.com wrote: The main problem is that due to the ansynchronous and the wait times / serverside processing times ... you never know which will finish first nd if the last request relies on the first one completing then its going to hard fail !!... Each one needs to set a variable to say its complete ! Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: Eric lefauv...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Monday, November 23, 2009 2:30 PM Subject: [Proto-Scripty] Re: Sychronize many asynchronous Ajax.Request Hi, I'd launch all Ajax.Request except the last one with a onSuccess handler that: - set a flag - if all flags are set, launch the last Ajax.Request This way, you don't have to use timer, or loop calling yourself recursively. Eric NB: I didn't test it, but you may increment a counter instead of using many flags On 21 nov, 23:31, T.J. Crowder t...@crowdersoftware.com wrote: Hi, Synchronous is simple way but object create time increses x3. How function use to wait until all object is ready ? setInterval ? Probably setTimeout, but yeah; or setTimeout's Prototype wrappers Function#defer / Function#delay. Have the code in question check its preconditions, and if they're not met, setTimeout/defer/delay itself. -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Nov 21, 2:33 pm, maalek maaa...@gmail.com wrote: Synchronous is simple way but object create time increses x3. How function use to wait until all object is ready ? setInterval ? maaalek On 21 Lis, 14:32, Alex McAuley webmas...@thecarmarketplace.com wrote: Ask it to check a variable that is set as ready by all the others .. or make it defer and be synchronous .. Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: maalek maaa...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Saturday, November 21, 2009 12:59 PM Subject: [Proto-Scripty] Sychronize many asynchronous Ajax.Request Hello I have problem. When my page is load I build many objects (aprox 15) by Ajax.Request (asynchronous : true) but last object I can create when all previous object is ready. Any idea how do that ? maaalek -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=. -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/prototype-scriptaculous?hl=. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email
[Proto-Scripty] Re: Ajax.Updater Issue in IE - cache issue - Symfony + Prototype
Hi Avichal, do you have a live exemple? because it's hard to find the problem with just explanation. -- david On 24 nov, 02:00, Avichal Garg avic...@gmail.com wrote: Hi David, It's a Get request. Appending the timestamp at the end of the URL was supposed to fix that but it didn't seem to do that... Avichal On Oct 30, 12:50 am, david david.brill...@gmail.com wrote: Hi Avichal Garg, Is it a GET or a POST request, because IE (and OPERA) cache GET request. In Firebug, do you see the header you set when request is lauch from FF ? -- david On 28 oct, 08:54, Avichal Garg avic...@gmail.com wrote: Hi, I'm using Prototype 1.6.0.3. I spent a lot of time searching the net for solutions to this and found a few good suggestions/hints. The most relevant is the following, which talks about the exact problem I'm having:https://prototype.lighthouseapp.com/projects/8886/tickets/175-ajax-up... I have a page, sitting atwww.domain.com/folderwhichopensa popup. This popup then uses Ajax.Updater to update a div onwww.domain.com/folder (the parent/opening page). In FF this works fine. In IE it works the first time but not subsequent times. After the parent page is refreshed. I've tried setting the http headers in the indexSuccess module/actions/ actions.class.php as suggested herehttp://greenash.net.au/posts/thoughts/an-ie-ajax-gotcha-page-caching $this-getResponse()-setHttpHeader('Last-Modified', gmdate(D, d M Y H:i:s). GMT); $this-getResponse()-setHttpHeader('Cache-Control', 'no-store, no- cache, must-revalidate, post-check=0, pre-check=0'); $this-getResponse()-setHttpHeader('Pragma', 'no-cache'); This hasn't worked. I also noticed in the updateContent function in Ajax.Updater, there is a call: receiver.update(responseText); (line 1468 or so) The first time through, this call is executed and the resulting call is made to the IE specific update function on line 2449. The second time through, this function doesn't seem to get called at all. I also tried creating a unique URL for the ajax request by appending the current timestamp to the end ofwww.domain.com/folder?timestamp=12311312312. This creates two unique subsequent URLs for the Ajax.Updater call but the call to receiver.update still seems to fail. Does anyone have ideas on what is going on? Am I not setting my http headers in the right place? Thanks, Avichal -- 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: instanting and reinstanting a function: Ajax.PeriodicalUpdater
Bill, just a precision (in Fact I did not understand that you still need to get every minutes the result): the stop() method is at http://api.prototypejs.org/ajax/ajax/periodicalupdater.html#stop-instance_method normally, you could stop start the peridical updater at will. -- david On 16 nov, 15:58, Alex McAuley webmas...@thecarmarketplace.com wrote: Bill. You can assign the periodical to a variable and call stop on it if you wish .. EG. var myperiodical=new Ajax.Periodical.. myperiodical.stop(); // stops it ... All this is defined but IMO unclear in the documentation HTH Alex Mcauley http://www.thevacancymarket.com - Original Message - From: bill To: prototype-scriptaculous@googlegroups.com Sent: Monday, November 16, 2009 2:31 PM Subject: [Proto-Scripty] Re: instanting and reinstanting a function: Ajax.PeriodicalUpdater david wrote: Hi Bill, Isn't it just an Ajax.Request that you need, because the periodical executer is used 'generally' without the need of a user click. I mean, in your exemple, it's like you start at the begginning the periodical updater, and after it reload every time there is new message the target DIV. But in your case, it seems that the call is done only once on a uxer click. So just use AJAX.Request, and on click launch it. The only think you will do is to manually update the div with the result of the AJAX call. no, actually I want the div to be loaded when the user clicks, and reloaded every minute it is visible. -- david On 15 nov, 15:36, bill will...@techservsys.com wrote: When the user clicks a link it executes this function: function fPendingMail() { //set the mail div to show document.getElementById (maildiv).style.display = block; new Ajax.PeriodicalUpdater('maildiv', 'mail/pending_mail.php', { method: 'get', frequency: 60, decay: 1 }); return false; //inhibit the href } and the maildiv appears and loads a list of pending mail messages and all is good. When they are done the script executes document.getElementById (maildiv).style.display = none; I know the div is still updating and I don't need it to so: 1) how do I stop the periodicalUpdater. 2) should I be de-instanting (whatver the correct verb is) the object so that when the user clicks the link again it will not just keep creating more instances of the Ajax.PeriodicalUpdater ? bill -- Bill Drescher william {at} TechServSys {dot} com -- Bill Drescher william {at} TechServSys {dot} com --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: onClick vs Element.observe
Hi phegaro, the difference is not about cross browser, because both method is cross browser. first method come the DOM0 specification and the second one is DOM2. The big difference is that the DOM0 event could only have ONE definition. But for the DOM2 event, you'll have the possibility to accept more than one definition. What I would recommend is to use the DOM2 event and I much more recommend using event delegation: instead of observing each element, just observe the parent and get the element on the the click is done. So you will have only one event, and you could remove or insert element, it will always handle event for all elements. -- david On 17 nov, 00:27, phegaro pheg...@gmail.com wrote: Hi all, I have an app that is going to put out a list of items onto a page and each one has a number of click targets. Now i could setup the event handler in one of two ways. 1. add it into the template that is rendered with the following code div onclick=doIt() id=item_1 class=itemItem Name 1/div or i could do the following 2. Add it using a selector and a script $$(.item).each(function(element){element.observe('click', doIt);}); Are there any issues with option 1 or 2 and which is more performant and cross browser compatible. I think 1 is more performant but not sure it works in all browsers. --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: IE8 Invalid argument @ setStyle function
Hi Mostafa, What line have an invalid argument ? And what is the function trying to do? means which style is trying to be modified ? -- david On 10 nov, 15:46, Mostafa ms.a...@gmail.com wrote: Hi, i have a problem when working with iGoogle style drag and drop portlets on ie8 my code runs with no problems on FF, Chrome, Safari and IE7 But on IE8 the widgets do not work when dropped and give the error Invalid argument.. i digged alot and knew that the problem is in the function setStyle [the else part] plz 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 to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Ajax.Updater + Sortable.Create = nothing?
Hi, I think that writing it this way will create the sortable at compilation time, not at execution, so the sortable is create before the update is (launch ?) finished. You should write it inside an anonymous function: Event.observe(window, 'load', function() { new Ajax.Updater('issue_order1', '/inc/modules/ issue_order.php? col=issue_order1', { parameters: { onComplete: function(){Sortable.create ('issue_order1') }} }); }); and that should work. I think, but I did not test it -- david On 13 nov, 20:29, Ian R i...@fairmountfair.com wrote: Hey all! I have 4 lists on a page, all if which are filled by an Ajax.Updater call. I want them to be Sortable. I have this code in my document HEAD: Event.observe(window, 'load', function() { new Ajax.Updater('issue_order1', '/inc/modules/issue_order.php? col=issue_order1', { parameters: { onComplete: Sortable.create('issue_order1') } }); }); ... of course I have 4 such calls which run at window load. But the lists aren't sortable. I assume this has something to do with them being updated, because if I disable the Ajax.Updater for a list, and just make it Sortable, it works fine. The docs say the onComplete callback runs at the very end of the Updater call, but replacing my Sortable.create call with an alert that happens onComplete shows that the list has yet to be updated and redrawn. Any ideas? Any help would be IMMENSELY appreciated. Ian --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Extending a class
Hi greg, try this: Object.extend(Form.Methods,{ unserialize: function(element, source) { if (!(element = $(element))) throw new Error('DOMElement is required'); source = Object.isString(source) ? source.toQueryParams() : source; element.getElements().each(function(element) { for (var name in source) { if (name == element.name) element.setValue(source[name]); } }) return element; } }); as you extend the Form.method, this method could not be used with the $ utility, but with the $F utility, so call it with: $F(form1).unserialize(form1,data) verify the syntax, this is not tested. If trouble, repost, I could do some test to set the correct syntax :)) - david On 13 nov, 00:31, greg g...@reservation-net.com wrote: Some kind soul out there has created a form unserialize method (below) that I would like to use. Being a newbie I can't figure out how to do that. My first kick at the can was Object.extend(Form.Methods, Form.Methods.unserialize); and to use it was: $(form1).unserialize(form1,data) but that didn't work. I've since tried various permutations and combinations of this, to no avail. I did get it to work by simply making it a function, but a method would be nicer. Can anyone point me in the right direction? Thank you! /** * Form#unserialize(@element, source) - Element * - @element(FormElement): Form element to fill with values * - source(Object | String): Source object where field values are taken from * * Fills form with values of a given object `source`. * Each propertie name of `source` is compared to name attribute of a form element. * * $('myForm').unserialize() * **/ Form.Methods.unserialize = function(element, source) { if (!(element = $(element))) throw new Error('DOMElement is required'); source = Object.isString(source) ? source.toQueryParams() : source; element.getElements().each(function(element) { for (var name in source) { if (name == element.name) element.setValue(source[name]); } }) return element; }; --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Draggable failing after first drag in Firefox?
Hi WoolyG, I'm sure that this code will work on FF 3.0.15. Do you have any error in firebug? You could try tpo dowload prototype 1.6.1 and scriptaculous 1.8.3 to test if it's work ? -- david On 16 nov, 10:22, woolyg woo...@gmail.com wrote: Hi all, I'm using: Scriptaculous 1.8.2 Prototype 1.6.0.3 Firefox 3.0.15 I'm stumped with this one. Using the following code within the BODY element: div id=drag_demo_1 style=width:80px; height:80px; cursor:move; background:#7baaed; border:1px solid #333;/div script type=text/javascript new Draggable('drag_demo_1'); /script I'm finding that in Firefox, the div drags fine on the first effort, but then upon the second effort, it remains stationary. In IE8, the div drags every time I attempt to use it. Aside from the standard HTML and calling the prototype scriptaculous JS files, this is the only code on the page, and it still fails! Stranger still, when I use FF to go tohttp://wiki.github.com/madrobby/scriptaculous/draggable and try the first draggable demo there, it works fine (though I am unsure as to which version of Prototype Scriptaculous MadRobby is using). Has anyone seen this before? Can anybody comment? All replies appreciated. Thanks WoolyG --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: instanting and reinstanting a function: Ajax.PeriodicalUpdater
Hi Bill, Isn't it just an Ajax.Request that you need, because the periodical executer is used 'generally' without the need of a user click. I mean, in your exemple, it's like you start at the begginning the periodical updater, and after it reload every time there is new message the target DIV. But in your case, it seems that the call is done only once on a uxer click. So just use AJAX.Request, and on click launch it. The only think you will do is to manually update the div with the result of the AJAX call. -- david On 15 nov, 15:36, bill will...@techservsys.com wrote: When the user clicks a link it executes this function: function fPendingMail() { //set the mail div to show document.getElementById (maildiv).style.display = block; new Ajax.PeriodicalUpdater('maildiv', 'mail/pending_mail.php', { method: 'get', frequency: 60, decay: 1 }); return false; //inhibit the href } and the maildiv appears and loads a list of pending mail messages and all is good. When they are done the script executes document.getElementById (maildiv).style.display = none; I know the div is still updating and I don't need it to so: 1) how do I stop the periodicalUpdater. 2) should I be de-instanting (whatver the correct verb is) the object so that when the user clicks the link again it will not just keep creating more instances of the Ajax.PeriodicalUpdater ? bill -- Bill Drescher william {at} TechServSys {dot} com --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Out Of Memory Error in IE7 and IE8
Hi Etha, I just have a thought ! Event.observe( window, 'unload', Event.unloadCache ); is outside the onload event. So If it's placed in the head tag, your not sure that the DOM is loaded at the time IE parse this line, and after testing, it throw an stack overflow in line 707 in IE6 (could not test in IE7/8. You should try to do set this line inside the load DOM event. -- david On 23 oct, 13:11, Alex McAuley webmas...@thecarmarketplace.com wrote: Its not prototype else it would happen to everyone. I asked for a pastebin of your page so we could see what else was being loaded and diagnose the problem. Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: Etha ev.distef...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, October 23, 2009 12:43 PM Subject: [Proto-Scripty] Re: Out Of Memory Error in IE7 and IE8 The problem is not in a singular web page but in each page where prototype.js is referenced, because i need to bind functions on different HTML elements dependending on their classes (for example, each HTML textfield element with class date needs to be validate and so on ... ) So I think it's useless show you the code of a web page ... I get an Out of memory in almost each page of my application ... :'( On 23 Ott, 13:27, Alex McAuley webmas...@thecarmarketplace.com wrote: can you pastebin your page... Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: Etha ev.distef...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, October 23, 2009 12:13 PM Subject: [Proto-Scripty] Re: Out Of Memory Error in IE7 and IE8 None can help me? On 22 Ott, 14:59, Etha ev.distef...@gmail.com wrote: Hi, I'm using prototype.js 1.6.1 and I get memory leaks on IE7/8 when loading prototype library. The first error I get is handler is null or not an object, then when i reload my page, i get out of memory error. I've tried to disable each js function using prototype.js, so the error occurs just when loading the web page with a link to prototype.js. Anyone of you had the same problem? Can you help me? It's very important. Thanks. --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Is there a way to write this differently?
Hi Patrick, You could do somethink like that: BuilderBox.buttons = { add_behavior: { '.some_class:click': function(element) { this.containerMorph(element); } }, containerMorph: function(element) { ... but in that case, you can't bind the function to the element. But is there a specific reason to create an object with methods and bind each method with something else than the object itself ?? Normally, an object create with method always refers to itself and you just give parameter to the called method. Perhaps, if you have a specific need, it need a specific notation. Explain a little bit more why you want another notation? -- david On 28 oct, 03:00, patrick patrick99...@gmail.com wrote: BuilderBox.buttons = { add_behavior: { '.some_class:click': function() { BuilderBox.buttons.containerMorph(this); } }, containerMorph: function(element) { ... I am wondering, is there is a way to not have to reference BuilderBox.buttons inside the function above? Since it's happening inside BuilderBox.buttons, I would like to reference it as this... but if I do .bind(this) to that function, then the this which references the element being clicked will be lost... Is there another way to do this? ? -patrick --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: $$ is a violation of Model-View-Controller
Hi all, I think $$ is not so good for the reason you give, but how about using the select() method?? you have one reference to the parent object and then you use CSS selector to find childrens. So when moving some pDOM art from a place to another, you just have to change the parent element to the new one, and that' all. -- david On 29 oct, 23:03, Rick.Wellman rick.well...@kiewit.com wrote: Though I consider javascript/prototype to be one of my weaker web app skills (which is why I like Prototype in the first place), I feel compelled to add to this discussion in that: While I certainly agree with the Use Case that you are describing (and the one referenced in the response) I guess I have been lucky enough to have never used $$() that way. However, I have used it (and will most likely continue to do so) to retrieve elements based on their CSS class selector. In fact, some of the page effects that I have been asked to implement rely on the use of $$(). So, IMHO, maybe it is better stated that $$() is part of the View in the MVC paradigm? Just like Struts is a Controller but many people use the Struts tags which are part of the View? -Original Message- From: prototype-scriptaculous@googlegroups.com [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of kangax Sent: Thursday, October 29, 2009 4:51 PM To: Prototype script.aculo.us Subject: [Proto-Scripty] Re: $$ is a violation of Model-View-Controller On Oct 29, 4:36 pm, JoJo tokyot...@gmail.com wrote: Is it poor practice to use $$? $$('#grandparent #parent tag.class'); I've been using $$ quite a lot because it has sped up DEVELOPMENT, but now I have realized that it will slow down MAINTENANCE. Recently, my boss asked me to move a whole div to another part of the page. Since I was accessing that div with $$, I was forced to change my JS along with my HTML. If I had accessed that div with $('elementID'), I would have only needed to edit my HTML. For this, I believe that $$ is a violation of the model-view- controller paradigm. HTML and CSS are the view. JS should be thought of as the controller. If you think about it, JS processes user input just like PHP, except on a livelier schedule. To make your website easier to implement, you should refrain from using $$ to describe the HTML structure. What are your thoughts? Yep. I came to the very same conclusion recently -http://stackoverflow.com/questions/1567496/jquery-anti-pattern-buildi... -- kangax --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Finding the Absolute Position of an Element
Hi Jonathan, Just a little precision, if the element is not inside any scrolled element, use like say alex the cumulativeOffset function but the doc is: http://api.prototypejs.org/dom/element.html#cumulativeoffset-class_method In case a parent element of the element you try to find position is scrolled, just use: http://api.prototypejs.org/dom/element.html#cumulativescrolloffset-class_method -- david On 30 oct, 08:17, Alex McAuley webmas...@thecarmarketplace.com wrote: http://www.prototypejs.org/api/element/cumulativeoffset Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: Jonathan Rosenberg j...@tabbysplace.org To: prototype-scriptaculous@googlegroups.com Sent: Friday, October 30, 2009 2:26 AM Subject: [Proto-Scripty] Finding the Absolute Position of an Element Seems like this should be easy, but I can't come up with a solution. What I want to do is to use Effect.Move to move an element to another element's position. Seems like I need to find the target element's absolute position to do this. So, how do I find an element's absolute position? Or is there another way to do what I want? -- Jonathan Rosenberg Founder Executive Director Tabby's Placehttp://www.tabbysplace.org --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Ajax.Updater Issue in IE - cache issue - Symfony + Prototype
Hi Avichal Garg, Is it a GET or a POST request, because IE (and OPERA) cache GET request. In Firebug, do you see the header you set when request is lauch from FF ? -- david On 28 oct, 08:54, Avichal Garg avic...@gmail.com wrote: Hi, I'm using Prototype 1.6.0.3. I spent a lot of time searching the net for solutions to this and found a few good suggestions/hints. The most relevant is the following, which talks about the exact problem I'm having:https://prototype.lighthouseapp.com/projects/8886/tickets/175-ajax-up... I have a page, sitting atwww.domain.com/folderwhich opens a popup. This popup then uses Ajax.Updater to update a div onwww.domain.com/folder (the parent/opening page). In FF this works fine. In IE it works the first time but not subsequent times. After the parent page is refreshed. I've tried setting the http headers in the indexSuccess module/actions/ actions.class.php as suggested herehttp://greenash.net.au/posts/thoughts/an-ie-ajax-gotcha-page-caching $this-getResponse()-setHttpHeader('Last-Modified', gmdate(D, d M Y H:i:s). GMT); $this-getResponse()-setHttpHeader('Cache-Control', 'no-store, no- cache, must-revalidate, post-check=0, pre-check=0'); $this-getResponse()-setHttpHeader('Pragma', 'no-cache'); This hasn't worked. I also noticed in the updateContent function in Ajax.Updater, there is a call: receiver.update(responseText); (line 1468 or so) The first time through, this call is executed and the resulting call is made to the IE specific update function on line 2449. The second time through, this function doesn't seem to get called at all. I also tried creating a unique URL for the ajax request by appending the current timestamp to the end ofwww.domain.com/folder?timestamp=12311312312. This creates two unique subsequent URLs for the Ajax.Updater call but the call to receiver.update still seems to fail. Does anyone have ideas on what is going on? Am I not setting my http headers in the right place? Thanks, Avichal --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Works in FF3 not IE8
Hi mjhaston, What works and what doesn't ?? Where do you have any trouble ?? What is the question ?? -- david On 28 oct, 20:59, mjhaston mich...@haston.name wrote: function ajaxRequest2(){ var url = /cgidev2p/r_chgpwd.pgm; var pars = 'v_current=' + escape($F('v_current')) + 'v_new=' + escape($F('v_new')) + 'v_confirm=' + escape($F('v_confirm')) + 'sessionid=' + escape($F('sessionid')); var submitObj = document.getElementById('goButton'); new Ajax.Request(url, { method: 'get', parameters: pars, onSuccess: function(transport){ var message = $('message'); if (!transport.responseText) { //alert('alert 1'); } else { if (transport.responseText == 'You may submit your change.') { v_messege.update(transport.responseText).setStyle({ background: '#dfd' }); submitObj.disabled = false; } else { v_messege.update(transport.responseText).setStyle({ background: '#fdd' }); submitObj.disabled = true; } } } }); } --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: DragDrop performances
Hi Mattia, it seems that you can't do what you're actually doing, prototype could not be able to correct IE lack of speed. But what do you want to do exactly ? So that we could (if we find something of course) give you some other idea ;)) -- david On 29 oct, 10:29, Mattia Locatelli mattia.locatelli...@gmail.com wrote: Hi all, I make some tests, and I see the performance problem I have happen when the table is bigger than the window and so I have the scrollbars (I set the option scroll: window on my draggable but also without i have the same performance issue). I see the prepare function takes a lot fo time to run, I suppose the bottleneck is getting the coordinates from the browser. If anyone have any idea on how to solve this problem please post... Thanks in advance Mattia 2009/10/28 Mattia Locatelli mattia.locatelli...@gmail.com Hi all, I look with the IE8 profiler and I see the updateDrag function in IE8 takes in my page 456ms and in the IE7 compatibility mode 15 ms. I think there is soem problems with the recursive execution of this function. Thanks, Mattia 2009/10/28 Mattia Locatelli mattia.locatelli...@gmail.com Hi, I don't have any droppable on the table or anywhere in the page. There is just one draggable element and no droppables. Like in the online sample. The code to create the draggable element is this : var draggable = new Draggable(objId, { scroll: window }); Well, I think I found something: I develop with IE8 and when I use the compatibility mode for IE7 the drag drop work pretty well. But if I use the IE8 engine is really bad. Maybe is a problem with the IE8 engine... 2009/10/28 Peter De Berdt peter.de.be...@pandora.be On 28 Oct 2009, at 14:36, MattiaLocatelli wrote: I'm experiencing a performance problem with drag and drop. I drag an image on an html table. I have only one draggable element (the image) and the problem is that until the table is not big in size (let's say 7 columns and 30 rows) the drag effect is very smooth, but when the size of the table is bigger the performance of the drag operation is very rough. I'm testing it in IE8. Any idea is welcome. You're quite vague, but I'm suspecting you have a droppable on every table cell. What you'll need to do, is make the table itself a droppable (only one) and the use the drop coordinates to find out on what cell the draggable was dropped. Best regards Peter De Berdt --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Toggle_Blind quesiton
Hi Joseph, Normally, just set the display:none to the element to toggle. But IN the style property of the element ! -- david On 26 oct, 23:48, Joseph DelCioppio jdelciop...@gmail.com wrote: Just a quick question about using toggle_blind, since it would be much easier then writing my own js code to do this. Can I set a parameter to get toggle_blind to have the element started in the blind_up state as opposed to the blind_down state? Joe --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Is stopObserving necessary?
Hi Simon, you should use event delmeguation so that, you first only set one observer, and then you can freely modify the DOM and still access to your event. -- david On 27 oct, 09:55, T.J. Crowder t...@crowdersoftware.com wrote: Hi Simon, ...do I need to stopObserving those events before replacing the elements. Yes, otherwise a variety of things do indeed sit around in memory. HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Oct 26, 7:07 pm, Simon simon.hagst...@gmail.com wrote: If I observe events on elements that I later replace with new elements with innerHTML, do I need to stopObserving those events before replacing the elements. I guess I'm mostly concerned about memory leakage. E.g: div id=inputs input type=text name=input1 / ... input type=text name=input100 / /div $('inputs').select('input').invoke('observe', 'blur', function() {...}); $('inputs').innerHTML = 'input type=text name=input101 / ... input type=text name=input200 /'; $('inputs').select('input').invoke('observe', 'blur', function() {...}); Thanks Simon --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: mouseenter mouseleave: tooltip not hiding
Hi Kupido, When writting: Event.observe(element, 'mouseenter', mouseEnter.bindAsEventListener (element)); When writting bindAsEventListener, it means that your binded function will have its scope set to element. So your called fiunction should be: function mouseEnter(event) { this.setStyle('color:blue'); //just an exemple of a call to an element method. } In your writting, there is an element argument. If you use it, I'm not sure it works. Btw, if you can post your whole code, it could help us. -- david On 30 oct, 10:51, Kupido kup...@hotmail.com wrote: Hi all, I have a page with some boxes placed side by side. When the user moves over one of them a tooltip appears, then it should disappear when the user moves out or moves over another box. I use the mouseenter and mouseleave events to do this but sometimes, when the user moves quickly on the boxes, some tooltips don't hide. I can see even more than one tooltip at the same time and they won't disappear until the boxes are hovered again. It's like the mouseleave event is not triggered, but if I put an alert in it I see it gets triggered. The code is the following: $('boxes').select('.box').each( function (element) { Event.observe(element, 'mouseenter', mouseEnter.bindAsEventListener (element)); Event.observe(element, 'mouseleave', mouseLeave.bindAsEventListener (element)); } ); function mouseEnter(event, element) { ... } function mouseLeave(event, element) { ... } What am I doing wrong? Any help would be appreciated, thanks in advance. --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Is stopObserving necessary?
Good catch Peter, my explanation was lacking ... explanation :)) btw, NWEvent is impressive, like NWMatcher: http://javascript.nwbox.com/NWMatcher/ I recommand using both ! -- david On 30 oct, 11:11, Peter De Berdt peter.de.be...@pandora.be wrote: Event delegation is indeed a wonderful thing. One thing to watch out for here though is that input blur, focus and form submit don't bubble (don't know if it's on all browsers, but certainly on some). There's NWEvents (http://javascript.nwbox.com/NWEvents/) that handles those special cases for you. We've used it to create a totally transparent (no initialization necessary) form validator. No need to observe forms, works with newly inserted ajax forms, no need to stop observing and only one observer, no matter how many form elements you have on the page, simply nothing to worry about anymore. On 30 Oct 2009, at 10:39, david wrote: you should use event delmeguation so that, you first only set one observer, and then you can freely modify the DOM and still access to your event. -- david On 27 oct, 09:55, T.J. Crowder t...@crowdersoftware.com wrote: Hi Simon, Yes, otherwise a variety of things do indeed sit around in memory. On Oct 26, 7:07 pm, Simon simon.hagst...@gmail.com wrote: If I observe events on elements that I later replace with new elements with innerHTML, do I need to stopObserving those events before replacing the elements. I guess I'm mostly concerned about memory leakage. E.g: div id=inputs input type=text name=input1 / ... input type=text name=input100 / /div $('inputs').select('input').invoke('observe', 'blur', function() {...}); $('inputs').innerHTML = 'input type=text name=input101 / ... input type=text name=input200 /'; $('inputs').select('input').invoke('observe', 'blur', function() Best regards Peter De Berdt --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: mouseenter mouseleave: tooltip not hiding
Hi Kupido, the mouseleave event is a hide which set display property to none; And the mouseenter event is an appear, which set opacity from 0 to 1. So when the element is hide, there is no way to appear again, because they don't change the same property. This could explain why event is still triggered, but you'll see nothing. One note about using event on mouseeneter/mouseleave (like mouseover/ mouseout): you 'll need to save the effect in execution so if you want to launch the opposite effect and the executed effect is not finished, you could cancel() executing effect and after launch the opposite (new) effect. Otherwise it will flicker ! -- david On 30 oct, 12:18, Kupido kup...@hotmail.com wrote: After some testing I noticed the problem only occurs when I use: tooltip.appear(); // scriptaculous effect instead of: tooltip.show(); Any suggestions? On Oct 30, 11:37 am, Kupido kup...@hotmail.com wrote: Hi david, thank you for your reply. The element argument in my previous post was a copy/paste error, here's a simplified working version of my code: function init() { var boxes = $('boxes'); boxes.select('.box').each( function (box) { Event.observe(box, 'mouseenter', mouseEnter.bindAsEventListener (box, box.down('.tooltip'))); Event.observe(box, 'mouseleave', mouseLeave.bindAsEventListener (boxes)); } ); function mouseEnter(event, tooltip) { if (!tooltip.visible()) { tooltip.setStyle({ top: (this.positionedOffset().top + this.getHeight() + 10) + 'px', left: (this.positionedOffset().left) + 'px' }); tooltip.show(); } } function mouseLeave(event) { this.select('.tooltip').invoke('hide'); } } document.observe('dom:loaded', function () { init(); }); On Oct 30, 11:03 am, david david.brill...@gmail.com wrote: Hi Kupido, When writting: Event.observe(element, 'mouseenter', mouseEnter.bindAsEventListener (element)); When writting bindAsEventListener, it means that your binded function will have its scope set to element. So your called fiunction should be: function mouseEnter(event) { this.setStyle('color:blue'); //just an exemple of a call to an element method. } In your writting, there is an element argument. If you use it, I'm not sure it works. Btw, if you can post your whole code, it could help us. -- david On 30 oct, 10:51, Kupido kup...@hotmail.com wrote: Hi all, I have a page with some boxes placed side by side. When the user moves over one of them a tooltip appears, then it should disappear when the user moves out or moves over another box. I use the mouseenter and mouseleave events to do this but sometimes, when the user moves quickly on the boxes, some tooltips don't hide. I can see even more than one tooltip at the same time and they won't disappear until the boxes are hovered again. It's like the mouseleave event is not triggered, but if I put an alert in it I see it gets triggered. The code is the following: $('boxes').select('.box').each( function (element) { Event.observe(element, 'mouseenter', mouseEnter.bindAsEventListener (element)); Event.observe(element, 'mouseleave', mouseLeave.bindAsEventListener (element)); } ); function mouseEnter(event, element) { ... } function mouseLeave(event, element) { ... } What am I doing wrong? Any help would be appreciated, thanks in advance. --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: mouseenter mouseleave: tooltip not hiding
Hi Kupido, This is a good way to do this. Just a suggestion, if the tooltip appear, let it des-appear sloowly too. so don't just hide() it, but do an effect to do this :)) -- david On 30 oct, 12:58, Kupido kup...@hotmail.com wrote: I think I solved the problem using effect queues, this is the new code: function init() { var boxes = $('boxes'); boxes.select('.box').each( function (box) { var tooltip = box.down('.tooltip'); Event.observe(box, 'mouseenter', mouseEnter.bindAsEventListener (box, tooltip)); Event.observe(box, 'mouseleave', mouseLeave.bindAsEventListener (box, tooltip)); } ); function mouseEnter(event, tooltip) { if (!tooltip.visible()) { tooltip.setStyle({ top: (this.positionedOffset().top + this.getHeight() - 20) + 'px', left: (this.positionedOffset().left + parseInt(this.getWidth() / 2)) + 'px' }); tooltip.appear({ duration: 0.2, to: 0.8, queue: { position: 'end', scope: 'boxes-scope', limit: 1 }}); } } function mouseLeave(event, tooltip) { Effect.Queues.get('boxes-scope').invoke('cancel'); tooltip.hide(); } } document.observe('dom:loaded', function () { init(); }); Comments and suggestions are welcome! On Oct 30, 12:18 pm, Kupido kup...@hotmail.com wrote: After some testing I noticed the problem only occurs when I use: tooltip.appear(); // scriptaculous effect instead of: tooltip.show(); Any suggestions? On Oct 30, 11:37 am, Kupido kup...@hotmail.com wrote: Hi david, thank you for your reply. The element argument in my previous post was a copy/paste error, here's a simplified working version of my code: function init() { var boxes = $('boxes'); boxes.select('.box').each( function (box) { Event.observe(box, 'mouseenter', mouseEnter.bindAsEventListener (box, box.down('.tooltip'))); Event.observe(box, 'mouseleave', mouseLeave.bindAsEventListener (boxes)); } ); function mouseEnter(event, tooltip) { if (!tooltip.visible()) { tooltip.setStyle({ top: (this.positionedOffset().top + this.getHeight() + 10) + 'px', left: (this.positionedOffset().left) + 'px' }); tooltip.show(); } } function mouseLeave(event) { this.select('.tooltip').invoke('hide'); } } document.observe('dom:loaded', function () { init(); }); On Oct 30, 11:03 am, david david.brill...@gmail.com wrote: Hi Kupido, When writting: Event.observe(element, 'mouseenter', mouseEnter.bindAsEventListener (element)); When writting bindAsEventListener, it means that your binded function will have its scope set to element. So your called fiunction should be: function mouseEnter(event) { this.setStyle('color:blue'); //just an exemple of a call to an element method. } In your writting, there is an element argument. If you use it, I'm not sure it works. Btw, if you can post your whole code, it could help us. -- david On 30 oct, 10:51, Kupido kup...@hotmail.com wrote: Hi all, I have a page with some boxes placed side by side. When the user moves over one of them a tooltip appears, then it should disappear when the user moves out or moves over another box. I use the mouseenter and mouseleave events to do this but sometimes, when the user moves quickly on the boxes, some tooltips don't hide. I can see even more than one tooltip at the same time and they won't disappear until the boxes are hovered again. It's like the mouseleave event is not triggered, but if I put an alert in it I see it gets triggered. The code is the following: $('boxes').select('.box').each( function (element) { Event.observe(element, 'mouseenter', mouseEnter.bindAsEventListener (element)); Event.observe(element, 'mouseleave', mouseLeave.bindAsEventListener (element)); } ); function mouseEnter(event, element) { ... } function mouseLeave(event, element) { ... } What am I doing wrong? Any help would
[Proto-Scripty] Re: onComplete functions firing after HTTP/1.1 connection closed
Hi Matthew, I think it is a bug, so open a ticket at lighthouse: http://prototype.lighthouseapp.com/projects/8886-prototype/tickets/new -- david On 25 oct, 19:45, matt...@bytemark.co.uk matt...@bytemark.co.uk wrote: I'm trying to use Prototype to do some basic Ajaxy things for the first time in ages, and have run into a problem that I've seen reported before, but with no replies: http://groups.google.com/group/prototype-scriptaculous/browse_thread/... I have a function like this to send an async request back to the server (in my case Ruby+Rack+Sinatra, and I'm testing with Firefox 3.5 and whatever the current Linux Chrome build is): function toggleAcknowledge(id) { updater = new Ajax.Request('/alert/'+id+'/acknowledge', { method:'post', onSuccess: function(response) { alert(Success); }, onComplete: function(response) { alert(Complete); } }); }; I've found that when the Updater method is set to 'post', the onSuccess and onComplete functions fire after 30 seconds, rather than when the request has completed (which is pretty much instantly). This obviously means updates won't happen to my page etc. It seems that the 30 second delay corresponds to the HTTP/1.1 connection being closed; while the connection is open but the request complete, the callbacks don't fire. If I change the method to 'get' I don't see this problem. Would appreciate some prototype veterans' ideas on how to fix / work around it - my first instinct was to ask the browser to use HTTP/1.0 but I assume this is a bit too low-level - any better ideas on how to handle it? Thanks, -- Matthew --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: replace_html with javascript or rjs after ajax call
Hi Dave, I think that a mix of both is good. First, observe the icon with javascript. Then when it is clicked (or whatever), launch an Ajax.Request to the server to update the database, and set something to say to the user that something is launch in the background. When the request is Complete, use Ajax.Request onComplete callback to modify HTML. Use others callbacks in case of error. So that, the HTML is set only when the database is modified! -- david. On 13 oct, 23:17, Dave L dly...@gmail.com wrote: I'm not sure what is best practice in this situation. I have a quiz add icon that, when clicked, adds an element to a quiz list. Right now it is using a link_to_remote with an image_tag (in ruby rails) and when clicked it hits the server, saves the quiz add/remove toggle and then uses rjs to change the icon. It seems that it would be faster to use straight javascript to observe the icon and then when clicked change the icon and create an ajax.request to run in the background to save the add/remove toggle to the database. Would this be better? I know it would seem faster to the user, but maybe it is good to make the user wait until the save to the database / ajax.request call is completed? That way it would prevent the user from clicking the icon rapidly and creating a number of ajax.requests in a row. Any input is appreciated, Dave --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Moving Draggable object outside div with overflow hidden
Hi Shyam Kadhka, One solution could be to clone the dragged element to a newer element before start of drag, but it not standard and would make you modify a lot standard code. Another solution could be to duplicate the overfloaw hidden element. The new element will not have overflow hidden, but be transparent. The dragging element could be inside this new element. Juste make sure to clonePosition to have exactly the same positionning (but your HTML code should accept that). -- david On 14 oct, 13:20, shyam khadka shyamkkha...@gmail.com wrote: I want to move scriptaculous draggable object outside of its parent div which has its CSS set as overflow:hidden. I set z-index of the dragged element to be higher than that of droppable container(which is outside of draggable container div). Problem is that when i move dragged object outside of draggable container to drop into droppable container, element becomes invisible. How can i make dragged elements to be visible without changing overflow:hidden ? Please give me suggestion --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: unable to drag elements from a scrolling div into another div
Hi converging rails, You should set the Position.includeScrollOffsets to true so when calculating the position of the element it take care of the scroll ofset. -- david On 17 oct, 14:15, converging rails bagam.ven...@gmail.com wrote: Hi all, I have 2 divs photos and albums. The albums is a scrollable div with overflow:auto to accomodate any no.of photos in it. These photos should be dragged into one of the albums in the album div. Multiple photos can be dragged into an album at a time. Now my problem is when I try to drag a photo onto an album contained in albums div, my phoots div scrolls along with the photo thus making it impossible to drag the photo into the albums. This is a recurrent issue on many forums but no finite solution is found. Any help appreciated.An example would be even more helpful. --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Out Of Memory Error in IE7 and IE8
Hi Etha, please send you HTML code to load prototype. There is no reason that it does such a thing. -- david On 23 oct, 13:27, Alex McAuley webmas...@thecarmarketplace.com wrote: can you pastebin your page... Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: Etha ev.distef...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, October 23, 2009 12:13 PM Subject: [Proto-Scripty] Re: Out Of Memory Error in IE7 and IE8 None can help me? On 22 Ott, 14:59, Etha ev.distef...@gmail.com wrote: Hi, I'm using prototype.js 1.6.1 and I get memory leaks on IE7/8 when loading prototype library. The first error I get is handler is null or not an object, then when i reload my page, i get out of memory error. I've tried to disable each js function using prototype.js, so the error occurs just when loading the web page with a link to prototype.js. Anyone of you had the same problem? Can you help me? It's very important. Thanks. --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Out Of Memory Error in IE7 and IE8
Hi Etha, didn't you think that you have done the error. ;)) I'm sure that the core team have tested prototype on IE7/8 . And If we were just after the release date that could be possible option (even if I doubt). But today, 2 month after the official release date ? I'm sure that some other guy have does some test with IE (I'm one of them !) But of course we could also be wrong ;)) -- david On 23 oct, 13:43, Etha ev.distef...@gmail.com wrote: The problem is not in a singular web page but in each page where prototype.js is referenced, because i need to bind functions on different HTML elements dependending on their classes (for example, each HTML textfield element with class date needs to be validate and so on ... ) So I think it's useless show you the code of a web page ... I get an Out of memory in almost each page of my application ... :'( On 23 Ott, 13:27, Alex McAuley webmas...@thecarmarketplace.com wrote: can you pastebin your page... Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: Etha ev.distef...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, October 23, 2009 12:13 PM Subject: [Proto-Scripty] Re: Out Of Memory Error in IE7 and IE8 None can help me? On 22 Ott, 14:59, Etha ev.distef...@gmail.com wrote: Hi, I'm using prototype.js 1.6.1 and I get memory leaks on IE7/8 when loading prototype library. The first error I get is handler is null or not an object, then when i reload my page, i get out of memory error. I've tried to disable each js function using prototype.js, so the error occurs just when loading the web page with a link to prototype.js. Anyone of you had the same problem? Can you help me? It's very important. Thanks. --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Depreciation of Array#reduce
Hi Christophe, Effectivelly, this method is supress in v1.6.1. To have the reason, try the prototype core GG groups. You can add it yourself: Object.extend(Array.prototype,{ reduce: function(){ return this.length 1 ? this : this[0]; } }); I did not try, but there is no reason it did not work. -- david On 15 oct, 20:37, Christophe cdebuss...@gmail.com wrote: Hi, I have seen that in the new version of prototype, the Array#reduce was removed. Is there another way to do the same ? Thx for your help ! Christophe --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: nested json posting using Ajax.updater
Hi Kashyap, I think that {} could not be serialized in URL. You have to do it yourself. Try to serialize details sepratly. I know it's not simple sometime, but I did not see other way to do it. Peehaps someone will have a good idea? -- david On 15 oct, 17:16, kashyap ckkash...@gmail.com wrote: Hi all, How can I post a nested json string using Updater - var param={ name: abc, details: {d1: xxx, d2: yyy}, id: 10} new Ajax.Updater( '#{options[:update_html_id]}', '#{options[:update_url]}'+id, { asynchronous:true, evalScripts:true, parameters: param } ); This seems to ignore the details key in the param hash! How can I make updater send all the details? Regards, Kashyap --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: select elements
Hi clickforward, I do this simple test, and seems to have what expected I hope :)) here is the code: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titleDraggables/title script type=text/javascript src=prototype.js/script script type=text/javascript src=scriptaculous.js? load=effects,dragdrop/script style type=text/css .highlight{ background-color:yellow; } .highlight2{ background-color:pink; } /style /head body ul id=options-10-list class=options-list li input id=options_10_2 class=radio type=radio value=15/ span class=label label for=options_10_2Bodoni/label /span /li li input id=options_10_3 class=radio type=radio value=15/ span class=label label for=options_10_3test2/label /span /li li input id=options_10_4 class=radio type=radio value=15/ span class=label label for=options_10_4david/label /span /li /ul script type=text/javascript $('options-10-list').select('[for=options_10_2]').each(function(e) { console.log(e); e.addClassName('highlight'); }); $('options-10-list').select('[for!=options_10_2]').each(function(e) { console.log(e); e.addClassName('highlight2'); }); /script /body /html hope that help... -- david On 9 oct, 13:51, clicforw...@googlemail.com clicforw...@googlemail.com wrote: Hi David, this is the code. I think the DOM is generated by Ajax. Maybe this couse the Prob!? Thanks for Help. ul id=options-10-list class=options-list li input id=options_10_2 class=radio type=radio value=15/ span class=label label for=options_10_2Bodoni/label /span /li /ul On 9 Okt., 12:43, david david.brill...@gmail.com wrote: Hi clickforward, could you please send the HTML code with the js code, because I can't catch what is option-10-list, form element or list element ?? -- david On 8 oct, 19:28, speedpac...@gmail.com speedpac...@gmail.com wrote: I guess the thread I started may help you: http://groups.google.com/group/prototype-scriptaculous/browse_thread/... On Oct 8, 1:01 pm, clicforw...@googlemail.com clicforw...@googlemail.com wrote: Hello anyone, i try to select a label for=options_10_2 like this: $('options-10-list').select('[for=options_10_2!]').each(function(e) { e.addClassName('highlight'); }); or this: $('options-10-list').down(3).each(function(e) { e.addClassName('highlight'); }); But its doing nothing. What wrong on this snippets? Thanks for 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 to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Major frustrations with Effect.Morph
Hi Alex, I'm sorry, I did not understand your problem. I use it with margin and it seems to work and define all margin with the specified length. -- david On 11 oct, 09:41, Alex McAuley webmas...@thecarmarketplace.com wrote: from reading the docs Effect.morph excpects a style string using camelised case I am not sure that css.padding=50px; will work as it expects a string for example {style: 'padding:50px; margin:10px;', duration: 2.0} HTH Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: patrick patrick99...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Sunday, October 11, 2009 4:05 AM Subject: [Proto-Scripty] Major frustrations with Effect.Morph Ok, so I can't seem to win... It appears to me that Effect.Morph is full of bugs. I have been trying my hardest to get morph to work with padding-- and it doesn't behave properly... document.observe('dom:loaded', function() { $$('input.sort_children').invoke('observe', 'click', function() { var css = {}; var children = this.next('div').immediateDescendants(); // this selects an array of divs // toggle the button state if (this.getValue().toLowerCase() == sort) { this.value = done; css.padding = 0px; } else { this.value = sort; css.padding = 50px; } children.each(function(e){ new Effect.Morph(e, {style: css, duration: .5}); }); }); }); when I click my sort button, I immediately see it change to done but nothing happens.. I click it again.. it goes back to sort.. nothing happens.. I click it a 3rd time, and suddenly the padding morph happens. I then tried using css = 'classname1' and css = 'classname2'... Then when I clicked it, it would set the padding to 0 properly and morph it... but when i'd click it a 2nd time, it would do something weird that look like it set the padding to 5 and then it dropped down to 0 again... ... I also was trying to set the display properties from 'inline- block' to 'block'.. and that did not work at all either when I was using my css = {} hash/object... When I tried using it with classnames, similarly to padding, it only seemed to partially work. Then I changed my css = {} hash/object to just deal with borders: if (this.getValue().toLowerCase() == sort) { this.value = done; css.border = 1px solid red; } else { this.value = sort; css.border = 5px dotted blue; } ... this works fine.. so, it appears that Morph can't handle certain css properties. .. Oh and of course, if I change my: children.each(function(e){ new Effect.Morph(e, {style: css, duration: .5}); }); to: children.invoke('setStyle', css); then all of my changes are exactly as they should be-- but I really wanted to have some animation. -patrick --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Focus and Blur in IE / Webkit
Hi Alex, I perhaps did not understand what is your trouble, but interrest in the solution you achieve, and perhaps some idea could come ... -- david On 9 oct, 13:46, Alex McAuley webmas...@thecarmarketplace.com wrote: I suppose what i am asking for is a prototype cross browser way of detecting what element was clicked when a blur event occurs ... Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: Alex McAuley webmas...@thecarmarketplace.com To: prototype-scriptaculous@googlegroups.com Sent: Friday, October 09, 2009 12:44 PM Subject: [Proto-Scripty] Re: Focus and Blur in IE / Webkit I think i have a way to do it but it involves watching the whole document for a click which i didnt really want to do. Alex Mcauley http://www.thevacancymarket.com - Original Message - From: david david.brill...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, October 09, 2009 12:33 PM Subject: [Proto-Scripty] Re: Focus and Blur in IE / Webkit alex, I was saying a mix of both evens. For functionnality that work, just use focus/blur, and for the one that don't work, help it with mouseover / out ? Or I peerhaps miss something? A live example ?? -- david On 9 oct, 13:21, Alex McAuley webmas...@thecarmarketplace.com wrote: Hi David. It promotes the same problem though .. If i listen for mouseover/mouseout on the element once the mouse goes out of it then it will hide the results element anyway!.. Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: david david.brill...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, October 09, 2009 12:18 PM Subject: [Proto-Scripty] Re: Focus and Blur in IE / Webkit Hi alex, If I have understand, you could mix the focus/blur with a mouseover/ mouseout even, because when you receive focus, and scroll, you are during a mouseover, and when not over, northing has to be done. Or somethink like that ? Does it gives you idea ? -- david On 9 oct, 12:58, Alex Mcauley webmas...@thecarmarketplace.com wrote: Morning people. Got a slight issue with IE and focus / blur. I have a suggestive searchbox that observes keyup and does its thing... This all works fine. There is a height with overflow:auto on it to allow users to scroll through multiple results to find the correct result and be able to select it. I have just added a(n) observer for focus / blur of the input element that hides the results element on blur and shows them on re-focus of the element. This all works fine in firefox but does not work in webkit/IE.. It works as much as blurring and focusing does hide the element but if i try to scroll down the Results element it sees the focus is lost and hides it!.. What i am trying to replicate is to see what is being focussed / pressed when this is occuring and if its the Results element then to not show or hide the Results element. Hope i explained that well and i am sure someone has come across this before. All relevant help appreciated Alex --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Major frustrations with Effect.Morph
Sorry Alex, did not see next thread with the same name, it seems to be the following of it. -- david On 12 oct, 11:25, david david.brill...@gmail.com wrote: Hi Alex, I'm sorry, I did not understand your problem. I use it with margin and it seems to work and define all margin with the specified length. -- david On 11 oct, 09:41, Alex McAuley webmas...@thecarmarketplace.com wrote: from reading the docs Effect.morph excpects a style string using camelised case I am not sure that css.padding=50px; will work as it expects a string for example {style: 'padding:50px; margin:10px;', duration: 2.0} HTH Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: patrick patrick99...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Sunday, October 11, 2009 4:05 AM Subject: [Proto-Scripty] Major frustrations with Effect.Morph Ok, so I can't seem to win... It appears to me that Effect.Morph is full of bugs. I have been trying my hardest to get morph to work with padding-- and it doesn't behave properly... document.observe('dom:loaded', function() { $$('input.sort_children').invoke('observe', 'click', function() { var css = {}; var children = this.next('div').immediateDescendants(); // this selects an array of divs // toggle the button state if (this.getValue().toLowerCase() == sort) { this.value = done; css.padding = 0px; } else { this.value = sort; css.padding = 50px; } children.each(function(e){ new Effect.Morph(e, {style: css, duration: .5}); }); }); }); when I click my sort button, I immediately see it change to done but nothing happens.. I click it again.. it goes back to sort.. nothing happens.. I click it a 3rd time, and suddenly the padding morph happens. I then tried using css = 'classname1' and css = 'classname2'... Then when I clicked it, it would set the padding to 0 properly and morph it... but when i'd click it a 2nd time, it would do something weird that look like it set the padding to 5 and then it dropped down to 0 again... ... I also was trying to set the display properties from 'inline- block' to 'block'.. and that did not work at all either when I was using my css = {} hash/object... When I tried using it with classnames, similarly to padding, it only seemed to partially work. Then I changed my css = {} hash/object to just deal with borders: if (this.getValue().toLowerCase() == sort) { this.value = done; css.border = 1px solid red; } else { this.value = sort; css.border = 5px dotted blue; } ... this works fine.. so, it appears that Morph can't handle certain css properties. .. Oh and of course, if I change my: children.each(function(e){ new Effect.Morph(e, {style: css, duration: .5}); }); to: children.invoke('setStyle', css); then all of my changes are exactly as they should be-- but I really wanted to have some animation. -patrick --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Limit in parameter lenght at Ajax.Request?
Hi Frank, there is a limit if the request is GET. This limit is around 2500 char (don't remember the exact length). This is a browser limitation, not prototype one. But in case you are in a POST request, there should have no limitation ! Couls you send us more info on this problem, like the code, an exemple of data that don't work, and if possible, a live example. -- david On 8 oct, 13:51, OscarWilde mert...@netzklusiv.de wrote: Hi all, I'm trying to send the text from a textarea via the Ajax.Request Method to my PHP-Script. If the lenght of the text in the textarea exceeds 6000 characters it seems not to work. Is there a limit somewhere? I can't find anything about that in the API Doc. Thanks for any help! Frank --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---