[Proto-Scripty] Help Needed !
i am a newbee to this prototype thing and i am trying to use a Class.create() in an example, but i am not able to figure how to use the classes and their functions. Can anyone here send me a complete working example, which involves creating a class, writing functions in that class, subclassing that class, extending the class and calling all the functions. though there are many examples on the web, i cudnt find a COMPLETE WORKING example. any help would be deeply appreciated thanks sid --~--~-~--~~~---~--~~ 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] Element.update when an object's toElement method returns DocumentFragment
I recently discovered that Element.update/insert automatically call an object's toElement method if it exists, which would be pretty handy...except that when a DocumentFragment is returned, it inserts [ object DocumentFragment ]. Is there any reason this shouldn't work? It seems that if you're calling a method to return the contents of a containing element, it'd be MORE likely that you'd need to return a collection of elements rather than a single element, and the way to do that is by returning a DocumentFragment object. --~--~-~--~~~---~--~~ 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] Ajax.Updater Issue in IE - cache issue - Symfony + Prototype
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-updater-not-working-correctly-under-ie-opera I have a page, sitting at www.domain.com/folder which opens a popup. This popup then uses Ajax.Updater to update a div on www.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 here http://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 of www.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] Object Oriented Prototype This keyword Advices
Hi all, I have been using a js library first time, so please forgive me If I ask something very fool. Actually my objective is implementing a reusable component for 1. Returning photo links with AJAX 2. And with the help of back and forward button it should change next or previous photo link. But now I have a problem in my back and forward functions. Since I could not reach images variable in back and forward function scope. (Actually I successfully implemented but I am not sure it is best practice ) Ok, How should Implement such a functionality please? document.observe(dom:loaded, function() { var Chooser = Class.create({ initialize: function(images, backElement, forwardElement) { this.images = images; / Event.observe(backElement, 'click', this.back); Event.observe(forwardElement, 'click', this.forward); / console.log('Chooser initialized'); }, back: function() { // Problem is here console.log(this.images); }, forward: function() { // Problem is here console.log(this.images); } }); var baseUrl = '/j/advertisementAjaxAction.action'; myAjax = new Ajax.Request(baseUrl, { method: get, onSuccess : function(transport) { //console.log(transport.responseText); data = transport.responseText.evalJSON(); new Chooser(data.photos, $('init_back'), $ ('init_forward')); }, onFailure : function() { //todo set error } } ); }) --~--~-~--~~~---~--~~ 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: Help Needed !
Hi, ...i cudnt find a COMPLETE WORKING example. The API docs for Class[1] have one (an Animal class and a Snake class that derives from it), but ignore the links they have to the tutorial on classes and inheritance, it's out of date and misleading if you're using version 1.6. [1] http://api.prototypejs.org/language/class.html HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Oct 28, 1:37 pm, Siddhartha sidv...@gmail.com wrote: i am a newbee to this prototype thing and i am trying to use a Class.create() in an example, but i am not able to figure how to use the classes and their functions. Can anyone here send me a complete working example, which involves creating a class, writing functions in that class, subclassing that class, extending the class and calling all the functions. though there are many examples on the web, i cudnt find a COMPLETE WORKING example. any help would be deeply appreciated thanks sid --~--~-~--~~~---~--~~ 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: New API Doc
Big block of text that's probably useful, but I want a list of methods that's quick and easy, and always one of the first things I see. Good point. JavaDoc has the same problem and it's bothered me for years. We want there to be robust class-level information; but the index of methods should be readily accessible, not pushed down by the class overview. -- T.J. On Oct 28, 6:15 pm, Adm.Wiggin admwig...@gmail.com wrote: A good example of badness in the new API is the page for the Array class. http://api.prototypejs.org/language/array.html Big block of text that's probably useful, but I want a list of methods that's quick and easy, and always one of the first things I see. On Oct 27, 5:29 pm, Adm.Wiggin admwig...@gmail.com wrote: How's this going? Very much interested in Going back to page-per- method (rather than a long run-on page). Having the side navigation easy to navigate in the page-per-method style like the old documentation is also of paramount importance. For example, if I click on Hash in the sidebar, I should immediately see an easy to read list of all the methods of the Hash class. As it is, they're in a big block, which is hard to scan through, where the vertical (alphabetical) list was quick and relatively painless. Lots of times, I'm just looking to verify the order of parameters, and it was very helpful to be able to find the exact method very quickly so that in almost no time I'm looking at the page reading the order of the methods. Something else that might be handy way further down the road is an easy way to access these pages by-url. For example, if I need to look up a PHP function to very the argument order, it's as easy as typing inhttp://php.net/function_name_here-- concrete example being stripos (is it haystack first, or needle first? I never can remember)http://php.net/striposandI'm there immediately. Obviously way down the road, but certainly something to think about. On Oct 9, 3:56 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, You're not the only one, not by a long chalk. :-) We're working on it. Tobie, Samuel, and Andrew are working hard to improve the structure, navigation, and presentation, and I'm continuing the ongoing quest of copying over, updating, and fleshing- out the content (which is a manual and labor-intensive process). You should see marked improvemenet in the online docs over the course of the next couple of weeks. What happened is that the project switched from having the documentation be a completely separate thing (in a difficult-to-use tool) to having the documentation be part of the source code (a'la Javadoc), using a new tool built for the purpose called PDoc. That way, when someone changes or adds code, they can update the documentation at the same time, and hopefully the two will be kept much more in sync. (The official policy, in fact, is that code patches with documentation impacts that don't include the documentation updates are rejected.) It also simplifies the process of people reporting and offering patches for documentation errors/ omissions. However, the docs got inadequate testing (and weren't complete) when 1.6.1 was released. 1.6.1 *needed* to be released, there was a lot of good, urgently-needed stuff in there (generally, and for IE8 and Chrome). If you want to, you can still get to the old docs (for now) here:http://prototypejs.org/api However, I expect to finish copying/updating/improving the content Real Soon Now (happen to be working on that today), which will at least address the content issue. And Tobie and Samuel just had a week- long codefest on the tool so we should see those improvements very soon. One thing that would be *really* useful would be to know what it is you find difficult about navigation (and just generally what's difficult about using the docs), so that that feedback can, um, feed into the improvement process. Two things that Tobie et. al. are already doing are 1) Going back to page-per-method (rather than a long run-on page), and 2) Adding syntax highlighting to examples I'm sure there are other things they're doing as well, those just happen to be the two I know of. What else needs to be done? Thanks, -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Oct 8, 7:00 pm, louis w louiswa...@gmail.com wrote: It's also just plain hard to navigate and understand all of the different methods available. An example. If I select Event there is no longer the list of available methods appearing in the sidebar menu. Then I need to scroll down a page which is visually hard to scan to be able to pick out 'isRightClick' in light grey text buried in a sea of bright blue boxes. Usability should be a key factor when redesigning
[Proto-Scripty] Re: DragDrop performances
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: Object Oriented Prototype This keyword Advices
Ok, i was bored at work :D... So far, this works in my testbench. I get an array of images, initialize the object, bind the methods to click events and change the images forward and backward. I hope this will help you: img src=/images/assets/add.png id=frame/br/ img src=/images/assets/previous.png id=previousImage style=cursor: pointer; / img src=/images/assets/next.png id=nextImage style=cursor: pointer; / script var dataSourceUrl = '/images.php'; var imagesUrl = '/images/assets/'; var frameId = 'frame'; var backElementId = 'previousImage'; var fwdElementId = 'nextImage'; var Chooser = Class.create({ 'images': null, 'imagesUrl': null, 'frame': null, 'initialize': function(images, imagesUrl, frameId, backElementId, fwdElementId) { this.images = images; this.imagesUrl = imagesUrl; this.frame = $(frameId); Event.observe($(backElementId), 'click', this.back.bind(this)); Event.observe($(fwdElementId), 'click', this.forward.bind(this)); }, 'back': function() { imageFilename = this.frame.src.match('\/([^\/]+)$'); imageIndex = this.images.indexOf(imageFilename[1]); if (imageIndex == 0) { imageIndex = this.images.length; } this.frame.src = this.imagesUrl+this.images[imageIndex - 1]; }, 'forward': function() { imageFilename = this.frame.src.match('\/([^\/]+)$'); imageIndex = this.images.indexOf(imageFilename[1]); if (imageIndex + 1 == this.images.length) { imageIndex = -1; } this.frame.src = this.imagesUrl+this.images[imageIndex + 1]; } }); document.observe(dom:loaded, function() { new Ajax.Request(dataSourceUrl, { 'method': get, 'onSuccess': function(transport) { json = transport.responseText.evalJSON(); new Chooser(json.photos, imagesUrl, frameId, backElementId, fwdElementId); }, 'onFailure': function() { console.log('Ajax failure'); } }); }) /script On 28 oct, 09:02, Cemo cemalettin@gmail.com wrote: Hi all, I have been using a js library first time, so please forgive me If I ask something very fool. Actually my objective is implementing a reusable component for 1. Returning photo links with AJAX 2. And with the help of back and forward button it should change next or previous photo link. But now I have a problem in my back and forward functions. Since I could not reach images variable in back and forward function scope. (Actually I successfully implemented but I am not sure it is best practice ) Ok, How should Implement such a functionality please? document.observe(dom:loaded, function() { var Chooser = Class.create({ initialize: function(images, backElement, forwardElement) { this.images = images; / Event.observe(backElement, 'click', this.back); Event.observe(forwardElement, 'click', this.forward); / console.log('Chooser initialized'); }, back: function() { // Problem is here console.log(this.images); }, forward: function() { // Problem is here console.log(this.images); } }); var baseUrl = '/j/advertisementAjaxAction.action'; myAjax = new Ajax.Request(baseUrl, { method: get, onSuccess : function(transport) { //console.log(transport.responseText); data = transport.responseText.evalJSON(); new Chooser(data.photos, $('init_back'), $ ('init_forward')); }, onFailure : function() { //todo set error } } ); }) --~--~-~--~~~---~--~~ 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] Help me with hashes
Help me please, this operation is best I have an object var MyObj:{ obj1:{ ... prop: ['А', 'C', 'D', 'E'] ... }, obj2:{ ... prop: ['B', 'C', 'D', 'E'] ... }, obj3:{ ... prop: ['А', 'E'] ... }, obj4:{ ... prop: ['D', 'E'] ... } } I neet to get a new hash like this Props:{ A: ['obj1', 'obj3'], B: ['obj2'], C: ['obj1', 'obj2'], D: ['obj1', 'obj2', 'obj4'], E: ['obj1', 'obj2', 'obj3', 'obj4'], } --~--~-~--~~~---~--~~ 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: Help me with hashes
var MyObj={ obj1:{ prop: ['А', 'C', 'D', 'E'] }, obj2:{ prop: ['B', 'C', 'D', 'E'] }, obj3:{ prop: ['А', 'E'] }, obj4:{ prop: ['D', 'E'] } } var newObj = {} Object.keys(MyObj).each(function(k,v){ MyObj[k].prop.each(function(x,y){ if(typeof newObj[x]==undefined){newObj[x]=[]} newObj[x].push(k) }) }) newObj 2009/10/29 Buda budari...@gmail.com Help me please, this operation is best I have an object var MyObj:{ obj1:{ ... prop: ['А', 'C', 'D', 'E'] ... }, obj2:{ ... prop: ['B', 'C', 'D', 'E'] ... }, obj3:{ ... prop: ['А', 'E'] ... }, obj4:{ ... prop: ['D', 'E'] ... } } I neet to get a new hash like this Props:{ A: ['obj1', 'obj3'], B: ['obj2'], C: ['obj1', 'obj2'], D: ['obj1', 'obj2', 'obj4'], E: ['obj1', 'obj2', 'obj3', 'obj4'], } -- Best Regards, Vladimir Tkach +972-54-7574166 tea...@gmail.com http://teamco-anthill.blogspot.com/ http://www.google.com/search?q=teamco-anthillpov=113485037116411478549usg=__MJmWqpqtgaTxQA8ZMBvE3etiB1Q= --~--~-~--~~~---~--~~ 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: Help me with hashes
Спасибо Владимир, помогло! From: prototype-scriptaculous@googlegroups.com [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Vladimir Tkach Sent: Thursday, October 29, 2009 3:02 PM To: prototype-scriptaculous@googlegroups.com Subject: [Proto-Scripty] Re: Help me with hashes var MyObj={ obj1:{ prop: ['А', 'C', 'D', 'E'] }, obj2:{ prop: ['B', 'C', 'D', 'E'] }, obj3:{ prop: ['А', 'E'] }, obj4:{ prop: ['D', 'E'] } } var newObj = {} Object.keys(MyObj).each(function(k,v){ MyObj[k].prop.each(function(x,y){ if(typeof newObj[x]==undefined){newObj[x]=[]} newObj[x].push(k) }) }) newObj 2009/10/29 Buda budari...@gmail.com Help me please, this operation is best I have an object var MyObj:{ obj1:{ ... prop: ['А', 'C', 'D', 'E'] ... }, obj2:{ ... prop: ['B', 'C', 'D', 'E'] ... }, obj3:{ ... prop: ['А', 'E'] ... }, obj4:{ ... prop: ['D', 'E'] ... } } I neet to get a new hash like this Props:{ A: ['obj1', 'obj3'], B: ['obj2'], C: ['obj1', 'obj2'], D: ['obj1', 'obj2', 'obj4'], E: ['obj1', 'obj2', 'obj3', 'obj4'], } -- Best Regards, Vladimir Tkach +972-54-7574166 tea...@gmail.com http://teamco-anthill.blogspot.com/ http://www.google.com/search?q=teamco-anthill http://www.google.com/search?q=teamco-anthillpov=113485037116411478549usg=__MJmWqpqtgaTxQA8ZMBvE3etiB1Q= pov=113485037116411478549usg=__MJmWqpqtgaTxQA8ZMBvE3etiB1Q= --~--~-~--~~~---~--~~ 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: New API Doc
TJ- First, it's great to see there's diligent activity on the docs, which seemed like they went stale for a while there. To the whole team, keep up the great work! Definitely need the quick-look menu of methods (and any other properties) provided by each of the major classes. i have a suggestion for enhancement, and two issues with the new docs: Enhancement: It might be helpful to somehow indicate from the (to-be-improved) navigation when a method HAS, or IS, an alias. Why do i want to see the actual documentation on Enumerable#select or Enumerable#filter when all it's going to tell me is Alias of Enumerable#findAll? Especially when they don't operate any differently. Show me that in the menu so i can just go to #findAll directly. Or better yet, don't give aliases a method-level entry at all. Perhaps something like the following: * Enumerable - link to main Enumerable doc - findAll - link to #findAll, where the aliases are also noted (filter) - link to #filter, if the user REALLY wants to see it (select) - link to #select, if the user REALLY wants to see it Issues: 1. This seems isolated to Firefox/Gecko. The menu panel doesn't scroll normally. i have no idea why, but it scrolls about 1/10th the expected speed, which is a nuisance. 2. This one is happening in all browsers. If i click Element (for instance), location bar says http://api.prototypejs.org/dom/element.html If i then click #select, i'm taken to that method: http://api.prototypejs.org/dom/element.html#select-class_method Great. But the natural impulse (mine, at least) to get back to that list of methods is to use the browser's Back action. Gotcha! The location bar returns back, but the browser window doesn't. Thanks! -joe t. On Oct 27, 7:29 pm, Adm.Wiggin admwig...@gmail.com wrote: How's this going? Very much interested in Going back to page-per- method (rather than a long run-on page). Having the side navigation easy to navigate in the page-per-method style like the old documentation is also of paramount importance. For example, if I click on Hash in the sidebar, I should immediately see an easy to read list of all the methods of the Hash class. As it is, they're in a big block, which is hard to scan through, where the vertical (alphabetical) list was quick and relatively painless. Lots of times, I'm just looking to verify the order of parameters, and it was very helpful to be able to find the exact method very quickly so that in almost no time I'm looking at the page reading the order of the methods. Something else that might be handy way further down the road is an easy way to access these pages by-url. For example, if I need to look up a PHP function to very the argument order, it's as easy as typing inhttp://php.net/function_name_here-- concrete example being stripos (is it haystack first, or needle first? I never can remember)http://php.net/striposand I'm there immediately. Obviously way down the road, but certainly something to think about. On Oct 9, 3:56 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, You're not the only one, not by a long chalk. :-) We're working on it. Tobie, Samuel, and Andrew are working hard to improve the structure, navigation, and presentation, and I'm continuing the ongoing quest of copying over, updating, and fleshing- out the content (which is a manual and labor-intensive process). You should see marked improvemenet in the online docs over the course of the next couple of weeks. What happened is that the project switched from having the documentation be a completely separate thing (in a difficult-to-use tool) to having the documentation be part of the source code (a'la Javadoc), using a new tool built for the purpose called PDoc. That way, when someone changes or adds code, they can update the documentation at the same time, and hopefully the two will be kept much more in sync. (The official policy, in fact, is that code patches with documentation impacts that don't include the documentation updates are rejected.) It also simplifies the process of people reporting and offering patches for documentation errors/ omissions. However, the docs got inadequate testing (and weren't complete) when 1.6.1 was released. 1.6.1 *needed* to be released, there was a lot of good, urgently-needed stuff in there (generally, and for IE8 and Chrome). If you want to, you can still get to the old docs (for now) here:http://prototypejs.org/api However, I expect to finish copying/updating/improving the content Real Soon Now (happen to be working on that today), which will at least address the content issue. And Tobie and Samuel just had a week- long codefest on the tool so we should see those improvements very soon. One thing that would be *really* useful would be to know what it is you find difficult about navigation (and just generally what's difficult about using the docs), so that that feedback
[Proto-Scripty] Event....
Is there a way to spoof the window event ... Basically i have script where the core relies on event being passed to it to work some stuff out but in one particular script i cant pass the event object because it goes to a server side script then back again... is it possible to spoof it - or even collect it as post/get data so i can pass it back along to the script... i tried var e=window.event but its returned as undefined 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: Help me with hashes
nop but answer in english please thanks 2009/10/29 budarin budari...@gmail.com Спасибо Владимир, помогло! *From:* prototype-scriptaculous@googlegroups.com [mailto: prototype-scriptacul...@googlegroups.com] *On Behalf Of *Vladimir Tkach *Sent:* Thursday, October 29, 2009 3:02 PM *To:* prototype-scriptaculous@googlegroups.com *Subject:* [Proto-Scripty] Re: Help me with hashes var MyObj={ obj1:{ prop: ['А', 'C', 'D', 'E'] }, obj2:{ prop: ['B', 'C', 'D', 'E'] }, obj3:{ prop: ['А', 'E'] }, obj4:{ prop: ['D', 'E'] } } var newObj = {} Object.keys(MyObj).each(function(k,v){ MyObj[k].prop.each(function(x,y){ if(typeof newObj[x]==undefined){newObj[x]=[]} newObj[x].push(k) }) }) newObj 2009/10/29 Buda budari...@gmail.com Help me please, this operation is best I have an object var MyObj:{ obj1:{ ... prop: ['А', 'C', 'D', 'E'] ... }, obj2:{ ... prop: ['B', 'C', 'D', 'E'] ... }, obj3:{ ... prop: ['А', 'E'] ... }, obj4:{ ... prop: ['D', 'E'] ... } } I neet to get a new hash like this Props:{ A: ['obj1', 'obj3'], B: ['obj2'], C: ['obj1', 'obj2'], D: ['obj1', 'obj2', 'obj4'], E: ['obj1', 'obj2', 'obj3', 'obj4'], } -- Best Regards, Vladimir Tkach +972-54-7574166 tea...@gmail.com http://teamco-anthill.blogspot.com/ http://www.google.com/search?q=teamco-anthillpov=113485037116411478549usg=__MJmWqpqtgaTxQA8ZMBvE3etiB1Q= -- Best Regards, Vladimir Tkach +972-54-7574166 tea...@gmail.com http://teamco-anthill.blogspot.com/ http://www.google.com/search?q=teamco-anthillpov=113485037116411478549usg=__MJmWqpqtgaTxQA8ZMBvE3etiB1Q= --~--~-~--~~~---~--~~ 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: Event....
Sorry - disregard The function before the one called (the callee) has an event so i just did window.lastEvent=event instead so i can now access it Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Alex Mcauley webmas...@thecarmarketplace.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, October 29, 2009 1:29 PM Subject: [Proto-Scripty] Event Is there a way to spoof the window event ... Basically i have script where the core relies on event being passed to it to work some stuff out but in one particular script i cant pass the event object because it goes to a server side script then back again... is it possible to spoof it - or even collect it as post/get data so i can pass it back along to the script... i tried var e=window.event but its returned as undefined 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: Ajax.Request with JSON response
I think I'd do it more like this, if i just wanted JSON as the response: On the server: set the response type to application/json, something to the equivalent of = response.setContentType(application/json) Then print your json object to the response (java stylee again): writer.print(String.format({value: %d, feelingOk: %s}, 42, Boolean.TRUE)) In the callback, it is handled like this: onComplete : function (transport) { // obtain the json you sent var jsonObj = transport.responseJSON; // use it alert('feelingOk:'+jsonObj['feelingOk']); alert('value:'+jsonObj['value']); } /L --~--~-~--~~~---~--~~ 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] Forms
Ok, maybe I'm just being dense, but I am reading the API for forms and I am getting nothing from it. What is proper use of the $F utility and what can it do for me? I have read the Form.Element.getValue and it means nothing to me. I have this form: form name=createPDF action=/pdf/pdf_process.php method=POST input type=hidden name=A_NAME value=John / input type=hidden name=APPLY_DATE value=?=date(m/d/Y)? / input type=hidden name=A_BIRTH_DATE value=01/01/01 / input type=hidden name=L_NAME value=Jane / input type=hidden name=L_BIRTH_DATE value=01/01/01 / input type=hidden name=A_ACCOUNT value=1 / /form When I try to do alert($F('A_NAME')); I get an 'Object does not support this property or method' error. I get the same error when I try to submit the form with 'document.createPDF.submit();' is there something wrong with my form? --~--~-~--~~~---~--~~ 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: Forms
2009/10/29 Russell Keith russell.ke...@aacreditunion.org: Ok, maybe I’m just being dense, but I am reading the API for forms and I am getting nothing from it. What is proper use of the $F utility and what can it do for me? I have read the Form.Element.getValue and it means nothing to me. I have this form: form name=createPDF action=/pdf/pdf_process.php method=POST input type=hidden name=A_NAME value=John / input type=hidden name=APPLY_DATE value=?=date(m/d/Y)? / input type=hidden name=A_BIRTH_DATE value=01/01/01 / input type=hidden name=L_NAME value=Jane / input type=hidden name=L_BIRTH_DATE value=01/01/01 / input type=hidden name=A_ACCOUNT value=1 / /form When I try to do alert($F(‘A_NAME’)); I get an ‘Object does not support this property or method’ error. I get the same error when I try to submit the form with ‘document.createPDF.submit();’ is there something wrong with my form? $F() returns the element. So, alert($F('A_ACCOIUNT').value); should be what you are looking for, -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling --~--~-~--~~~---~--~~ 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.Request with JSON response
What would my json response look like (syntax-wise) in this case? On Thu, 29 Oct 2009 07:28:43 -0700 (PDT), Lapis petter.env...@gmail.com wrote: I think I'd do it more like this, if i just wanted JSON as the response: On the server: set the response type to application/json, something to the equivalent of = response.setContentType(application/json) Then print your json object to the response (java stylee again): writer.print(String.format({value: %d, feelingOk: %s}, 42, Boolean.TRUE)) In the callback, it is handled like this: onComplete : function (transport) { // obtain the json you sent var jsonObj = transport.responseJSON; // use it alert('feelingOk:'+jsonObj['feelingOk']); alert('value:'+jsonObj['value']); } /L --~--~-~--~~~---~--~~ 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: Forms
2009/10/29 Richard Quadling rquadl...@googlemail.com: 2009/10/29 Russell Keith russell.ke...@aacreditunion.org: Ok, maybe I’m just being dense, but I am reading the API for forms and I am getting nothing from it. What is proper use of the $F utility and what can it do for me? I have read the Form.Element.getValue and it means nothing to me. I have this form: form name=createPDF action=/pdf/pdf_process.php method=POST input type=hidden name=A_NAME value=John / input type=hidden name=APPLY_DATE value=?=date(m/d/Y)? / input type=hidden name=A_BIRTH_DATE value=01/01/01 / input type=hidden name=L_NAME value=Jane / input type=hidden name=L_BIRTH_DATE value=01/01/01 / input type=hidden name=A_ACCOUNT value=1 / /form When I try to do alert($F(‘A_NAME’)); I get an ‘Object does not support this property or method’ error. I get the same error when I try to submit the form with ‘document.createPDF.submit();’ is there something wrong with my form? $F() returns the element. So, alert($F('A_ACCOIUNT').value); should be what you are looking for, -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling OOps. Completely wrong. The form elements do not have IDs, so you need to add them for $F() to work. http://api.prototypejs.org/dom/form/element.html#getvalue-class_method See that the parameter is an element. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling --~--~-~--~~~---~--~~ 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: Forms
Try giving your form elements IDs to match their NAME property. I have always needed the ID to be set in order to get a value out of $F. Walter On Oct 29, 2009, at 11:08 AM, Russell Keith wrote: Ok, maybe I’m just being dense, but I am reading the API for forms and I am getting nothing from it. What is proper use of the $F utility and what can it do for me? I have read the Form.Element.getValue and it means nothing to me. I have this form: form name=createPDF action=/pdf/pdf_process.php method=POST input type=hidden name=A_NAME value=John / input type=hidden name=APPLY_DATE value=?=date(m/d/Y)? / input type=hidden name=A_BIRTH_DATE value=01/01/01 / input type=hidden name=L_NAME value=Jane / input type=hidden name=L_BIRTH_DATE value=01/01/01 / input type=hidden name=A_ACCOUNT value=1 / /form When I try to do alert($F(‘A_NAME’)); I get an ‘Object does not support this property or method’ error. I get the same error when I try to submit the form with ‘document.createPDF.submit();’ is there something wrong with my form? --~--~-~--~~~---~--~~ 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: Forms
Then how is $F() any different than $()? Also, any idea why I can't get my form to submit. I have been all over Google and can't figure it out. -Original Message- From: prototype-scriptaculous@googlegroups.com [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Walter Lee Davis Sent: Thursday, October 29, 2009 10:24 AM To: prototype-scriptaculous@googlegroups.com Subject: [Proto-Scripty] Re: Forms Try giving your form elements IDs to match their NAME property. I have always needed the ID to be set in order to get a value out of $F. Walter On Oct 29, 2009, at 11:08 AM, Russell Keith wrote: Ok, maybe I'm just being dense, but I am reading the API for forms and I am getting nothing from it. What is proper use of the $F utility and what can it do for me? I have read the Form.Element.getValue and it means nothing to me. I have this form: form name=createPDF action=/pdf/pdf_process.php method=POST input type=hidden name=A_NAME value=John / input type=hidden name=APPLY_DATE value=?=date(m/d/Y)? / input type=hidden name=A_BIRTH_DATE value=01/01/01 / input type=hidden name=L_NAME value=Jane / input type=hidden name=L_BIRTH_DATE value=01/01/01 / input type=hidden name=A_ACCOUNT value=1 / /form When I try to do alert($F('A_NAME')); I get an 'Object does not support this property or method' error. I get the same error when I try to submit the form with 'document.createPDF.submit();' is there something wrong with my form? --~--~-~--~~~---~--~~ 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: Forms
You need to give the input tags an id, as follows: form name=createPDF action=/pdf/pdf_process.php method=POST input type=hidden id=A_NAME name=A_NAME value=John / input type=hidden id=APPLY_DATE name=APPLY_DATE value=?=date(m/d/Y)? / input type=hidden id=A_BIRTH_DATE name=A_BIRTH_DATE value=01/01/01 / input type=hidden id=L_NAME name=L_NAME value=Jane / input type=hidden id=L_BIRTH_DATE name=L_BIRTH_DATE value=01/01/01 / input type=hidden id=A_ACCOUNT name=A_ACCOUNT value=1 / /form On 29/10/2009 15:08, Russell Keith wrote: Ok, maybe I'm just being dense, but I am reading the API for forms and I am getting nothing from it. What is proper use of the $F utility and what can it do for me? I have read the |Form.Element.getValue and it means nothing to me.| | | |I have this form:| | | form name=createPDF action=/pdf/pdf_process.php method=POST input type=hidden name=A_NAME value=John / input type=hidden name=APPLY_DATE value=?=date(m/d/Y)? / input type=hidden name=A_BIRTH_DATE value=01/01/01 / input type=hidden name=L_NAME value=Jane / input type=hidden name=L_BIRTH_DATE value=01/01/01 / input type=hidden name=A_ACCOUNT value=1 / /form When I try to do alert($F('A_NAME')); I get an 'Object does not support this property or method' error. I get the same error when I try to submit the form with 'document.createPDF.submit();' is there something wrong with my form? --~--~-~--~~~---~--~~ 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: Forms
Well, the issue was with my function name not the form. I changed my function name when I couldn't even get alert('test') to work. It all appears to be working now. -Original Message- From: prototype-scriptaculous@googlegroups.com [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Russell Keith Sent: Thursday, October 29, 2009 10:28 AM To: prototype-scriptaculous@googlegroups.com Subject: [Proto-Scripty] Re: Forms Then how is $F() any different than $()? Also, any idea why I can't get my form to submit. I have been all over Google and can't figure it out. -Original Message- From: prototype-scriptaculous@googlegroups.com [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Walter Lee Davis Sent: Thursday, October 29, 2009 10:24 AM To: prototype-scriptaculous@googlegroups.com Subject: [Proto-Scripty] Re: Forms Try giving your form elements IDs to match their NAME property. I have always needed the ID to be set in order to get a value out of $F. Walter On Oct 29, 2009, at 11:08 AM, Russell Keith wrote: Ok, maybe I'm just being dense, but I am reading the API for forms and I am getting nothing from it. What is proper use of the $F utility and what can it do for me? I have read the Form.Element.getValue and it means nothing to me. I have this form: form name=createPDF action=/pdf/pdf_process.php method=POST input type=hidden name=A_NAME value=John / input type=hidden name=APPLY_DATE value=?=date(m/d/Y)? / input type=hidden name=A_BIRTH_DATE value=01/01/01 / input type=hidden name=L_NAME value=Jane / input type=hidden name=L_BIRTH_DATE value=01/01/01 / input type=hidden name=A_ACCOUNT value=1 / /form When I try to do alert($F('A_NAME')); I get an 'Object does not support this property or method' error. I get the same error when I try to submit the form with 'document.createPDF.submit();' is there something wrong with my form? --~--~-~--~~~---~--~~ 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: Forms
because it gets values from anything (selects that can have multiples aswell) ... Where as value on a multiple select would not.!! Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Russell Keith russell.ke...@aacreditunion.org To: prototype-scriptaculous@googlegroups.com Sent: Thursday, October 29, 2009 3:27 PM Subject: [Proto-Scripty] Re: Forms Then how is $F() any different than $()? Also, any idea why I can't get my form to submit. I have been all over Google and can't figure it out. -Original Message- From: prototype-scriptaculous@googlegroups.com [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Walter Lee Davis Sent: Thursday, October 29, 2009 10:24 AM To: prototype-scriptaculous@googlegroups.com Subject: [Proto-Scripty] Re: Forms Try giving your form elements IDs to match their NAME property. I have always needed the ID to be set in order to get a value out of $F. Walter On Oct 29, 2009, at 11:08 AM, Russell Keith wrote: Ok, maybe I'm just being dense, but I am reading the API for forms and I am getting nothing from it. What is proper use of the $F utility and what can it do for me? I have read the Form.Element.getValue and it means nothing to me. I have this form: form name=createPDF action=/pdf/pdf_process.php method=POST input type=hidden name=A_NAME value=John / input type=hidden name=APPLY_DATE value=?=date(m/d/Y)? / input type=hidden name=A_BIRTH_DATE value=01/01/01 / input type=hidden name=L_NAME value=Jane / input type=hidden name=L_BIRTH_DATE value=01/01/01 / input type=hidden name=A_ACCOUNT value=1 / /form When I try to do alert($F('A_NAME')); I get an 'Object does not support this property or method' error. I get the same error when I try to submit the form with 'document.createPDF.submit();' is there something wrong with my form? --~--~-~--~~~---~--~~ 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: Effect.move speed issue + tooltip suggestions?
Hi Peder, You can adjust indirectly the speed of the effect with the duration parameter, which is the effect duration (from start to end). In your case, you may change: new Effect.Move(caroImgs[imgIdx], {x: newLeft, y:0, mode: 'absolute'}); by: new Effect.Move(caroImgs[imgIdx], {x: newLeft, y:0, mode: 'absolute', duration:0.2}); For the tooltip script, I have no idea, but you may have a look at http://scripteka.com/ Eric On Oct 25, 5:17 pm, Peder Johnsen supp...@johnsendesign.no wrote: Hi, is there anyway to speed up the move effect? I am currently using it forwww.pixelgeddon.com(press the joystick icon). And the way it is now its moving a bit to slow.. Also I wonder if anyone of you know about any good tooltip scripts that works with Prototype script.aculo.us. It has to let me display a sepereate div with html text for each image in that scroller that I use the move effect for :). Best regards, Peder Johnsen. --~--~-~--~~~---~--~~ 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: Help me with hashes
Thanks, it works! On 29 окт, 15:33, Vladimir Tkach tea...@gmail.com wrote: nop but answer in english please thanks 2009/10/29 budarin budari...@gmail.com Спасибо Владимир, помогло! *From:* prototype-scriptaculous@googlegroups.com [mailto: prototype-scriptacul...@googlegroups.com] *On Behalf Of *Vladimir Tkach *Sent:* Thursday, October 29, 2009 3:02 PM *To:* prototype-scriptaculous@googlegroups.com *Subject:* [Proto-Scripty] Re: Help me with hashes var MyObj={ obj1:{ prop: ['А', 'C', 'D', 'E'] }, obj2:{ prop: ['B', 'C', 'D', 'E'] }, obj3:{ prop: ['А', 'E'] }, obj4:{ prop: ['D', 'E'] } } var newObj = {} Object.keys(MyObj).each(function(k,v){ MyObj[k].prop.each(function(x,y){ if(typeof newObj[x]==undefined){newObj[x]=[]} newObj[x].push(k) }) }) newObj 2009/10/29 Buda budari...@gmail.com Help me please, this operation is best I have an object var MyObj:{ obj1:{ ... prop: ['А', 'C', 'D', 'E'] ... }, obj2:{ ... prop: ['B', 'C', 'D', 'E'] ... }, obj3:{ ... prop: ['А', 'E'] ... }, obj4:{ ... prop: ['D', 'E'] ... } } I neet to get a new hash like this Props:{ A: ['obj1', 'obj3'], B: ['obj2'], C: ['obj1', 'obj2'], D: ['obj1', 'obj2', 'obj4'], E: ['obj1', 'obj2', 'obj3', 'obj4'], } -- Best Regards, Vladimir Tkach +972-54-7574166 tea...@gmail.com http://teamco-anthill.blogspot.com/ http://www.google.com/search?q=teamco-anthillpov=1134850371164114785... -- Best Regards, Vladimir Tkach +972-54-7574166 tea...@gmail.com http://teamco-anthill.blogspot.com/ http://www.google.com/search?q=teamco-anthillpov=1134850371164114785...- Скрыть цитируемый текст - - Показать цитируемый текст - --~--~-~--~~~---~--~~ 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.Request with JSON response
From a Java horizon it would be: writer.print({success : true, message : 'good'}); or writer.print({success : false, message : 'bad'}); (writing to the response's PrintWriter) Hoping I am not misinterpreting your question right now. /L On Oct 29, 4:19 pm, mich...@haston.name wrote: What would my json response look like (syntax-wise) in this case? On Thu, 29 Oct 2009 07:28:43 -0700 (PDT), Lapis petter.env...@gmail.com wrote: I think I'd do it more like this, if i just wanted JSON as the response: On the server: set the response type to application/json, something to the equivalent of = response.setContentType(application/json) Then print your json object to the response (java stylee again): writer.print(String.format({value: %d, feelingOk: %s}, 42, Boolean.TRUE)) In the callback, it is handled like this: onComplete : function (transport) { // obtain the json you sent var jsonObj = transport.responseJSON; // use it alert('feelingOk:'+jsonObj['feelingOk']); alert('value:'+jsonObj['value']); } /L --~--~-~--~~~---~--~~ 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] $$ is a violation of Model-View-Controller
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? --~--~-~--~~~---~--~~ 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: Forms
$F() gets the *value* of the form element (i.e. a dropdown's value, the text in a text box, etc.) $() just gets the DOM element itself (so would return the dropdown, the text box, etc. respectively). [so also, using $F() on a non-form element is fairly pointless] -Original Message- From: prototype-scriptaculous@googlegroups.com [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Russell Keith Sent: Thursday, October 29, 2009 10:28 AM To: prototype-scriptaculous@googlegroups.com Subject: [Proto-Scripty] Re: Forms Then how is $F() any different than $()? Also, any idea why I can't get my form to submit. I have been all over Google and can't figure it out. -Original Message- From: prototype-scriptaculous@googlegroups.com [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Walter Lee Davis Sent: Thursday, October 29, 2009 10:24 AM To: prototype-scriptaculous@googlegroups.com Subject: [Proto-Scripty] Re: Forms Try giving your form elements IDs to match their NAME property. I have always needed the ID to be set in order to get a value out of $F. Walter On Oct 29, 2009, at 11:08 AM, Russell Keith wrote: Ok, maybe I'm just being dense, but I am reading the API for forms and I am getting nothing from it. What is proper use of the $F utility and what can it do for me? I have read the Form.Element.getValue and it means nothing to me. I have this form: form name=createPDF action=/pdf/pdf_process.php method=POST input type=hidden name=A_NAME value=John / input type=hidden name=APPLY_DATE value=?=date(m/d/Y)? / input type=hidden name=A_BIRTH_DATE value=01/01/01 / input type=hidden name=L_NAME value=Jane / input type=hidden name=L_BIRTH_DATE value=01/01/01 / input type=hidden name=A_ACCOUNT value=1 / /form When I try to do alert($F('A_NAME')); I get an 'Object does not support this property or method' error. I get the same error when I try to submit the form with 'document.createPDF.submit();' is there something wrong with my form? --~--~-~--~~~---~--~~ 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: New API Doc
Hi Joe, I think you've gotten the wrong impression -- I'm not in charge (or control) of the new doc stuff, that's Tobie Andrew with some help from a couple of other people. All I've done is try to merge in (and update) the old API docs content into the new stuff, since it hadn't been done. But I know Tobie Andrew are very open to suggestions and eager to improve the new docs. My suggestion would be to log any issues you run into (or suggestions) on Prototype's Lighthouse project[1], flagging them appropriately as either bugs or enhancements. Some of them may or may not be more appropriately filed on the PDoc project[2] instead, but it's a bit hard sometimes to tell where a problem is, so I'd tend to lean toward reporting them on the Prototype project. [1] https://prototype.lighthouseapp.com/projects/8886-prototype/overview [2] https://prototype.lighthouseapp.com/projects/8889-pdoc/ HTH, -- T.J. :-) On Oct 29, 1:23 pm, joe t. thooke...@gmail.com wrote: TJ- First, it's great to see there's diligent activity on the docs, which seemed like they went stale for a while there. To the whole team, keep up the great work! Definitely need the quick-look menu of methods (and any other properties) provided by each of the major classes. i have a suggestion for enhancement, and two issues with the new docs: Enhancement: It might be helpful to somehow indicate from the (to-be-improved) navigation when a method HAS, or IS, an alias. Why do i want to see the actual documentation on Enumerable#select or Enumerable#filter when all it's going to tell me is Alias of Enumerable#findAll? Especially when they don't operate any differently. Show me that in the menu so i can just go to #findAll directly. Or better yet, don't give aliases a method-level entry at all. Perhaps something like the following: * Enumerable - link to main Enumerable doc - findAll - link to #findAll, where the aliases are also noted (filter) - link to #filter, if the user REALLY wants to see it (select) - link to #select, if the user REALLY wants to see it Issues: 1. This seems isolated to Firefox/Gecko. The menu panel doesn't scroll normally. i have no idea why, but it scrolls about 1/10th the expected speed, which is a nuisance. 2. This one is happening in all browsers. If i click Element (for instance), location bar sayshttp://api.prototypejs.org/dom/element.html If i then click #select, i'm taken to that method:http://api.prototypejs.org/dom/element.html#select-class_method Great. But the natural impulse (mine, at least) to get back to that list of methods is to use the browser's Back action. Gotcha! The location bar returns back, but the browser window doesn't. Thanks! -joe t. On Oct 27, 7:29 pm, Adm.Wiggin admwig...@gmail.com wrote: How's this going? Very much interested in Going back to page-per- method (rather than a long run-on page). Having the side navigation easy to navigate in the page-per-method style like the old documentation is also of paramount importance. For example, if I click on Hash in the sidebar, I should immediately see an easy to read list of all the methods of the Hash class. As it is, they're in a big block, which is hard to scan through, where the vertical (alphabetical) list was quick and relatively painless. Lots of times, I'm just looking to verify the order of parameters, and it was very helpful to be able to find the exact method very quickly so that in almost no time I'm looking at the page reading the order of the methods. Something else that might be handy way further down the road is an easy way to access these pages by-url. For example, if I need to look up a PHP function to very the argument order, it's as easy as typing inhttp://php.net/function_name_here-- concrete example being stripos (is it haystack first, or needle first? I never can remember)http://php.net/striposandI'm there immediately. Obviously way down the road, but certainly something to think about. On Oct 9, 3:56 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, You're not the only one, not by a long chalk. :-) We're working on it. Tobie, Samuel, and Andrew are working hard to improve the structure, navigation, and presentation, and I'm continuing the ongoing quest of copying over, updating, and fleshing- out the content (which is a manual and labor-intensive process). You should see marked improvemenet in the online docs over the course of the next couple of weeks. What happened is that the project switched from having the documentation be a completely separate thing (in a difficult-to-use tool) to having the documentation be part of the source code (a'la Javadoc), using a new tool built for the purpose called PDoc. That way, when someone changes or adds code, they can update the documentation at the same time, and hopefully the two will be kept much more in sync. (The
[Proto-Scripty] Re: New API Doc
Forgot to say: Great. But the natural impulse (mine, at least) to get back to that list of methods is to use the browser's Back action. Gotcha! The location bar returns back, but the browser window doesn't. I *thought* I'd seen that the other day and was irritated by it, glad to know it's not just me. I was in too much of a rush to go into detail at the time. -- T.J. :-) On Oct 29, 1:23 pm, joe t. thooke...@gmail.com wrote: TJ- First, it's great to see there's diligent activity on the docs, which seemed like they went stale for a while there. To the whole team, keep up the great work! Definitely need the quick-look menu of methods (and any other properties) provided by each of the major classes. i have a suggestion for enhancement, and two issues with the new docs: Enhancement: It might be helpful to somehow indicate from the (to-be-improved) navigation when a method HAS, or IS, an alias. Why do i want to see the actual documentation on Enumerable#select or Enumerable#filter when all it's going to tell me is Alias of Enumerable#findAll? Especially when they don't operate any differently. Show me that in the menu so i can just go to #findAll directly. Or better yet, don't give aliases a method-level entry at all. Perhaps something like the following: * Enumerable - link to main Enumerable doc - findAll - link to #findAll, where the aliases are also noted (filter) - link to #filter, if the user REALLY wants to see it (select) - link to #select, if the user REALLY wants to see it Issues: 1. This seems isolated to Firefox/Gecko. The menu panel doesn't scroll normally. i have no idea why, but it scrolls about 1/10th the expected speed, which is a nuisance. 2. This one is happening in all browsers. If i click Element (for instance), location bar sayshttp://api.prototypejs.org/dom/element.html If i then click #select, i'm taken to that method:http://api.prototypejs.org/dom/element.html#select-class_method Great. But the natural impulse (mine, at least) to get back to that list of methods is to use the browser's Back action. Gotcha! The location bar returns back, but the browser window doesn't. Thanks! -joe t. On Oct 27, 7:29 pm, Adm.Wiggin admwig...@gmail.com wrote: How's this going? Very much interested in Going back to page-per- method (rather than a long run-on page). Having the side navigation easy to navigate in the page-per-method style like the old documentation is also of paramount importance. For example, if I click on Hash in the sidebar, I should immediately see an easy to read list of all the methods of the Hash class. As it is, they're in a big block, which is hard to scan through, where the vertical (alphabetical) list was quick and relatively painless. Lots of times, I'm just looking to verify the order of parameters, and it was very helpful to be able to find the exact method very quickly so that in almost no time I'm looking at the page reading the order of the methods. Something else that might be handy way further down the road is an easy way to access these pages by-url. For example, if I need to look up a PHP function to very the argument order, it's as easy as typing inhttp://php.net/function_name_here-- concrete example being stripos (is it haystack first, or needle first? I never can remember)http://php.net/striposandI'm there immediately. Obviously way down the road, but certainly something to think about. On Oct 9, 3:56 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, You're not the only one, not by a long chalk. :-) We're working on it. Tobie, Samuel, and Andrew are working hard to improve the structure, navigation, and presentation, and I'm continuing the ongoing quest of copying over, updating, and fleshing- out the content (which is a manual and labor-intensive process). You should see marked improvemenet in the online docs over the course of the next couple of weeks. What happened is that the project switched from having the documentation be a completely separate thing (in a difficult-to-use tool) to having the documentation be part of the source code (a'la Javadoc), using a new tool built for the purpose called PDoc. That way, when someone changes or adds code, they can update the documentation at the same time, and hopefully the two will be kept much more in sync. (The official policy, in fact, is that code patches with documentation impacts that don't include the documentation updates are rejected.) It also simplifies the process of people reporting and offering patches for documentation errors/ omissions. However, the docs got inadequate testing (and weren't complete) when 1.6.1 was released. 1.6.1 *needed* to be released, there was a lot of good, urgently-needed stuff in there (generally, and for IE8 and Chrome). If you want to, you can still get to the old docs (for now)
[Proto-Scripty] Re: $$ is a violation of Model-View-Controller
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-building-selectors-with-string-manipulation/1567743#1567743 -- 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: Ajax.Request with JSON response
Didn't seem to work for me. I might have it wrong. Code ... 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, onComplete: function(transport){ // obtain the json you sent var jsonObj = transport.responseJSON; // use it alert('feelingOk:' + jsonObj['feelingOk']); alert('value:' + jsonObj['value']); } }); } JSON {success : true, message : good} --~--~-~--~~~---~--~~ 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] 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 Place http://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 -~--~~~~--~~--~--~---