Re: [Proto-Scripty] Any patch/fix available for CVE-2020-27511
There is a PR in Github since January 2021 to fix this, but it hasn't made its way through the process yet. The last update was 22 days ago, but I don't know what the timeline will be for this. https://github.com/prototypejs/prototype/pull/349 Walter > On Jun 11, 2022, at 12:56 AM, Vinay Kumar wrote: > > Hi All, > > Is there any fix/patch available for the vulnerability CVE-2020-27511 in > Prototype 1.7.3? > > Regards, > Vinay Kumar > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to prototype-scriptaculous+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/prototype-scriptaculous/2e6bc7d2-241c-4eb2-8246-bf5165343a86n%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prototype-scriptaculous/FF2F8735-5DE8-40E7-A03D-9BD6CB5AD36A%40wdstudio.com.
Re: [Proto-Scripty] End of life ?
I don't speak with any authority for either Thomas Fuchs or Andrew Dupont, but both of these projects are effectively out of date. If you look at the latest commit dates on GitHub, you'll see that very little has been added/changed over the past couple of years. I recognize that this is not a real metric, since a finished, working thing often doesn't need lots of changing. But it's a hint that security needs may be going unmet. I desperately love Prototype. Full stop. I think it is the way that JavaScript should work. But that opinion is increasingly out of step with "modern" JS. I was forced by [day job] to learn jQuery, and now I've been relying on various "you may not need jQuery" conversion hint sites to make my work more "vanilla". I have been having a very good time with Stimulus.js, though, and that has been really refreshing. As far as animation and transition effects go, I don't know of anything that even approaches what Script.aculo.us does/did. Walter > On Sep 29, 2021, at 2:44 AM, PrototypeFanClub wrote: > > Hi, > > I am new to this community. I am using an older version of script.aculo.us > and prototype in my work. I need an answer to following question before I > plan to upgrade the library to a later version. > > a) I do not see a release for script.aculo.us (last release in 2010) and > prototype (last release in 2015). Shall I consider these libraries End of > Life or are there a replacement for these libraries which are actively > supported by community and do not have any reported security issues. > > Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to prototype-scriptaculous+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/prototype-scriptaculous/07f87009-1e53-4264-a17f-c931a5bc3898n%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prototype-scriptaculous/8107D459-B720-4CC5-8508-F66BAF1D9589%40wdstudio.com.
Re: [Proto-Scripty] Thiking to revive the prototype helpers from Rails 2.3 for Rails 5+
I have used Prototype.js in Rails up to 4.2, and it worked well there. Goodies like the sortable list and other Script.aculo.us bits were usable there as well. I didn't try very hard to use them in 5, because by that time I was also working to use Bootstrap, and that was harder to use without jQuery. While it is possible to use both at once, I refuse to do that to my visitors. It's ironically quite a bit easier to use Prototype in Rails >= 6, because there is no longer a hard dependency on jQuery. And the next Bootstrap will no longer require jQuery either. As far as the Rails bits, I agree, it would be nice to have some of that back. Perhaps we could start by writing some helpers first, and then extract them out to a gem. Walter > On Feb 28, 2020, at 7:27 PM, Mathieu Jobin wrote: > > I think the JS world as gone bad... I really like how things were with > prototype JS and friends. > especially the helpers in ruby... > > I wonder if there would be other people interested in using them. > I believe the last version was in rails 2.3.18, and prototype 1.6.0 was > included at the time. > > so I would try to make this work with rails 5 and 6, first. > then upgrading the library to 1.7.3+ > > would anyone else uses them? or would like to participate? > > cheers, > > Mathieu > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to prototype-scriptaculous+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/prototype-scriptaculous/fba2902f-c375-4c62-9419-747654cb12be%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prototype-scriptaculous/014E450A-2421-4511-A4F6-DF9A4B54C903%40wdstudio.com.
Re: [Proto-Scripty] Ajax problem
> On Jun 23, 2019, at 12:22 PM, Chris Sansom wrote: > > Hi Walter > > Thanks for your long and thoughtful response… some of which I understood! (I > did say I was rusty, and I was never extremely advanced - never got into OOP > for instance unless it was laid out on a plate for me as prototype does). > > Just a quick question - do you know whether there’s some limit to the length > of a string that can be returned via Ajax, and whether it can contain > carriage returns, tabs or whatever? What I’m returning here is politely > formatted and indented html with 76 options in the select. Yup. That will stop a JavaScript insertion like you want to do cold. Try replacing all of the newlines [and carriage returns, if any] with a single space before you pass that value back to the Ajax request. It doesn't matter how long the line is, as long as it's one line. I generally substitute /[\n\r]+/ with ' '. Walter > >> On 23 Jun 2019, at 16:09, Walter Lee Davis wrote: >> >> One of the best ways to work this out is to build a cut-down example, in one >> page, that tries to do what you're after here. If you can get that to fail, >> post it as a Gist or similar. From your description, you're going about >> things the right way. >> >> One other piece of advice. Rather than using a numerical index to get the >> first of some collection, try making your method iterate over the found >> results and operate conditionally. This will give you another place to put >> console.log statements to further refine exactly what is going on inside: >> >>> var newhtml = xml.getElementsByTagName('newhtml')[0].firstChild.nodeValue; >> >> When you say that the correct code to insert is there in the Ajax response, >> that cuts that part of the problem out, and your example page can just do >> something dumb like this: >> >> var data_to_insert = $('some_example_element').remove().innerHTML.toString(); >> >> ...where you have a DOM element like > ... your element here ...> >> >> I have found over the years that when you have the correct element (legally >> possible to insert into a given container), then Prototype (and the browser) >> just does what you'd expect. But if what you are getting back from the >> server doesn't make any sense in terms of your DOCTYPE (say you are trying >> to insert raw text into a , rather than trying to insert a , then >> the browser will just ignore you. It's not a Prototype error, in other >> words, just the browser being pedantic when being called in a JS update >> mode. >> >> Finally, see if you can get your server to return the HTML of the picker, >> fully rendered. Then you should be able to do this: >> >> new Ajax.updater('parent_element_id', '/server/url', { >> parameters: { foo: 'bar', ...}, // optional, pass to your server some >> parameters >> insertion: 'bottom' // this lets you put the rendered element at the bottom >> of the existing children of the parent >> }); >> >> If #parent_element_id is a , then the HTML you get from >> /server/url?foo=bar should be: >> >> >> >> >> >> >> >> ... with all of the whitespace removed. >> >> Walter >> >>> On Jun 22, 2019, at 11:25 AM, Chris Sansom wrote: >>> >>> With apologies in advance for the length... >>> >>> I retired a few years ago from web development, where I used Prototype >>> quite a bit in the later years. I'm somewhat rusty now, but I'm trying to >>> do some development for purely personal use. It won't be on the open web, >>> just on our local server. It's all been going fine (if slowly!), but now >>> I've hit a brick wall with Ajax. >>> >>> Here's what I'm trying to do: >>> * I have a form with one or more s, each within its own , all >>> in the one . >>> * Each contains the same list of items from a table in a MySQL >>> database. >>> * The last has nothing selected and has the class "addselect". >>> * The idea is that if I select something from that last , an >>> onChange event is triggered which calls an Ajax script to add a new >>> (containing the same items). This is set up on page load in a >>> "document.observe ('dom:loaded', function()..." at the top of the >>> javascript file. >>> * Each has a sequential name and id, eg 'name="country[0]" >>> id="country_0"', the next country[1] and country_1, and so on. The newly >>> created wo
Re: [Proto-Scripty] Ajax problem
Sorry, typo here: > On Jun 23, 2019, at 11:09 AM, Walter Lee Davis wrote: > > If #parent_element_id is a , then the HTML you get from > /server/url?foo=bar should be: I meant, if the parent element is a . Walter -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at https://groups.google.com/group/prototype-scriptaculous. To view this discussion on the web visit https://groups.google.com/d/msgid/prototype-scriptaculous/9F766ECE-3263-40FE-8D44-4F04FDC48490%40wdstudio.com. For more options, visit https://groups.google.com/d/optout.
Re: [Proto-Scripty] Ajax problem
One of the best ways to work this out is to build a cut-down example, in one page, that tries to do what you're after here. If you can get that to fail, post it as a Gist or similar. From your description, you're going about things the right way. One other piece of advice. Rather than using a numerical index to get the first of some collection, try making your method iterate over the found results and operate conditionally. This will give you another place to put console.log statements to further refine exactly what is going on inside: > var newhtml = xml.getElementsByTagName('newhtml')[0].firstChild.nodeValue; When you say that the correct code to insert is there in the Ajax response, that cuts that part of the problem out, and your example page can just do something dumb like this: var data_to_insert = $('some_example_element').remove().innerHTML.toString(); ...where you have a DOM element like I have found over the years that when you have the correct element (legally possible to insert into a given container), then Prototype (and the browser) just does what you'd expect. But if what you are getting back from the server doesn't make any sense in terms of your DOCTYPE (say you are trying to insert raw text into a , rather than trying to insert a , then the browser will just ignore you. It's not a Prototype error, in other words, just the browser being pedantic when being called in a JS update mode. Finally, see if you can get your server to return the HTML of the picker, fully rendered. Then you should be able to do this: new Ajax.updater('parent_element_id', '/server/url', { parameters: { foo: 'bar', ...}, // optional, pass to your server some parameters insertion: 'bottom' // this lets you put the rendered element at the bottom of the existing children of the parent }); If #parent_element_id is a , then the HTML you get from /server/url?foo=bar should be: ... with all of the whitespace removed. Walter > On Jun 22, 2019, at 11:25 AM, Chris Sansom wrote: > > With apologies in advance for the length... > > I retired a few years ago from web development, where I used Prototype quite > a bit in the later years. I'm somewhat rusty now, but I'm trying to do some > development for purely personal use. It won't be on the open web, just on our > local server. It's all been going fine (if slowly!), but now I've hit a brick > wall with Ajax. > > Here's what I'm trying to do: > * I have a form with one or more s, each within its own , all in > the one . > * Each contains the same list of items from a table in a MySQL > database. > * The last has nothing selected and has the class "addselect". > * The idea is that if I select something from that last , an > onChange event is triggered which calls an Ajax script to add a new > (containing the same items). This is set up on page load in a > "document.observe ('dom:loaded', function()..." at the top of the javascript > file. > * Each has a sequential name and id, eg 'name="country[0]" > id="country_0"', the next country[1] and country_1, and so on. The newly > created would have the next name and id in sequence. > I hope that all makes some sense. > > So... > The handler function set up in 'dom:loaded...' gets the next index number for > the name and id of the new , and sends this ('entryindex') and the > name of the table to search ('list') to the Ajax script, and off we go: > > var pars = 'list=' + list + '=' + newIndex; > var url = base + 'ajaxgetmenu'; > > // send request to do the business > var myAjax = new Ajax.Request (url, { > method: 'post', > parameters: pars, > onSuccess: function (req) { > var xml = req.responseText; > ... > > This far, everything is hunkydory. Safari's Web Inspector shows exactly the > correct result - a nice new with the correct name and contents - > under 'XHRs' in its Resources tab. So I know the script is being called and > is operating correctly. But where it falls over is with what comes next: > > var newhtml = > xml.getElementsByTagName('newhtml')[0].firstChild.nodeValue; > > This, incidentally, is taken from a script I developed back in my > professional days which I know worked perfectly. But something is failing > here, cuz it don't work! If I put an alert in ('ok') before this line, it > pops up, but if I put it after this line it doesn't. And yet no errors are > reported. And of course the next line doesn't work either: > > $('thisid').up('ul').insert (newhtml); > > (And I know "$('thisid')" is right because I put that in an alert to check > it.) > > So I simplified it. I abandoned XML and made the result plain text instead, > to be inserted verbatim. Again, the script produces a perfect result in > Safari's Web Inspector, but even when newhtml is plain text (and I skip
Re: [Proto-Scripty] document.write() warnings from Chrome with scriptaculous
> On Mar 5, 2018, at 4:21 PM, Steevithakwrote: > > I'm doing some maintenance on an older site that was developed using > something called prototype.js and scriptaculous. The scriptaculous website > pointed me to this Google group for support. > > When pages load I see lots of warnings from Chrome about document.write() > being used. Like so: > > [Violation] Avoid using document.write() scriptaculous.js:31 > [Violation] Parser was blocked due to
Re: [Proto-Scripty] Image dropping to canvas is not working properly
> On Jul 6, 2016, at 3:32 AM, Manjula Asirwatham> wrote: > > Hi, > > We have an site www.rightgifting.com which customer can create personalized > gifts. we use fabric JS to do the design of the products. But when the > customer crop the image is doesn't fall to canvas at first attempt. if we > refresh the browser and re do the same it is working sometimes. can you > suggest us a solution. If you look in the Web Inspector in Safari (or similar developer console in any other browser) you will see a couple of errors, starting with the missing jQuery 1.8.3 min file. That cascades into a JS reference error "Can't fine variable: exports". I have no idea whether that's relevant to your particular issue (didn't want to hunt around to find the exact page where your canvas drop happens -- could you post a direct link or some directions to reproduce the error?), but in my experience, once you have a JS error in your page, you have a non-trivial chance of having knock-on issues with unrelated scripts in the same page. Try chasing that edge of the problem first, and see if the rest clears up. These sorts of "Heisenbugs" are particularly painful, but if reloading helps, maybe the problem is in a listener that is not being loaded properly, or maybe it's just HTTP gremlins swallowing your resources every once in a while. If you're using pjax or Turbolinks to speed up page loads, you may need to load your script on a different event than dom:loaded, since that will only fire once, when the outer page shell loads for the first time (this is one way to end up with a page that works on reload, but not when you navigate to that page through a link). Walter > > Regards, > Manjula A. > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to prototype-scriptaculous+unsubscr...@googlegroups.com. > To post to this group, send email to prototype-scriptaculous@googlegroups.com. > Visit this group at https://groups.google.com/group/prototype-scriptaculous. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at https://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/d/optout.
Re: [Proto-Scripty] help me with prototype ajax .. request are slow
It's not clear what your goal is. Do you want to reduce the number of requests from the page to your server, as I suggested, or do you want each request to be faster? In you message, you mentioned that I was seeing the faster return because "the cache was on". I can't think of a reason why you would ever want that cache to be off, or what you would gain by having it off. It's hard to see what your problem is, other than the overall design of how the page works (making 1 request per second for as long as the page is loaded). Walter > On Jun 11, 2016, at 7:47 PM, Mahdi Farhat <mahdyfar...@gmail.com> wrote: > > i have sent you an email on > > wal**@wdstudio.com > please reply > > > On Saturday, June 11, 2016 at 9:28:59 PM UTC+3, Walter Lee Davis wrote: > I'm watching it in the Network pane of Safari Web Inspector. It's running at > a total duration of 1.464 ms, but a latency of 159.4 ms. So your server is > replying nearly instantly when it gets the request, but there's a lag while > the message travels to and fro. Overall, this is astoundingly fast. > > What I have seen pages like this do, however, is only update to the server > every few minutes or more, and have the browser's JavaScript update the tick > tock countdown timer independently. Let the local time drift out of synch > with the server, then catch up each time the "heartbeat" connects back to the > server. I can't imagine that this will be as fast when there are hundreds of > visitors connecting at once, constantly pinging every second. > > Walter > > > On Jun 11, 2016, at 1:07 PM, Mahdi Farhat <mahdy...@gmail.com> wrote: > > > > please check li1510-169.members.linode.com > > > > On Saturday, June 11, 2016 at 5:52:02 PM UTC+3, Walter Lee Davis wrote: > > > > > On Jun 10, 2016, at 10:40 AM, Mahdi Farhat <mahdy...@gmail.com> wrote: > > > > > > i asked a developer to develop me a a penny auction script but the > > > request are slow , 300 ms on local machine and 600ms on server > > > can i know why? can you help me? is the code not optimized? > > > > Where are you measuring these times? Is this how long the JavaScript takes > > to execute, or how long the total (request/response/calculating/updating > > page) cycle takes per request? There are a lot of factors that can cause > > Ajax to take time, not many of them come down to the programming within the > > page. > > > > Another question, how many requests are sent by the page? I have only > > glanced over the code, but it may be sending a separate request per item on > > the page, which could get very "chatty" and cause the server to bog down in > > replying to the requests. Have you watched the page in the Developer Tools > > part of your browser? Can you post a link to a sample page showing the > > script in action? > > > > Walter > > > > > > > > > > > > > > function auctionTimer(dt,no,id) > > > { > > > //alert(no); > > > var end = new Date(dt); > > > var now_date= new Date(no); > > > // alert(now_date); > > > // alert(end); > > > var _second = 1000; > > > var _minute = _second * 60; > > > var _hour = _minute * 60; > > > var _day = _hour * 24; > > > flag_time = true; > > > timer = ''; > > > setInterval(function(){showRemaining();},1000); > > > > > > > > > > > > > > > > > > > > > > > > > > > function showRemaining() > > > { > > > var date = no; > > > var now = new Date(date); > > > var de= now.getTime(); > > > > > > if ( flag_time ) { > > > timer = de; > > > } > > > var d = new Date(timer); > > > currentYear = d.getFullYear(); > > > month = d.getMonth()+1; > > > > > > var currentDate = d.getDate(); > > > currentDate = currentDate < 10 ? '0'+currentDate : > > > currentDate; > > > > > > var hours = d.getHours(); > > > var minutes = d.getMinutes(); > > > var seconds = d.getSeconds(); > > > > > > // var ampm = ho
Re: [Proto-Scripty] help me with prototype ajax .. request are slow
I'm watching it in the Network pane of Safari Web Inspector. It's running at a total duration of 1.464 ms, but a latency of 159.4 ms. So your server is replying nearly instantly when it gets the request, but there's a lag while the message travels to and fro. Overall, this is astoundingly fast. What I have seen pages like this do, however, is only update to the server every few minutes or more, and have the browser's JavaScript update the tick tock countdown timer independently. Let the local time drift out of synch with the server, then catch up each time the "heartbeat" connects back to the server. I can't imagine that this will be as fast when there are hundreds of visitors connecting at once, constantly pinging every second. Walter > On Jun 11, 2016, at 1:07 PM, Mahdi Farhat <mahdyfar...@gmail.com> wrote: > > please check li1510-169.members.linode.com > > On Saturday, June 11, 2016 at 5:52:02 PM UTC+3, Walter Lee Davis wrote: > > > On Jun 10, 2016, at 10:40 AM, Mahdi Farhat <mahdy...@gmail.com> wrote: > > > > i asked a developer to develop me a a penny auction script but the request > > are slow , 300 ms on local machine and 600ms on server > > can i know why? can you help me? is the code not optimized? > > Where are you measuring these times? Is this how long the JavaScript takes to > execute, or how long the total (request/response/calculating/updating page) > cycle takes per request? There are a lot of factors that can cause Ajax to > take time, not many of them come down to the programming within the page. > > Another question, how many requests are sent by the page? I have only glanced > over the code, but it may be sending a separate request per item on the page, > which could get very "chatty" and cause the server to bog down in replying to > the requests. Have you watched the page in the Developer Tools part of your > browser? Can you post a link to a sample page showing the script in action? > > Walter > > > > > > > > > function auctionTimer(dt,no,id) > > { > > //alert(no); > > var end = new Date(dt); > > var now_date= new Date(no); > > // alert(now_date); > > // alert(end); > > var _second = 1000; > > var _minute = _second * 60; > > var _hour = _minute * 60; > > var _day = _hour * 24; > > flag_time = true; > > timer = ''; > > setInterval(function(){showRemaining();},1000); > > > > > > > > > > > > > > > > > > function showRemaining() > > { > > var date = no; > > var now = new Date(date); > > var de= now.getTime(); > > > > if ( flag_time ) { > > timer = de; > > } > > var d = new Date(timer); > > currentYear = d.getFullYear(); > > month = d.getMonth()+1; > > > > var currentDate = d.getDate(); > > currentDate = currentDate < 10 ? '0'+currentDate : > > currentDate; > > > > var hours = d.getHours(); > > var minutes = d.getMinutes(); > > var seconds = d.getSeconds(); > > > > // var ampm = hours >= 12 ? 'PM' : 'AM'; > > // hours = hours % 12; > > // hours = hours ? hours : 12; // the hour ’0′ should be > > ’12′ > > minutes = minutes < 10 ? '0'+minutes : minutes; > > seconds = seconds < 10 ? '0'+seconds : seconds; > > var strTime = hours + ':' + minutes+ ':' + seconds; // + ' > > ' + ampm; > > timer = timer + 1000; > >var now_time = currentYear+'/' + month+'/' + currentDate + ' > > ' + strTime ; > > > > // document.getElementById("demo1").innerHTML= > > currentMonth1+' ' + currentDate+' , ' + currentYear + ' ' + strTime ; > > > > // document.getElementById("demo2").innerHTML= > > currentDate+':' +(month+1)+':' +currentYear + ' ' + strTime ; > > > > // document.getElementById("demo3").innerHTML= strTime ; > > > > // document.getElementById("demo4").innerHTML= current_day > > + ' , ' +currentMonth1+' ' + currentDate+' , ' + currentYear +
Re: [Proto-Scripty] help me with prototype ajax .. request are slow
> On Jun 10, 2016, at 10:40 AM, Mahdi Farhatwrote: > > i asked a developer to develop me a a penny auction script but the request > are slow , 300 ms on local machine and 600ms on server > can i know why? can you help me? is the code not optimized? Where are you measuring these times? Is this how long the JavaScript takes to execute, or how long the total (request/response/calculating/updating page) cycle takes per request? There are a lot of factors that can cause Ajax to take time, not many of them come down to the programming within the page. Another question, how many requests are sent by the page? I have only glanced over the code, but it may be sending a separate request per item on the page, which could get very "chatty" and cause the server to bog down in replying to the requests. Have you watched the page in the Developer Tools part of your browser? Can you post a link to a sample page showing the script in action? Walter > > > > function auctionTimer(dt,no,id) > { > //alert(no); > var end = new Date(dt); > var now_date= new Date(no); > // alert(now_date); > // alert(end); > var _second = 1000; > var _minute = _second * 60; > var _hour = _minute * 60; > var _day = _hour * 24; > flag_time = true; > timer = ''; > setInterval(function(){showRemaining();},1000); > > > > > > > > > function showRemaining() > { > var date = no; > var now = new Date(date); > var de= now.getTime(); > > if ( flag_time ) { > timer = de; > } > var d = new Date(timer); > currentYear = d.getFullYear(); > month = d.getMonth()+1; > > var currentDate = d.getDate(); > currentDate = currentDate < 10 ? '0'+currentDate : > currentDate; > > var hours = d.getHours(); > var minutes = d.getMinutes(); > var seconds = d.getSeconds(); > > // var ampm = hours >= 12 ? 'PM' : 'AM'; > // hours = hours % 12; > // hours = hours ? hours : 12; // the hour ’0′ should be ’12′ > minutes = minutes < 10 ? '0'+minutes : minutes; > seconds = seconds < 10 ? '0'+seconds : seconds; > var strTime = hours + ':' + minutes+ ':' + seconds; // + ' ' > + ampm; > timer = timer + 1000; >var now_time = currentYear+'/' + month+'/' + currentDate + ' ' > + strTime ; > > // document.getElementById("demo1").innerHTML= > currentMonth1+' ' + currentDate+' , ' + currentYear + ' ' + strTime ; > > // document.getElementById("demo2").innerHTML= > currentDate+':' +(month+1)+':' +currentYear + ' ' + strTime ; > > // document.getElementById("demo3").innerHTML= strTime ; > > // document.getElementById("demo4").innerHTML= current_day + > ' , ' +currentMonth1+' ' + currentDate+' , ' + currentYear + ' ' + strTime ; > > > > // alert(now_time); > > var now = new Date(now_time); > > // alert(now); > var distance = end - now; > > if (distance < 0) { > if (distance>-3) > { > location.reload(true); > return; > }; > > clearInterval(timer); > document.getElementById('countdown_'+id).innerHTML = 'Sold'; > document.getElementById('bid-box').hide(); > document.getElementById('auction_watcher').hide(); > toggleDisabled(document.getElementById('bid-box')); > toggleDisabled(document.getElementById('auction_watcher')); > document.getElementById('watcher_url').removeAttribute('href'); > return; > } > var days = Math.floor(distance / _day); > var hours = Math.floor((distance % _day) / _hour); > var minutes = Math.floor((distance % _hour) / _minute); > var seconds = Math.floor((distance % _minute) / _second); > if (days <10) > {days = '0' + days;} > if (hours <10) > {hours = '0' + hours;} > if (minutes < 10) >{ minutes = '0' + minutes;} > if (seconds < 10) > {seconds = '0' + seconds; } > if(days==00) > { > dytext = ''; > > } > else if(days==1) > { > dytext = ''+ days +' Day '; > > } > else > { > dytext = ''+ days +' Days > '; > } > if(hours==00) { > hrtext=''; > } > else { >
Re: [Proto-Scripty] Does prototype.js support any design pattern?
On Nov 9, 2015, at 2:01 AM, Amit Dwivediwrote: > Hi, > As far as i know, prototype.js is a framework based on OO(correct me if i m > wrong). we can write a new class in java script which can extend the behavior > of existing one. My question is...Is it support some sort of Design Pattern > (like MVC). > One more thing if we want to add new features by using prototype.js, is > it easily pluggable. Prototype is a foundation toolkit, which starts with the premise that JavaScript needs some help to become the great OO language it could be. It extends the language in useful ways, making it possible to write good code quickly, with useful shortcuts and mental models. The next great thing that it does is spackle over the (thankfully shrinking) mountain of differences between various browsers' JS implementations, giving you a single stable API to write to. Finally, it provides useful core tools to build applications that extend the DOM or communicate out of band with the server using Ajax. I like to think of it as "a tool that can build tools", which appeals to this grandson of a tool-and-die maker very much. It's much less a plug-in support mechanism, which I liken jQuery to, than a better way to write and reason about JavaScript applications in browsers. I like to say that "I could build jQuery in Prototype, but not the other way around". So to answer your main question, no, there isn't any MVC framework that I know of that is based upon Prototype, but if you had a good reason to build one, it would make the process much simpler and widely runnable than if you stuck to vanilla JS. Walter > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to prototype-scriptaculous+unsubscr...@googlegroups.com. > To post to this group, send email to prototype-scriptaculous@googlegroups.com. > Visit this group at http://groups.google.com/group/prototype-scriptaculous. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/d/optout.
Re: [Proto-Scripty] Change $ to $p or $proto in prototype.js
The framework doesn't provide any tools to enable that, but you could fork it and do that I suppose. You may have a larger issue because Prototype extends the prototype (small p) of a lot of different parts of the JavaScript language, and some of these changes mean that sloppily-written code will error out rather than sorta work. Iterating over an object with for .. in will also iterate over all of the methods that Prototype adds to every object, for example. This is fine if you have a normal object, but an Array is also an object, and it gets a bunch of new methods added to it as well. This breaks assumptions that code written in the absence of Prototype may be relying on to work at all. Walter On Oct 22, 2015, at 1:58 AM, Amit Dwivediwrote: > Hi, > Can we change $ in prototype.js to something else like $p or $proto > > Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to prototype-scriptaculous+unsubscr...@googlegroups.com. > To post to this group, send email to prototype-scriptaculous@googlegroups.com. > Visit this group at http://groups.google.com/group/prototype-scriptaculous. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/d/optout.
Re: [Proto-Scripty] active elements
http://jsfiddle.com is free for anyone to use. One of the benefits of making a cut-down example is that often, in the process of making a failing example, you'll uncover the previously unrelated reason for the failure. Walter On Sep 3, 2014, at 4:15 AM, Иван Иванов wrote: Unfortunately I do not have a hosting. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/d/optout.
Re: [Proto-Scripty] active elements
Can you post a link to a page or fiddle that shows the problem in situ? Walter On Aug 28, 2014, at 4:18 AM, Иван Иванов wrote: Yes, I tried. Nothing changed. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/d/optout.
Re: [Proto-Scripty] Event.observe
Assuming that you put script tags around the JavaScript, and include prototype in your page head, it does. One thing you may be overlooking is source code order. If your script tag (containing this handler) occurs in the page head, then the input#login will not exist yet at the time that the handler goes looking for it (at the moment that the script is first read). There are two ways around this. 1. (in the page head) document.observe('dom:loaded', function(){ // your script here }); 2. (also in the page head) document.on('click', '#login', function(evt, elm){ alert('t2') }); Oh, and for completeness, 3. (somewhere after input id=login appears in the source, like at the line before /body) // your script, unmodified Walter On Jul 14, 2014, at 2:33 AM, Иван Иванов wrote: Hi Team, input id=login type='submit' value='login' / Event.observe(login, click, function(){ alert(t2); }); Why don't work? Thanks -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/d/optout.
Re: [Proto-Scripty] Math.Random Eval usage in prototype.js
On Jul 3, 2014, at 6:13 AM, Mahendran Pandian wrote: Hi Team, we are using prototype.js for past 8 years in our product development, Recently our organization introduced code scanner(HP Fortify) to verify any code vulnerable in the product. The scanner identified as prototype.jsscript.aculo.us uses eval and math.rondom, with is insecure. Can we able to remove/drop the usage of those functions in prototype.js? or is there any alternative way to achieve without using those functions? Prototype uses eval in a few places, notably in the Ajax callbacks to instantiate embedded scripts (evalScripts: true). I think that it may use it when building up a JSON callback, too, but I haven't toured that part of the code recently enough to tell you for certain. I recommend you read through the source from top to bottom, identify the spots where eval is used (not many, IIRC) and see if they intersect your usage of the library. Try commenting them out and see what happens to your code. That's the only way to be sure. Prototype is a largish library, and it stands to reason that nobody uses all of it all the time. By the way, blindly grepping for `eval` is a fairly naive way to do security. If your program sanitizes its inputs, there's no harm in evaluating those inputs, in my opinion. Walter Thanks, Mahendran.. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/d/optout.
[Proto-Scripty] What's the difference between fire() and whatever turbo links does?
I'm trying to observe the page:load event fired by turbo links, and it's not working for me. When the body is replaced by turbo links in Rails 4.1, it's supposed to fire the page:load event at the very end. But this works: document.addEventListener('page:load', decorate_markdown); while this: document.observe('page:load', decorate_markdown); does not. I haven't found anything conclusive about this on Google or the GitHub issues for Turbolinks. Other people have complained about the integration with jQuery's ready() method, so I suspect there is something funny here. Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/d/optout.
[Proto-Scripty] Is there any way to cancel an Ajax request once it's been issued?
I've looked through the API a couple of different times, and I can't see a way to do that. I've tried assigning a variable to it: var foo = new Ajax.Request() but re-assigning foo to point to a different request doesn't stop the first one -- it carries on like it was still there, and chews up server resources. I've read through the source, and there's nothing there about stopping the request that I can see. Any ideas? Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/d/optout.
Re: [Proto-Scripty] Is there any way to cancel an Ajax request once it's been issued?
That doesn't seem to do anything -- Rails keeps on chugging along and returning the stuff for the previous request. It's only an issue because these are massive requests, they take many seconds each to finish, and if you click on a link to load a really large one, then click on a link to load a smaller one, the smaller one would load first, then the larger one would wipe it out. I've already worked around that with a semaphore, but I'd really like to tell the server to quit trying! Walter On Apr 15, 2014, at 9:42 PM, Jason Westbrook wrote: You can call .abort() on the transport property of Ajax, its part of the internal xmlhttprequest object https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest so for var foo = new Ajax.Request() foo.transport.abort(); but YMMV as the server might still continue to process the request and the abort() might only kill the callbacks but not the process in the server. Jason Westbrook | T: 313-799-3770 | jwestbr...@gmail.com On Tue, Apr 15, 2014 at 6:13 PM, Walter Lee Davis wa...@wdstudio.com wrote: I've looked through the API a couple of different times, and I can't see a way to do that. I've tried assigning a variable to it: var foo = new Ajax.Request() but re-assigning foo to point to a different request doesn't stop the first one -- it carries on like it was still there, and chews up server resources. I've read through the source, and there's nothing there about stopping the request that I can see. Any ideas? Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/d/optout.
Re: [Proto-Scripty] simple logging in website with Prototype
Where would these credentials be stored? That's the key to your problem. Setting the value is trivial with $('elementID').setValue('whatever'); Walter On Jan 30, 2014, at 5:51 AM, Tommaso Ferrara wrote: Hi, I would like to use Prototype to make a logging (for example, to email Yahoo https://login.yahoo.com/config/login_verify2?.intl=us.src=ym;). There are examples, fill the fields username / pass automatically to login? Basically I would like to replicate what browsers are automatically remembering the pass. Thanks. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Autocompleter and IE11
On Jan 7, 2014, at 1:04 PM, Andy Wallace wrote: Thanks, Walter, we'll take a look. I was hoping to find a way to fix this one - it looks like IE11 is grabbing the mouseclick event before it gets down to the Autocompleter itself. SIgh. Thanks again, Microsoft. andy Firefox used to do this same thing as well, it's not just IE (mind you, this was when FF was in single-digit version numbers -- we're talking years). Clicks on the chrome (the elevator track and thumb generated by the browser) are not registered as being on the floating element, and since the behavior of Scripty's AC widget is to interpret a click anywhere but on itself as a signal to close the overlay, that's what happens. I forget how I worked around that years ago when I first encountered it in FF. Walter On Monday, January 6, 2014 7:51:48 PM UTC-8, Walter Lee Davis wrote: Here's a replacement I wrote a while back. It's mostly a drop-in replacement for the one in Scriptaculous, although it probably lacks some of the fit and polish of the original. It doesn't suffer from the scrolling issue because it doesn't provide a scrollbar. You may want to experiment with that approach. I find that it's also a good idea to make the server limit the number of suggestions, so you don't so much need to scroll at all. https://gist.github.com/walterdavis/8294372 Walter On Jan 6, 2014, at 8:12 PM, Andy Wallace wrote: I'm having an issue with IE11 and the autocompleter. It only shows up with IE11, all other browsers (including other versions of IE) are working fine... The problem is that, once the drop-down of selections appears, if you click on the scrollbar in any way, it disappears. You can see it on this test site: http://cis-test--of-enom.com In the lower part of the photograph, you'll see City:. Type in the letter a, or click on the down arrow, and the list appears. If you then click on the scrollbar, the list disappears. Selecting from the list works, and if you click on the scroll bar to scroll the list down, and then click on the down arrow, the list reappears in the correct position. There is a function defined in the code hide:, which I have discovered is getting called. Version info: script.aculo.us controls.js v1.9.0 prototype 1.7 It's non-trivial to update my versions, so if there is an alternative, I'd rather use that in the short run. Thanks, Andy awal...@cisdata.net -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-s...@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Autocompleter and IE11
Here's a replacement I wrote a while back. It's mostly a drop-in replacement for the one in Scriptaculous, although it probably lacks some of the fit and polish of the original. It doesn't suffer from the scrolling issue because it doesn't provide a scrollbar. You may want to experiment with that approach. I find that it's also a good idea to make the server limit the number of suggestions, so you don't so much need to scroll at all. https://gist.github.com/walterdavis/8294372 Walter On Jan 6, 2014, at 8:12 PM, Andy Wallace wrote: I'm having an issue with IE11 and the autocompleter. It only shows up with IE11, all other browsers (including other versions of IE) are working fine... The problem is that, once the drop-down of selections appears, if you click on the scrollbar in any way, it disappears. You can see it on this test site: http://cis-test--of-enom.com In the lower part of the photograph, you'll see City:. Type in the letter a, or click on the down arrow, and the list appears. If you then click on the scrollbar, the list disappears. Selecting from the list works, and if you click on the scroll bar to scroll the list down, and then click on the down arrow, the list reappears in the correct position. There is a function defined in the code hide:, which I have discovered is getting called. Version info: script.aculo.us controls.js v1.9.0 prototype 1.7 It's non-trivial to update my versions, so if there is an alternative, I'd rather use that in the short run. Thanks, Andy awall...@cisdata.net -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out.
[Proto-Scripty] Show of hands
It's been mighty quiet here, and I'm wondering if everyone just knows how to use Prototype, and doesn't have any questions, or if you've all defected to the Dark Side. Happy New Year, Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] documentation server down???
Apparently. Walter On Nov 6, 2013, at 12:09 PM, Worth Lutz wrote: I cannot get to : http://api.prototypejs.org/ Is the server down? Worth Luz -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] documentation server down???
I reached out to Sam Stephenson via Twitter, he has opened a ticket with Rackspace to fix this. Walter On Nov 6, 2013, at 12:25 PM, Walter Lee Davis wrote: Apparently. Walter On Nov 6, 2013, at 12:09 PM, Worth Lutz wrote: I cannot get to : http://api.prototypejs.org/ Is the server down? Worth Luz -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] documentation server down???
Documentation is back! Walter On Nov 6, 2013, at 2:41 PM, Walter Lee Davis wrote: I reached out to Sam Stephenson via Twitter, he has opened a ticket with Rackspace to fix this. Walter On Nov 6, 2013, at 12:25 PM, Walter Lee Davis wrote: Apparently. Walter On Nov 6, 2013, at 12:09 PM, Worth Lutz wrote: I cannot get to : http://api.prototypejs.org/ Is the server down? Worth Luz -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Scroll not working on mobile devices
Oh, I see. Yes, the Scriptaculous Control.Scrollbar does not respond to touch events. You have a couple of options. First, you could extend that control to map touchStart and touchEnd at different coordinates to be same as mouseDown and mouseUp at different coordinates. This is going to be fussy, because you also need to track whether the touch start/end resulted in the viewport moving or not. You could also use feature detection to turn off your custom scroll area and use CSS to turn on the one that the platform gives you natively. Of the two, that would be my personal choice. Walter On Aug 23, 2013, at 4:40 AM, Peter Gavrilov wrote: Sure thing, i have prepared the example: http://www.peteforpresident.cc/scroll -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Error: Support for eval(code, scopeObject) has been removed. Use |with (scopeObject) eval(code);| instead.
Can you show an example where this fails? I just used this feature with 1.7.1, and you had me scared, so I just double-checked on the latest Firefox. I don't see any errors coming from evalScripts() there. Perhaps the issue is the type of function you are evaluating? Perhaps there is another level of indirection added outside the evalScripts method, and you don't need to provide it yourself as you have done. Walter On Aug 23, 2013, at 9:01 AM, javi68yt2 wrote: Hello all Please, excuseme my very bad English. I'm using a legacy version of prototype.js (1.4.0) and I cannot upgrade yet. Since I've upgraded FF to the last version (23.0 beta), my scripts fail with above message when I issue: new Ajax.Updater(destiny, URL, {evalScripts: 'yes' }); After googling a lot, I've fixed : evalScripts: function() { return this.extractScripts().map(eval); }, like this: evalScripts: function() { return this.extractScripts().map(function(script) { with(this){ return eval(script);} }); // function(script) came from v1.5.0, the rest is suggested by FF }, PS: Sorry for this naive solution or if it is fixed in some other place but in last version of prototype.js (1.7.1) still remains: function evalScripts() { return this.extractScripts().map(function(script) { return eval(script); }); } Does this help someone else? Cheerio! -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] ajax call
If you are creating the form in the page after it loads, the observer has to be created after the form, in order to bind to that DOM object. The way around this is to use the on() function to register a deferred listener. I am on my phone, so I can't test this, but try this: document.on('submit', '#myform', function(evt, elm){ //your code here }); Walter On Jul 22, 2013, at 10:54 AM, Agnese Camellini agnese.camell...@gmail.com wrote: Hello, i'm writing a form which i have to process in javascript (ajax). The problem is i probably read too many manuals online and offline so i have a bit of confusion in mind i should sort out some way. The thing is that my form is generated by a json file (i'm using Tornado, so i'm reading the json file in python and passing it to the web page when rendered to build the form). Now the form has to be processed by an ajax function and this is where it gets tricky for me. i'm pasting the code written for now, there are two type of ajax call written and i haven't tried to see if it work cause i'm not undestanding what to do, so i've only tried to fill the variables written in the examples online tring to undestand how it works. The code is here below: html head meta http-equiv=Content-Type content=text/html; charset=utf-8/ link rel='stylesheet' type='text/css' href='/static/style.css'/ script var lin={% raw line %} function str_to_obj(o){ document.write('bodydiv id=up-bar/divdiv id=logoimg class=logo src=/static/logo-admantx.png alt=logo/divform id=myform action=/myform/ method=post') document.write('div id=myFormContainer') for(item in o.Form) { document.write(o.Form[item].Description + ' brhrbr'); for(i in o.Form[item].Response){ document.write('label for=' + o.Form[item].Response[i].Name + ''); document.write('input type=radio name=message' + item +' value=' + o.Form[item].Response[i].Name + '' + o.Form[item].Response[i].Name + '/labelbr'); }; }; document.write('input type=submit value=Submit/div/form') }; str_to_obj(lin); /script script type=text/javascript src=/static/prototype.js/script script _ # First example Event.observe('myform', 'submit', function(event) { $('myform').request({ onFailure: function() { },#what should i write here? onSuccess: function(t) { $('myAdmantContainer').update(t.responseText);#where should i set responseText? } }); Event.stop(event); // stop the form from submitting }); #second example function chiam-ajax() { var url = '/myform/'; var pars = document.forms[0].message0.value + '' + document.forms[0].message1.value ; var target = 'myAdmantContainer'; var myAjax = new Ajax.Updater(target, url, {method: 'post', parameters: pars}); }; /headdiv id=myAdmantContainer/div/body/html Does anyone have a vague idea of what to do? Agnese -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] addClassName and removeClassName don´t work
I On Jul 17, 2013, at 3:37 PM, Joseph Lust wrote: Ran into this issue on Prototype 1.5.1 and IE8. Is there a specific reason you are using such an old (years!) version of Prototype? 1.7.1 is current, and even it is getting a little long in the tooth. The error is in the array without() function in IE8. without() should return an empty array if the array sans element is empty, or the array with that element removed. In IE8, if there are no elements left in the array after the target element is removed, undefined is returned, breaking anything chained after that. remove: function(classNameToRemove) { if (!this.include(classNameToRemove)) return; this.set($A(this).without(classNameToRemove).join(' ')); }, Are you trying to get an array of classnames from an element, or are you trying to remove a class from an element? Because there's the Element#removeClassName if the latter. It does pretty much what you do here, except it returns an extended element, not an array of strings. You could get the former with this: $(this).removeClassName(classNameToRemove).className.toString().split(/\s+/); Walter The actual source was that without() internally uses each() to iterate across the elements, but the DOMAssistant library have overwritten Element.each(). The new version could not catch the breaks that are thrown by Prototype to escape from deep nested iterators, and hence the error. Thus, the two libs should not be used in conjunction. It seems that other browsers don't overwrite the Element.each() method when loading the two libs like IE does. Sincerely, Joseph -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] addClassName and removeClassName don´t work
Wow. I wonder why it just this minute came up for moderation? That's Google Groups for you... Walter On Jul 17, 2013, at 4:12 PM, Jansen Nunes wrote: Hi My post is older(2010) and my project is finished now. Tks for all. Regards 2013/7/17 Walter Lee Davis wa...@wdstudio.com: I On Jul 17, 2013, at 3:37 PM, Joseph Lust wrote: Ran into this issue on Prototype 1.5.1 and IE8. Is there a specific reason you are using such an old (years!) version of Prototype? 1.7.1 is current, and even it is getting a little long in the tooth. The error is in the array without() function in IE8. without() should return an empty array if the array sans element is empty, or the array with that element removed. In IE8, if there are no elements left in the array after the target element is removed, undefined is returned, breaking anything chained after that. remove: function(classNameToRemove) { if (!this.include(classNameToRemove)) return; this.set($A(this).without(classNameToRemove).join(' ')); }, Are you trying to get an array of classnames from an element, or are you trying to remove a class from an element? Because there's the Element#removeClassName if the latter. It does pretty much what you do here, except it returns an extended element, not an array of strings. You could get the former with this: $(this).removeClassName(classNameToRemove).className.toString().split(/\s+/); Walter The actual source was that without() internally uses each() to iterate across the elements, but the DOMAssistant library have overwritten Element.each(). The new version could not catch the breaks that are thrown by Prototype to escape from deep nested iterators, and hence the error. Thus, the two libs should not be used in conjunction. It seems that other browsers don't overwrite the Element.each() method when loading the two libs like IE does. Sincerely, Joseph -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- Jansen -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Prototype Slider not sliding in IE8, 9 and 10
Looking at your code, I can think of a much simpler way to construct this form than using the slider control: http://scripty.walterdavisstudio.com/color-picker.html The same script could be extended to include your fading tooltips and pretty much all the rest of the UX I see here. It would have the further benefit that it would fall back and work without scripting -- all you'd need to do is hide the input[type=radio] elements with JavaScript rather than CSS. Walter On Jun 20, 2013, at 7:39 AM, kako...@gmail.com wrote: Hi i a using an example from http://preview.moveable.com/jm/jameslab/superslider/ but where I have made some changes to the layout and look, http://webdev.brownsmart.co.uk/mwh/evaluate-yourself but it does not slide in IE (all versions) I tried updating the versions of the Prototype.js and Scriptaculous.js which allow customised version to show, (only changes have been in HTML CSS and range values in the javascript) but it will not slide to the values, in IE (all versions) Has anyone come across this problem in previous use of Prototype.js and Scriptaculous.js ?? I think it has something to do with the use of multiple sliders, (going to test my theory on this now) but any other suggestions would be helpful. Thanks. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Date and Time Picker Prototype JavaScript framework, version 1.6.0.2 (c) 2005-2008 Sam Stephenson
This list is for the Prototype JavaScript framework, not the Date Time picker itself. Can you post a link to the picker code? Someone here may be able to help you with your specific query. Walter On Jun 17, 2013, at 6:16 AM, Carmela Ward wrote: I want to stop future time selection when a user picks the time eg today is 17/6/13 and time is 6.00am I need to stop the selection of 17/6/13 6.01am or any time after that. Note I am only using the time picker in my form Would appreciate any help you can give me Kind Regards -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Uhh... is this a bug?
On Jun 9, 2013, at 12:59 PM, Phil Petree wrote: This just seems really, really odd... THATS where they decide to draw the line? LOL I believe this architectural decision was made at a time in history when introspecting the CSS cascade to discover if an element was actually visible at the moment was really slow in JavaScript, or really complex from a cross-browser perspective. There is also the legacy of Rails' RJS system to consider here. (I've been on this list long enough to remember when it was called rubyonrails-spinoffs or something like that.) A lot of the core assumptions of this library have their basis in how Rails 1.x decided Web2.0 should look and behave. I don't know the exact source of this decision, but I have had it cited as gospel to me in the past. Just kicking that can down the road... Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Function.bind() performance vs native
I believe that the plan all along w/r/t these new JS-core features has been to prefer the native implementation where available and compatible, and leave the Prototype method as a polyfill for older browsers. I don't believe that Prototype currently behaves this way, but the last time I heard anything official on this list about the future of Prototype, that was one of the things mentioned. BTW, what browser were you using when you tested this? In Safari.latest Mac OS X, I see Prototype winning, and native 17% slower. Walter On Jun 3, 2013, at 5:44 PM, Jason wrote: ECMA 5 introduced Function.prototype.bind() which is similar to the PrototypeJS version that binds the context to the function. In a class scope you can bind the this variable in the function scope to the this of the class. Here is a performance test between those 2 http://jsperf.com/native-function-bind-versus-prototype-js Higher numbers are better as that is the number of operations per second and the native bind() method is higher? Anyone have any insight? Thanks all! -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Help system
This would be pretty easy to do. Prototype gives you lots of tools to make this possible, the bulk of this effort would probably go into the CSS to style your tooltips. On May 30, 2013, at 11:30 AM, Phil Petree wrote: Has anyone developed an inline help system? Am I barking up the wrong tree or is there an easier way to do this? Ideally we could just drop the div in anywhere we wanted, the help icon would always float to the right of the label/input and when the user clicked the help icon we'd get a context sensitive help solution. I was thinking of something that could be built off a div like this: prototype: document.observe(dom:loaded, function() { $$('div.help').each(function(item) { item.observe('onclick', function() { This would be item.observe('click' ... you never use the 'on' part in Element/Event.observe. // get items id item.id or item.readAttribute('id') // use ajax call to get help info from server // populate div // apply pop-up class new Ajax.Updater('theDivId', '/url/to/help/system', { parameters: {id: theIdYouGotAbove}, onSuccess: function(){ item.addClassName('tooltip'); } }); // set handler to process dismiss click () { // delete context help // restore help class }; document.on('click', 'div.tooltip', function(evt, elm){ elm.update().removeClassName('tooltip'); }); The on handler is really helpful, it can manage elements that weren't in place when the page loaded. One handler to rule them all, not a separate handler per tooltip. }); }); }); html: div class='help' id='topic'/div css: .help {?} .popup-help {?} .icon-help {background: #fff url(images/icons/help_32x32.png) top left no-repeat;} Hope this helps, Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Help system
I think you could make the whole thing pretty simply. Rather than creating a separate handler (with each()) for each .help element, you could wrap the entire thing in one on handler, which you would not need to customize per page or worry about dom:loaded or anything: document.on('click', '.help', function(evt, elm){ var tip = elm.down('div'); new Ajax.Updater(tip, 'path/to/help', { parameters: {id: elm.id}, onCreate: function(){ tip.addClassName('loading'); }, onSuccess: function(){ tip.removeClassName('loading'); tip.addClassName('tooltip'); } }); }); document.on('click', '.tooltip', function(evt, elm){ evt.stop(); elm.update().removeClassName('tooltip'); }); That's expecting a structure like this: div class=help id=widget_1div/div/div You could use some other construction if you like, but that would do the trick. The rest will be creating the CSS for the tooltip, and the Web service to fill it in. If you didn't want to get the Ajax thing going, you could also just put the tooltip in the help element itself, maybe in a data-attribute. That depends on how much content there would be. It would be completely instantaneous. Walter On May 30, 2013, at 2:24 PM, Phil Petree wrote: I'll play around with it on Sunday and see what I can cobble together... of course it looks like you did most of the work in 5 minutes and I'll spend most of the day playing around with it! LOL -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] finding all tr's within a div
On May 17, 2013, at 12:19 PM, Phil Petree wrote: I'm expanding the table row highlighting ya'll helped me with before. Now I have two tables on a page and each table has rows that I want to highlight on mouseover. Can't give the tables the same id so what I was doing was creating a div with a class: table class='blah' id='blah' ... trthCol 1/thth col 2/th/tr div class='row_highlight' trtdData 1/tdtdData 2/td/tr trtdData 1/tdtdData 2/td/tr trtdData 1/tdtdData 2/td/tr /div /table In prototype I'm trying: $$('div.row_highlight tr').each(function(item) { item.observe('mouseover', function() { item.addClassName('over'); }); item.observe('mouseout', function() { item.removeClassName('over'); }); }); $$ is returning null... not even getting to the item.observe Obviously, I'm doing something wrong here... googled around and most people seem to be doing it the way I am... what am I missing? You can't nest a div inside a table like this. JavaScript (not just Prototype) has no tolerance for malformed HTML. Browsers handle it perfectly (for certain definitions of perfectly) but scripts rely on you getting the HTML right before you start horsing around with the DOM. The simplest way to do what you're describing here is to make your HTML valid, and add a new set of valid tags that you're not currently using: thead and tbody. table class=row_highlight thead tr thHead one/ththHead two/th /tr /thead tbody tr tdCol one/tdtdCol two/td /tr ... many more rows here ... /tbody /table Now, all you need to get the table rows to highlight is this: $$('.row_highlight tbody tr').each(function(item){ ... your code here ... }); See how that works? Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Draggables inside div with overflow:scroll
On May 7, 2013, at 7:30 AM, ayson...@gmail.com wrote: I have created two divs. One is for draggable objects. Another for the area where they should be dropped. The both divs should have the same height and if there are large number of draggables to have scrollbar. When I add overflow: scroll to the div with draggable objects, then drag-and-drop functionality is screwed up. Please see an example here http://jsfiddle.net/nB8PC/1/ To reproduce my issue just enable overflow:scroll in CSS window (upper right, it is commented out) and run the script again. Is there any solution for it? I have fixed this in the past by making the overflow property on a parent element (letting the draggable element itself be scrolled in its entirety within that parent). Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Newbie using Ajax.Request to perl script - script works but continues to return 500 status
On Apr 30, 2013, at 3:02 PM, joz...@sonic.net wrote: Hello to all, This is my code and the call does complete and the back end perl script updates the database but I continue to get a onFailure - not sure how to troubleshoot this. I have changed method to post and it works for a bit then begins to fail again. At present it is failing with 500 every time but the actual code being called is working perfectly. Thanks any and everyone who can give me a bit of guidance function get_update_odometer(vehicle_key,odometer_value){ var url = [%Catalyst.uri_for('/invoice/dispatch_util/get_update_odometer')%]; new Ajax.Request(url, { method: 'get', parameters: { key: vehicle_key, ovalue: odometer_value }, asynchronous:false, onSuccess: successFunc, onFailure: failureFunc }); var return_v = $('rcontainer').innerHTML; document.getElementById('odometer').value = return_v; return true; } function successFunc(response){ if (200 == response.status){ var container = $('rcontainer'); var content = response.responseText; container.update(content); } } function failureFunc(response){ alert(Call has failed + response.status ); } I'm not familiar with Catalyst, but is it setting a 200 header or similar with your return? You may want to emit a couple of spaces or similar, just to force the issue. Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Prototype in no conflict mode
On Apr 29, 2013, at 8:54 AM, Alastair Young alastair.yo...@gmail.com wrote: I need to move my code (Prototype 1.7.1) into someone else's much larger project using jQuery v1.5.1. Can I load Prototype in no-conflict mode ? I can't change any of the jQuery stuff. Not as far as I know. The issue as I understand it is that Prototype extends the (lower-case) prototype of a number of JS primitives, and these extensions are an issue for jquery, over and above the simple name collision between $ in both libraries. Can you modify the HTML? You may be able to inject the jquery noConflict() function call in between the link to jquery and the subsequent links to various scripts and plugins that rely on it. That still won't fix things if those scripts are written in a style that doesn't expect to be in the presence of noConflict, though. Walter Thanks -alastair -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Prototype in no conflict mode
On Apr 29, 2013, at 9:22 AM, Alastair Young alastair.yo...@gmail.com wrote: I can't modify the HTML - I fear my only solution is port all my code to jQuery Before you do that, try this. Download a copy of the prototype source cod locally, and use find-and-replace to substitute another character, like the underscore, for $. Do the same in a fork of your code. See if that does anything useful. It may. Walter On 29 April 2013 17:05, Walter Lee Davis wa...@wdstudio.com wrote: On Apr 29, 2013, at 8:54 AM, Alastair Young alastair.yo...@gmail.com wrote: I need to move my code (Prototype 1.7.1) into someone else's much larger project using jQuery v1.5.1. Can I load Prototype in no-conflict mode ? I can't change any of the jQuery stuff. Not as far as I know. The issue as I understand it is that Prototype extends the (lower-case) prototype of a number of JS primitives, and these extensions are an issue for jquery, over and above the simple name collision between $ in both libraries. Can you modify the HTML? You may be able to inject the jquery noConflict() function call in between the link to jquery and the subsequent links to various scripts and plugins that rely on it. That still won't fix things if those scripts are written in a style that doesn't expect to be in the presence of noConflict, though. Walter Thanks -alastair -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Prototype in no conflict mode
On Apr 29, 2013, at 9:34 AM, Alastair Young alastair.yo...@gmail.com wrote: What if I ran my stuff in a frame - would jquery still conflict if it's loaded in the topmost frame? I was going to suggest that as an option, but I didn't know if you shared my disdain for I frames or not. Walter On 29 April 2013 17:28, Walter Lee Davis wa...@wdstudio.com wrote: On Apr 29, 2013, at 9:22 AM, Alastair Young alastair.yo...@gmail.com wrote: I can't modify the HTML - I fear my only solution is port all my code to jQuery Before you do that, try this. Download a copy of the prototype source cod locally, and use find-and-replace to substitute another character, like the underscore, for $. Do the same in a fork of your code. See if that does anything useful. It may. Walter On 29 April 2013 17:05, Walter Lee Davis wa...@wdstudio.com wrote: On Apr 29, 2013, at 8:54 AM, Alastair Young alastair.yo...@gmail.com wrote: I need to move my code (Prototype 1.7.1) into someone else's much larger project using jQuery v1.5.1. Can I load Prototype in no-conflict mode ? I can't change any of the jQuery stuff. Not as far as I know. The issue as I understand it is that Prototype extends the (lower-case) prototype of a number of JS primitives, and these extensions are an issue for jquery, over and above the simple name collision between $ in both libraries. Can you modify the HTML? You may be able to inject the jquery noConflict() function call in between the link to jquery and the subsequent links to various scripts and plugins that rely on it. That still won't fix things if those scripts are written in a style that doesn't expect to be in the presence of noConflict, though. Walter Thanks -alastair -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Unterminated string constant whens tring contains a trailing dot
On Apr 22, 2013, at 3:04 AM, Cardinal wrote: Unfortunately i can't provide a live demo as i am talking about a plugin for Novell / NetIQs iManager. Attached please find the SelectEntity.jsp file and some of its includes. Try this: get into the browser where you see the problem on a live server, and view source (actual source, not the DOM). Copy that entire source view. Paste it into the validator at http://validator.w3.org and see if there are any errors. Remember, browsers are endlessly forgiving by design. JavaScript is easily confused. Sometimes the entire problem can be fixed by making the HTML valid. Next, paste that source into a new text file.html. View that in a new browser window, make sure it is working up to the point of failing (so no missing resources or any bad paths). Satisfy all missing paths with local copies. Cut the page down to only show the problem, and post it somewhere public so we can look at it in our browsers. If the error requires an Ajax call to demonstrate, then stub that out with a static endpoint and dummy test data. Be sure to duplicate the same reply that is borking your page if that is the moment that it fails. I don't have a JSP container running here, haven't used one since the '90s. Without a live example, all we can do is wave our moist fingers in the air and try to guess which way the wind is blowing. The other benefit of this exercise is that very often (high 80% of the time) you will find the problem in the process of duplicating it in a static file. Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. SelectEntity.jspmandator.jsOS_inc.jspOSFooter_inc.jspcvFooter.inc.jsp -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Unterminated string constant whens tring contains a trailing dot
On Apr 20, 2013, at 6:19 AM, Cardinal wrote: Hi all, when i'm including prototype into a JSP, IE throws the error Unterminated string constant when i open a popup window which contains strings with a trailing dot. Basically, it's a list of usernames in the format user1.data user2.data As soon as this list contains a value like users2.data.system. I will get the unterminated string contant error. This error only appears when im including prototype (1.6.1 or 1.7.1), even if i don't need it for this particular popu-window (but for other elemts of the site). That means the popup is working without errors when im not using prototype. I assume that there is some type of escape functiality or so which collidates with my popup. Could you please show some code around this error, or a live example? It's hard to imagine what the issue might be without something to trace through. Walter Any help would be appreciated. Unfortunately i cant give you a link to reproduce that as im running the web server on a local virtual machine. Thank you and sorry for my bad english :-) -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Unterminated string constant whens tring contains a trailing dot
Just read this part. Please try to make a cut-down example in a static page that duplicates the error. Often this exercise will either bring dependencies/alternate causes to light, or it will force you to think through the problem in a new way. Walter On Apr 20, 2013, at 6:19 AM, Cardinal wrote: Unfortunately i cant give you a link to reproduce that as im running the web server on a local virtual machine. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Prototype.Selector is undefined
On Apr 8, 2013, at 8:22 AM, m...@travelmarket.com wrote: Hi guys I am getting this error on a project I've inherited from a colleague now on maternity leave. Prototype.Selector is undefined I have absolutely no clue as to what is causing this and how I go about debugging it - anyone have any helpful hints or tips? Thanks a bunch What version of Prototype are you using? Can you post a link or a cut-down example that duplicates this message? Is this coming from within Prototype, or from a script that depends on it? Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] color swatch selector
With as few choices as you have, I would be tempted to add them as a field of radio buttons, and use CSS to replace the buttons with color swatches directly. No need for any JavaScript at all. label class=swatchimg src=red.png alt=red /input type=radio name=color value=red //label ... label.swatch { display: inline-block; height: 20px; width: 20px; } label.swatch input { display: none; } Where you might need to break out the Prototype is to decorate the chosen element, can't think of how to do that in CSS off the top of my head. $$('input[name=color]').each(function(elm){ if(elm.checked){ elm.previous('img').addClassName('selected'); }else{ elm.previous('img').removeClassName('selected'); } }); Walter On Mar 21, 2013, at 6:32 AM, Phil Petree wrote: Morning Walter... That was the approach I took last night... it works but its just not as attractive as I'd like... still seems like their should be a more stylish way. I may just opt for something like the color selector used on a number of clothing sites... like this one: http://www.brooksbrothers.com/mens/polos-knits/0298,default,sc.html?lid=leftnav-menu Basically they just put color swatch/squares in a row and allow you to mouseover to see the effects and a click selects that color. On Thu, Mar 21, 2013 at 12:05 AM, Walter Lee Davis wa...@wdstudio.com wrote: I think you're going to need to update a swatch next to the picker, maybe. The select is remarkably styling-resistant in Safari, probably Chrome as well. I would absolutely position a little dot off to the left of the select, and update its background color on the change event of the select. Walter On Mar 20, 2013, at 3:12 PM, Phil Petree wrote: I want users to be able to pick from one of 6 colors for a folder (like a file folder). At first I thought about doing this as a selectoption value='color_blue' style='background-image: url(blue.png);'/option But I'm discovering this will really only render well in firefox... Has anyone discovered how to do this using proto/scripty? Thanks -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] color swatch selector
Really? Can you show an example? I don't think the label.swatch itself gets a :checked pseudo-class, it's the input inside it that gets checked. While you can find the :checked checkbox, you can't style upward like that to access the parent label (really wish you could). Walter On Mar 21, 2013, at 1:57 PM, Jason Westbrook wrote: For the CSS for the radio buttons use the pseudo class label.swatch:checked -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] color swatch selector
Here's what I was thinking of: http://scripty.walterdavisstudio.com/color-picker.html Walter On Mar 21, 2013, at 2:40 PM, Walter Lee Davis wrote: Really? Can you show an example? I don't think the label.swatch itself gets a :checked pseudo-class, it's the input inside it that gets checked. While you can find the :checked checkbox, you can't style upward like that to access the parent label (really wish you could). Walter On Mar 21, 2013, at 1:57 PM, Jason Westbrook wrote: For the CSS for the radio buttons use the pseudo class label.swatch:checked -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] color swatch selector
I think you're going to need to update a swatch next to the picker, maybe. The select is remarkably styling-resistant in Safari, probably Chrome as well. I would absolutely position a little dot off to the left of the select, and update its background color on the change event of the select. Walter On Mar 20, 2013, at 3:12 PM, Phil Petree wrote: I want users to be able to pick from one of 6 colors for a folder (like a file folder). At first I thought about doing this as a selectoption value='color_blue' style='background-image: url(blue.png);'/option But I'm discovering this will really only render well in firefox... Has anyone discovered how to do this using proto/scripty? Thanks -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Error help needed : Prototype is not defined
What does your page head look like? Can we see a link? Prototype needs to be linked before scriptaculous in the head of your page, that's what this error puts me in mind of. Walter On Mar 19, 2013, at 2:57 PM, Andy wrote: Hi all, I am having an error with the script. ReferenceError: Prototype is not defined ./js/effects.js Line 73 The line is linear: Prototype.K, Any assistance would be greatly appreciated. Thank you -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] AutoComplete
Please file an issue on Scriptaculous, then. Scripty 1 should stay in step with Prototype! Walter On Mar 14, 2013, at 11:34 AM, Miguel Beltran R. wrote: I fixed it :D #Walter The problem were here var pos = Position.cumulativeOffset(this.input); pos.push(pos[0] + this.input.offsetWidth); -- HERE STOP In 1.7, the cumulativeOffset function return a Object {top:x, left:y} when in 1.6 returned an array, howerver the object has the toArray function , so I changed it to var pos = Position.cumulativeOffset(this.input).toArray(); #Jason I have checked Script2 but no Script1, the version 2 of autocomplete don't like me. 2013/3/13 Walter Lee Davis wa...@wdstudio.com What do you see in Firebug or Web Inspector's console? Can you please post an example showing your work so far? We will be happy to help, but without setting up a demo locally, it's going to be difficult for us to divine exactly where the problem is. Walter On Mar 13, 2013, at 3:18 PM, Miguel Beltran R. wrote: Hello List!!! I have tried to use AutoComplete 1.2 (1) but it is not working with prototype 1.7. someone know another working library?or tell how fix it The problem that I have is with the position, using Firebug for debug _reposition: function() { if(!this.drawn) return; var pos = Position.cumulativeOffset(this.input); pos.push(pos[0] + this.input.offsetWidth); -- HERE STOP pos.push(pos[1] + this.input.offsetHeight); Element.setStyle(this.selector,{ left: pos[0] + 'px', top: pos[3] + 'px' }); }, (1) http://www.beauscott.com/examples/autocomplete/doc/ns_examples.html -- Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] .morph has stopped working - it now says Object [object Object] has no method 'morph'
On Mar 14, 2013, at 7:58 AM, Gretsch wrote: My code used to work, but now the .morph no longer works - in the chrome console it says: Uncaught TypeError: Object [object Object] has no method 'morph' The code includes the following: link href=https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js; / script type=text/javascript src=http://script.aculo.us/prototype.js;/script script type=text/javascript src=http://script.aculo.us/scriptaculous.js;/script But when I look at the code using Chrome 'Elements' pane it shows: link href=https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js; script src=https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en.iRGda-ATQBk.O/m=plusone/am=QQ/rt=j/d=1/rs=AItRSTMWXweuF4qvyKvRjzAhTggmGqAPyA/cb=gapi.loaded_0; async=/script script type=text/javascript async= src=https://apis.google.com/js/plusone.js; gapi_processed=true/script script id=twitter-wjs src=//platform.twitter.com/widgets.js/script script type=text/javascript src=http://script.aculo.us/prototype.js;/script script type=text/javascript src=http://script.aculo.us/scriptaculous.js;/script script type=text/javascript src=http://script.aculo.us/builder.js;/script ... script type=text/javascript src=http://script.aculo.us/sound.js;/script Can someone tell me where the extra lines come from e.g.: script src=https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en.iRGda-ATQBk.O/m=plusone/am=QQ/rt=j/d=1/rs=AItRSTMWXweuF4qvyKvRjzAhTggmGqAPyA/cb=gapi.loaded_0; async=/script and if this/something else is causing the problem. The working code can be seen at: http://www.alanarnoldguitars.co.uk/guitar_woods.htm (but the code is compressed) and the version where the 'minimise' button doesnt work is currently at: http://www.alanarnoldguitars.co.uk/guitar_woods_UNCOMPRESSED.htm You have a couple of errors right away on page load, before we even get into the rest of this: guitar_woods_UNCOMPRESSED.htm:20 SyntaxError: Unexpected token '' prototype.js:5733 TypeError: 'undefined' is not a function (evaluating 'element.dispatchEvent(event)') See if you can get the first one fixed, because the second one is Prototype reacting badly to what it is given, and is highly unlikely to be an actual error in the Prototype code itself. JavaScript errors tend to trickle down, and one can hide another. Also try multiple debuggers -- this is from Safari Web Inspector, but do try Firebug too. Walter Thanks -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] AutoComplete
What do you see in Firebug or Web Inspector's console? Can you please post an example showing your work so far? We will be happy to help, but without setting up a demo locally, it's going to be difficult for us to divine exactly where the problem is. Walter On Mar 13, 2013, at 3:18 PM, Miguel Beltran R. wrote: Hello List!!! I have tried to use AutoComplete 1.2 (1) but it is not working with prototype 1.7. someone know another working library?or tell how fix it The problem that I have is with the position, using Firebug for debug _reposition: function() { if(!this.drawn) return; var pos = Position.cumulativeOffset(this.input); pos.push(pos[0] + this.input.offsetWidth); -- HERE STOP pos.push(pos[1] + this.input.offsetHeight); Element.setStyle(this.selector,{ left: pos[0] + 'px', top: pos[3] + 'px' }); }, (1) http://www.beauscott.com/examples/autocomplete/doc/ns_examples.html -- Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[Proto-Scripty] Element.setValue() doesn't work with the output tag
Have a fiddle: http://jsfiddle.net/ZYDjc/ Any thoughts? Should I raise a ticket? Thanks, Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Copying border styles: a tale of two browsers
On Mar 1, 2013, at 8:09 PM, Jason Westbrook wrote: I'm using OSX Chrome and it does it correctly as does Safari Really? What version? It didn't work for me in 17.0.963.83. I see that there's an update available from there, but I get an error when I try to update -- Update server not available. Strange, given that it's Google's server... .getStyle() either uses the inline style via the .style property of the DOM object The issue seems to be that you can't use the fully composed shortcut to set the DOM (and according to the W3C, that's the spec). You can only manipulate the decomposed attributes. Doesn't explain why Safari lets you do it. It seems to coalesce all styles to their more fully composed form internally -- if you try my example again and watch the element in the Web Inspector, you will see that whether you set two.setStyle('border) with the Copy Border Style link, or loop through all of the decomposed parts of that style attribute with Copy Border Style With Crazy Long-ass Work-around, the DOM reads border: 10px solid rgb(102, 102, 102); if that is not set then it tries to use document.defaultView.getComputedStyle(element, null) which is returning nothing for the border property have you tried to use http://api.prototypejs.org/dom/Element/prototype/getLayout/ ? Thanks, this would get me the width of the border, but I'm actually trying to capture the entire border style. Here's what I ended up with for now: $('copy2').observe('click', function(evt){ var one = $('one'), two = $('two'); $w('top right bottom left').each(function(side){ $w('color width style').each(function(mode){ var key = 'border-' + side + '-' + mode var val = one.getStyle(key); two.setStyle(key + ':' + val); }); }); }); I discovered in the process that setting these attributes with their camel-cased key names didn't seem to work, while using the hyphenated forms worked fine. I could set a single camel-case variable at a time, long-hand, but inside my nested loop, I was only able to use the hyphenated form. I still haven't figured out why that happened. It appears as though setStyle({key: val}) is not equivalent to setStyle('key: val') in some cases. Thanks for looking at this, Walter Jason Westbrook | T: 313-799-3770 | jwestbr...@gmail.com On Fri, Mar 1, 2013 at 4:42 PM, Walter Lee Davis wa...@wdstudio.com wrote: Try this example in Safari, Chrome, and Firefox, latest versions. Please let me know what you see. http://scripty.walterdavisstudio.com/copy-style-fail.html Safari gets it right, Firefox and Chrome do not, and I'm baffled. Digging into the issue in Firebug, it appears as though defaultView.getComputedStyle is only populating the fully-decomposed border properties: border-left-color, border-left-width, etc. None of the intermediate shortcut attributes have any value assigned to them at all. Any suggestions? Thanks, Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[Proto-Scripty] Copying border styles: a tale of two browsers
Try this example in Safari, Chrome, and Firefox, latest versions. Please let me know what you see. http://scripty.walterdavisstudio.com/copy-style-fail.html Safari gets it right, Firefox and Chrome do not, and I'm baffled. Digging into the issue in Firebug, it appears as though defaultView.getComputedStyle is only populating the fully-decomposed border properties: border-left-color, border-left-width, etc. None of the intermediate shortcut attributes have any value assigned to them at all. Any suggestions? Thanks, Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] scripty inplace editor
On Jan 27, 2013, at 4:10 PM, Phil Petree wrote: Hi All! I'm implementing the scriptaculous inplace editor and I have it working except for one small detail: If I activate the editor, click cancel, activate the editor again I get two inplace editors. cancel those and activate again and I get three. cancel those and activate again and I get four... and on and on and on... What's the trick to this? Here's my code: html: trtd onclick='editName(this, id)'Homer Simpson/td/tr javascript: function editName(element, id) { new Ajax.InPlaceEditor(element, 'name_inpl_ajax.php', { okText: Save , cancelControl: button, callback: function(form, value) { return 'id=' +id + 'name='+encodeURIComponent(value) } }); } This editor isn't behaving as documented lately, I had an occasion to upgrade a working editor to the latest versions of Prototype and Scriptaculous, and found that clicking to edit the second time would cause the editor to load the editing form itself for editing. Not a good time for my client! You might want to look at this option: Removing the behavior To disable the InPlaceEditor behavior later on, store it in a variable like: var editor = new Ajax.InPlaceEditor('product_1' ,...); (... do stuff ..) editor.dispose(); This way, you can enable and disable In Place Editing :http://madrobby.github.com/scriptaculous/in-place-editing at will. See if that can work around the issue for you. Walter -- 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. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Toggle opacity
On Jan 23, 2013, at 7:48 AM, Köd wrote: Hi guys To get a full view of my problem, please read: http://stackoverflow.com/questions/14478903/script-aculo-us-toggle-appear-on-multiple-divs _ I have a simple question to ask you: Is it possible to use effect.opacity as a toggle effect? The reason why I'm asking this is because when using effect.opacity the assigned function can be spammed, hence making the div appear/fade over and over. I was thinking that it might would be possible to do so by changing something in the scriptaculous.js or effects.js file. If this is not possible, I would like to ask how you can use Effect.Toggle (appear) on multiple div's within an a href containing an onclick. An example: lia href=# onclick=Effect.toggle('DIV1, DIV2, DIV3', 'appear'); return false;/a It's going to be really hard to do this inline (I suppose it's possible, but not very readable) but if you create an observer function, then there should be a way to do this: var toggleMyItems = function(items){ $w(items).each(function(elm){ var elm = $(elm); if(elm ! elm.animating){ elm['animating'] = true; Effect.toggle( elm, 'appear', { afterFinish: function(){ elm.animating = false; } } ); } }); }); Then you could call that from inline: a href=# rel=DIV1 DIV2 DIV3 onclick=toggleMyItems(this.rel); return false;Howdy/a Or better, observe the click and do it elsewhere (separation of concerns): document.on('click', 'a.multi', function(evt, elm){ evt.stop(); toggleMyItems(elm.rel); }); a href=# class=multi rel=DIV1 DIV2 DIV3Howdy/a Walter Thanks. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/_mWlqcRjEnIJ. 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] Toggle opacity
Could you please post your solution? I thought Effect.multiple was for applying different functions to the same element, not the other way round... Walter On Jan 23, 2013, at 11:28 AM, Köd wrote: Guys! It works! I don't know what was wrong with my code before - but I made the Effect.Multiple work, thanks for your guidance! Weee, now I can continue being happy :D Den onsdag den 23. januar 2013 13.48.43 UTC+1 skrev Köd: Hi guys To get a full view of my problem, please read: http://stackoverflow.com/questions/14478903/script-aculo-us-toggle-appear-on-multiple-divs _ I have a simple question to ask you: Is it possible to use effect.opacity as a toggle effect? The reason why I'm asking this is because when using effect.opacity the assigned function can be spammed, hence making the div appear/fade over and over. I was thinking that it might would be possible to do so by changing something in the scriptaculous.js or effects.js file. If this is not possible, I would like to ask how you can use Effect.Toggle (appear) on multiple div's within an a href containing an onclick. An example: lia href=# onclick=Effect.toggle('DIV1, DIV2, DIV3', 'appear'); return false;/a Thanks. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/QXlygE0x3SIJ. 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] Set Opacity with no effect
$('myElementId').setOpacity(1); On Jan 21, 2013, at 12:43 PM, kstubs wrote: Whats the most straightforward means of setting opacity on a layer without any effects? I just need the layer to be opaque. Thanks, Karl.. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/cSIj-Bn35NAJ. 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] Ajax CORS error message
Maybe you also have to fiddle with the accept header? I've been having the same error for weeks in Safari, and on a straight get request to a CORS-enabled S3 endpoint, returning plain old HTML. Walter On Jan 16, 2013, at 9:20 PM, Dave Lazar wrote: Indeed I did... to no great effect with the results... still spits out that it does not want to process an unsafe 'X-JSON' header... On Wednesday, January 16, 2013 8:46:32 PM UTC-5, Jason wrote: did you also set the headers in the Ajax.Request object to null ie new Ajax.Request('/your/url',{ 'requestHeaders' : { 'X-Requested-With' : null, 'X-Prototype-Version' : null}}); Jason Westbrook | T: 313-799-3770 | jwest...@gmail.com On Wed, Jan 16, 2013 at 5:42 PM, Dave Lazar hunk...@gmail.com wrote: I built that version of Prototype, with that pull request... and it did not fix that issue... sigh... since the actual CORS call works.. I will just ignore the browser errors Prototype is throwing... messes things up in the console.. but that is minor... Thanks On Wednesday, January 16, 2013 7:13:50 PM UTC-5, Jason wrote: In the latest DEV version hosted on github you can remove the X-* HTTP headers that PrototypeJS puts into the AJAX requests that make the CORS pre-flight requests fail. Check out this pull request https://github.com/sstephenson/prototype/pull/88 Jason Westbrook | T: 313-799-3770 | jwest...@gmail.com On Wed, Jan 16, 2013 at 2:43 PM, Dave Lazar hunk...@gmail.com wrote: Chrome, Firefox and Safari all show a console error. They also all show the response. Puzzling... On Wednesday, January 16, 2013 5:22:36 PM UTC-5, Shane McCarron wrote: are you using Chrome by any chance? I noticed that it complains about some other headers I try to set in the same way. On Wed, Jan 16, 2013 at 4:21 PM, Dave Lazar hunk...@gmail.com wrote: As I mentioned... this a CORS setup, so obviously it is cross-site. That part of the stack works perfect, and the response is indeed dished out to the browser as expected. The only problem I have is Prototype not liking the header... I am looking for the tip that will silence that... Thanks On Wednesday, January 16, 2013 5:12:43 PM UTC-5, DaveK wrote: is the page served from http://test.heroku.com ? If not, it's a cross-site scripting security issue. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/xcPk0scKJdkJ. To post to this group, send email to prototype-s...@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. -- Shane McCarron halin...@gmail.com -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/LOcfGBnKHXgJ. To post to this group, send email to prototype-s...@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 view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/pcg4MZ0tctgJ. To post to this group, send email to prototype-s...@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 view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/QlngtF0Su_MJ. 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] I'm missing something , link management with javascript
On Jan 13, 2013, at 12:03 PM, tab1ta wrote: Hello, i'm trying to interface two different scripts, one from this mailing list and one from here. The result is a django template:Here http://pastebin.com/LWJbUZ9v The problem is that the link: a href=#/a should show a pop up windows, when clicked $('content').on('click', 'a', function openDialog() { but it simply searches for # and it doesn't show anything. Is something wrong in the code i posted? Yup. There's two ways to fix it. First, if you're going to use openDialog elsewhere in the same script scope, then define it first and then call it directly: var openDialog = function(){ alert('Howdy!'); }; $('content').on('click','a', openDialog()); If however it is a throw-away, one time thing, you can define an anonymous function inside your on() handler and use it directly there. You cannot just throw the function keyword in there and get anything but an error, though. $('content').on('click', 'a', function(){ alert('Howdy!'); }); Walter If the problem is somewhere else i can inspect, but i'm not sure of the line of code i posted, Any suggestion? Thanks Agnese -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/g89TB9F28vwJ. 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] event on leaving page
If onbeforeunload returns true-ish, the browser will put up a dialog with the results of that true-ish value being cast to a string interpolated inside the standard dialog. There is no need to have confirm in there as well. Try either returning false if all is well, or a string with your message if not. Many modern browsers have this behavior anyway -- if you try to leave a page after filling out form elements, you get this dialog for free. Walter On Jan 11, 2013, at 1:41 AM, sreekal...@tech4travel.co.in wrote: I tried this code before window close.But again i get a pop up like This page is asking you to confirm that you want to leave - data you have entered may not be saved.Two pop-ups are not needed. window.onbeforeunload = function() { var r=confirm(Are you sure you want to navigate away?); if (r==false) { return false; } } -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/o0lXyGlNh4cJ. 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] multipart/form-data upload via ajax
On Jan 9, 2013, at 3:45 PM, Jason Westbrook wrote: It is possible but you have to realize it will only work on browsers that have the FileAPI available - Chrome/Firefox/Safari new Ajax.Request(fileupload.php?filename=myfile,{postBody:$(inputfield).files[0]}); will post the contents of the file to fileupload.php then you can use file_get_contents(php://input); Note that this style of upload will not have the same security treatment by PHP as the $_FILES superglobal variable, and move_uploaded_file() and friends will not be active for it either. This can become an awful security hole if you aren't careful. to get the contents of the file and the filename will be $_GET['filename'] If you want to use the normal upload mechanism, you can use a keyhole iframe as the target in your form action to post your file contents normally, and a callback function in the window scope of the containing page to signal back your updates. It looks like Ajax, but it's really just a multipart form post. Walter Jason Westbrook | T: 313-799-3770 | jwestbr...@gmail.com On Wed, Jan 9, 2013 at 12:27 PM, fntzr fantaz...@gmail.com wrote: It not possible, use Flash Uploader for it, for example http://demo.swfupload.org/v220/simpledemo/index.php. But with HTML5\xhr2 it will be possible. http://dev.w3.org/2006/webapi/FileAPI/#FileReader-interface . -- 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. -- 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] highlighting a tablerow
On Jan 3, 2013, at 8:59 AM, Phil Petree wrote: $('mail').on('mouseover', 'tr', function(elm, evt){ My error, the variables are swapped. Make that line this: $('mail').on('mouseover', 'tr', function(evt, elm){ Walter -- 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] highlighting a tablerow
On Jan 3, 2013, at 1:41 PM, Phil Petree wrote: Thanks Walter! I tried quite a few things... borrowed 1/2 dozen snippets from various places and nothing was working till yours. I still have one question, how do you undo (stopObserving) these events? When I load new tables into the other tabs via ajax they are not being monitored which means I need to do a stopEvent and restart with the new rows. No, you just have to observe from higher up. If you use document.on('mouseover'... it will work no matter when or where you insert the elements: http://scripty.walterdavisstudio.com/table-hover.html I'm not using an Ajax call here to create my new tables, but I am generating a completely new object after the page load, and that object has no observers defined on it. There's just a single observer at the document level, and it listens to all mouseover and mouseout events but only acts when they happen over a tr. Walter BTW, I had to add a mouseout because when I take the mouse off the table it left a row still highlighted. It now looks like this: var rows = $$('#mail tr'); $('mail').on('mouseover', 'tr', function(evt, elm){ rows.invoke('removeClassName', 'over'); elm.addClassName('over'); }); $('mail').on('mouseout', 'tr', function(evt, elm){ rows.invoke('removeClassName', 'over'); }); On Thu, Jan 3, 2013 at 11:25 AM, Walter Lee Davis wa...@wdstudio.com wrote: On Jan 3, 2013, at 8:59 AM, Phil Petree wrote: $('mail').on('mouseover', 'tr', function(elm, evt){ My error, the variables are swapped. Make that line this: $('mail').on('mouseover', 'tr', function(evt, elm){ Walter -- 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. -- 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] highlighting a tablerow
I usually have to add the color attribute to the td rather than the tr. You can make this change at the CSS level. Rather than using setStyle(), toggle the classname of the row, and then set your CSS to apply to td children of that class of row. For example: var rows = $$('#mytable tr'); $('mytable').on('mouseover', 'tr', function(elm, evt){ rows.invoke('removeClassName', 'over'); elm.addClassName('over'); } CSS: #mytable tr.over td { background-color: #fefefe; } Walter On Jan 1, 2013, at 11:55 PM, Dave Kibble wrote: I think there's also something weird about CSS applied to table rows, (I think) cells don't inherit all properties from the row they 'belong' to. Make sure your HTML/CSS works in a stand-alone document first to check. Dave On 1 January 2013 22:53, Phil Petree phil.pet...@gmail.com wrote: I have an empty div that gets an ajax result that contains a table which looks like this: HTML: table class='form' id='mail' width='100%' border='1' tr thSubject:/th thFrom:/th thSent:/th thAction/th /tr tr class='mailrow' onclick='viewMsg( .$id .,\ .$subject .\);' td$subject/td td$username/td td$sentdate/td td valign='middle' align='center' img src='/images/icons/delete.png' width='16' height='16' onclick='deleteMsg(this, $id);' img src='/images/icons/reply.png' width='16' height='16' onclick='replyMsg(this, $id, \{$subject}\ );' img src='/images/icons/forward.png' width='16' height='16' onclick='forwardMsg(this, $id, \{$subject}\ );' /td /tr /table In the onComplete: I am calling this code to try and cause the rows to highlight during the mouseover... I'm getting nothing. My first thought is that the table hasn't been rendered when onComplete is called but then, onComplete should be called after all other work is done. What's the solution to this? Prototype: $$('tr.mailrow').each(function(item) { item.observe('mouseover', function() { item.setStyle({ backgroundColor: '#303030' }); }); item.observe('mouseout', function() { item.setStyle({backgroundColor: '#fff' }); }); }); CSS: .mailrow tr:hover { color: #303030; } -- 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. -- 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] Anyone know of a good image scroller?
Which ones? I just tried them here without issue. Walter On Dec 25, 2012, at 6:41 AM, Phil Petree wrote: and Walter, if you're still haning out here, two of those demos are broken). -- 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] Anyone know of a good image scroller?
I had some older versions of Prototype/Scriptaculous in there, that'd explain it, since I was looking on Mac OS, and there was no patch needed for those browsers. I've just updated to the latest. Walter On Dec 25, 2012, at 5:55 PM, Phil Petree wrote: On ie9. -- 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] mouseout event doesn't work
On Dec 21, 2012, at 9:46 AM, tab1ta wrote: I added an Event listener to the page, to catch every event but it doesn't work still. The code is more compact: ?php require_once(tabs.php); ? !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; xml:lang=en lang=en head style type=text/css @import url(styles.css); /style script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/prototype/1.7/prototype.js;/script script type=text/javascript document.observe('dom:loaded', function(){ $('thing_1').on('mouseover', 'img', function(evt, elm){ evt.stop(); $('thing_1').replace('div id=thing_1 class=gallerylinkpa href=http://tinyurl.com/cwtt2yq;See Photo/a/p/div'); }); [snip] $('thing_1').on('mouseout', 'a', function(evt, elm){ evt.stop(); $('thing_1').replace('img id=thing_1 class=galleryitem src=images/gallery1.jpg.jpg onmouseover=showResult1(); style=position:relative; top:0px; left: 0px;/'); }); [snip] }); /script [snip] Can anyone help? Thanks Agnese Sure. Have a careful look at what's happening here. In your mouseover, you are completely replacing the content of #thing_1 with new content. The mouseout handlers that you defined do not have anything to apply to, so they are a no-op. Even if the content to which they would apply is added to the page later, they still won't do anything, because the handler has to be added to the element it applies to before it can act. There's a second problem with this page, related to code (and memory) bloat. You're defining the same function over and over, once per element on the page, even though they all do exactly the same thing. If you look back to my example, you'll see that I wrote one function, applied it to the parent container (the UL) rather than one function per LI inside that list. You need to do the same thing here. Once you do, you'll gain the true value of the on() function: deferred observers. The third problem is that you are replacing content with content stored in the JavaScript -- you're mixing metaphors -- and it's not serving anyone here very well. The few people who approach your page with JavaScript disabled will have a fundamentally broken experience, and you are suffering from having to edit HTML in the midst of your JS, with all the escaping and quote-wrangling that implies. This whole thing could be rewritten as follows: ul id=myList li img class=galleryitem src=images/gallery1.jpg.jpg style=position:relative; top:0px; left: 0px;/ div class=gallerylinkpa href=http://tinyurl.com/cwtt2yq;See Photo/a/p/div /li ... /ul Then, in your script: var divs = $$('#myList div'); var imgs = $$('#myList img'); function setup(){ divs.invoke('hide'); imgs.invoke('show'); }; setup(); $('myList').on('mouseover', 'li', function(evt, elm){ setup(); elm.down('img').hide(); elm.down('div').show(); }); $('myList').observe('mouseleave', setup); That's it, one handler on mouseover for the whole list (mouseover bubbles up from the element that triggered it, the on() function dramatically simplifies figuring out which element actually triggered it), and one more handler on the entire list to clean up after you mouse out of the entire list element. There's no replace() going on, so your handlers persist from one event to the next. Dramatically less memory used (not critical in this tiny example, but significant on a larger page or a longer-running single-page application). Note that I am observing the mouseover that bubbles up from the LI (parent of both the img and the div) and I have removed the illegal duplicate IDs from both img and div elements. All of the content will be visible when JavaScript is disabled. Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/UWS-jIP99DYJ. 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] TypeError: $(...) is null
You can fix this two different ways: either move your script block to the bottom of the page (just before /body, as in my example) or add an unobtrusive listener block around your main function. The issue here is that because your script appears before the HTML it applies to, none of the elements are present in the DOM yet when the closure tries to wrap around them. Here's how to wrap them (if you want to put the script at the top of the page: script type=text/javascript document.observe('dom:loaded', function(){ var toggles = $$('.toggle'). [etc...] }); /script Walter On Dec 19, 2012, at 8:13 AM, tab1ta wrote: Taking from an example that works: !DOCTYPE html html head meta charset=utf-8 / titleShow-Hide Divs/title script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/prototype/1.7/prototype.js;/script [snip] toggles = $$('.toggle').invoke('hide'); }) /script /body /html I tried to apply this script to a complete webpage but i trows me an error TypeError the $('') function considers the id i pass to it as a null. My web page is longer. !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; xml:lang=en lang=en head style type=text/css @import url(styles.css); /style script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/prototype/1.7/prototype.js;/script script type=text/javascript var toggles = $$('.toggle').invoke('hide'); [snip] div id=thing_6 class=toggle pcopy; by flicr.combr/a href=http://tinyurl.com/cwtt2yq;See Photo/a/p /div/div/div/div /body /html -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/uxHIYaSumLsJ. 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] Prototype dom
On Dec 17, 2012, at 5:13 AM, Agnese Camellini wrote: 2012/12/17 Walter Lee Davis wa...@wdstudio.com ?php print 'This is DYNAMIC thing ' . preg_replace('/[^\d]+/', '', $_POST['id']); ? Call that script page.php and modify the JavaScript as follows: script type=text/javascript var toggles = $$('.toggle').invoke('hide'); is this a way to substitute a CSS property, alternative to setStyle({display: 'none'})? hide() and show() are simplified syntax to hide and show an element. The hide adds display:none, but show doesn't just add display:block -- it removes display:none, letting the native element display property (as modified by any existing CSS) to shine back through. $('menu').on('click', 'a', function(evt, elm){ evt.stop(); toggles.invoke('hide'); var target = elm.href.split('#').last(); What do the evt and elm arguments represent? The on() function takes three arguments: the event that it observes, an (optional) CSS selector to refine the targeting on that event, and the function body to be wrapped around the event and its triggering element. If you call it with only two arguments, then the first is the name of the event, and the second is the function body. See: http://api.prototypejs.org/dom/Element/on/ and more here: http://api.prototypejs.org/dom/Event/on/ If you were to write that line of my example out in pseudocode, here's what it says: When #menu receives a click event (which may have bubbled up from one of its children), If that click was on an 'a' Fire this anonymous function, passing it the click event itself and the 'a' that was clicked. This code encapsulates a lot of lines of branching code in your example into that one expression, and spackles over the differences between browsers as it does so. new Ajax.Updater(target, 'page.php', { parameters: { id: target }, onSuccess: function(){ $(target).show(); } }); /script Souldn't the element target be one of the elements toggle hided before? I could use the for loop in my script to identify a list of id in sequence. The target is gathered a few lines before, by splitting the href of the elm (the link that was clicked). This could be gathered earlier and just once if you wanted to optimize things further. There is no need to loop over anything, because elm is already a JavaScript reference to the link that was clicked, so we have full two-way access to it. Yes, it was hidden before, along with all of its peers. Inside this anonymous function, the external variable 'toggles' is a reference to the entire collection of elements you are showing and hiding. Why don't you call the innerHTML function or others? i mean, why Ajax.Updater? Read the API. Yes, under the covers that method is being used, but again, a whole lot of branching conditional logic is encapsulated away from your main application, so you don't have to worry about different browsers' implementation details. Ajax.Updater is a combination of the Ajax.Request and Element.update methods -- a short-cut for those cases where you want to make an Ajax request and immediately update an on-screen element with the results of that request. Element.update() does use innerHTML in the browsers that support it, and something heavier-handed for those that do not implement the spec as written. Hope that helps. Walter Now when you click this link, the ID will be passed to the script. In this trivial example, the non-numeric parts will be stripped out, and the result will be concatenated with a string and returned through Ajax to populate the box on the screen, which will show as soon as that reply is received. In your more complex example, you could look up the latest news from Yahoo (using PHP, since that doesn't suffer from cross-domain restrictions like JavaScript does) and put that in there instead. Walter Thanks Agnese -- 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] javascrpt newbie, and studying in an old book, can't make this code work..
On Dec 14, 2012, at 5:21 AM, tab1ta wrote: Hello. i'm just approaching Javascript through an old book. do you see anything wrong in the funcions listed below? html headtitleLink Test/title /head body a id=mylink href=http://joy.indivia.net;Click me/abr / script type=text/javascript onError = errorHandler url = mylink.href document.write('The URL is ' + url) function errorHandler(message, url, line) { out = Sorry, an error was encountered.\n\n; out += Error: + message + \n; out += URL: +url + \n; out += Line: +n line + \n\n; out += Click OK to continue.\n\n; alert(out); return true; } /script noscript Your browser doesn't support or has disabled Javascript /noscript /body /html And in those other functions? htmlheadtitleAjax XML Example/title/headbodycenter / h1Loading a web page into a div/h1 div id='info'This sentence will be replaced/div script // params = url=oreilly.com nocache = nocache= + Math.random() * 100 url = rss.mews.yahoo.com/rss/topstories TYPO?? mews == news? request = new ajaxRequest() request.open(GET, xmlget.php?url= + url + nocache, true) //request.setRequestHeader(Content-type, application/x-www-form-urlencoded) //request.setRequestHeader(Content-length, params.length) //request.setRequestHeader(Connection, close) out =; request.onreadystatechange = function() { if(this.readyState == 4) { if (this.status == 200) { if (this.responseText != null) { titles = this.responseXML.getElementsByTagName('title') for (j = 0 ; j titles.length ; ++j) { out += titles[j].childNodes[0].nodeValue + 'br/' } document.getElementById('info').innerHTML = out } else alert(Ajax error: No data received) } else alert(Ajax error: this.statusText) } } request.send(null) function ajaxRequest() { try: { var request = new XMLHttpRequest() } catch(e1) { try { request = new ActiveXObject(Msxml2.XMLHTTP) } catch(e2) { try { request = new ActiveXObject(Microsoft.XMLHTTP) } catch(e3) { request = false } } } return request } /script/body/html Firebug and the crome debugger doesn't say anything about any error, but it simply doesn't accomplish the tasck. Is there something wrong? There doesn't seem to be any Prototype in this code snippet. For example, Prototype would have $('theId') in place of document.getElementById('theId') everywhere. This whole thing could be written in very few lines using the Prototype Ajax methods. Have a look at the documentation at http://api.prototypejs.org for a crash course. Are you sure you aren't getting any errors with this code, though? It looks like you're requesting data from another domain (unless you work at Yahoo) from your own. You should be getting a security error because you're trying to load content from outside of your page's domain. Walter tab1ta -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/LUOs7TBQ0TIJ. 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] Prototype dom
On Dec 16, 2012, at 8:59 AM, tab1ta wrote: Hello. I'm studying, there is a piece of code i cannot get to work, so i was asking myself if you can help, given that all the pastebin doesn't accept the prototype link. Which ones have you tried? JSFiddle has Prototype as one of its many libraries, ready to use. This has the added benefit that the code is rendered and runs in your browser while you are working on your example. Others can fork your fiddle and fix it there, too. I'm not exaclty sure of what it does, i assume it goes through the document dom to place every div page in the right order to be viewed. Its a php file, and i can't really understand why php is needed to solve this task, however is a pice of code found in a book, it could be wrong. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en head script type=text/javascript src=prototype.js/script script type=text/javascript function importNode(p_element, p_allChildren) { switch (p_element.nodeType) { case 1: var newNode = document.createElement(p_element.nodeName); if (p_element.attributes p_element.attributes.length 0) for (var i = 0, il=p_element.attributes.length; i il;) newNode.setAttribute(p_element.attributes[i].nodeName, p_element.getAttribute( p_element.attributes[i++].nodeName)); if(p_allChildren p_element.childNotes p_element.childNodes.length 0) for (var i = 0, il = p_element.childNodes.length; i il;) newNode.appendChild(importNode(p_element.childNodes[i++], p_allChildren)); return NewNode; break; case 2: case 3: return document.createTextNode(p_element.nodeValue); break; } }; No Prototype here, could be written much more clearly and concisely with Prototype idioms. function turnPage(p_number) { var pages = $('article').getElemenetsByTagName('div'); TYPO??? Elemenets !== Elements (also could be written as $('article').select('div') for added points) for (var i = 0, il = pages.length; i il; i++) { $(pages[i]).setStyle({display: 'none'}); $('l' + (i+1)).innerHTML = 'a href=article.php?page=' + (i+1)+ 'onClick=return turnPage('+ (i+1)+')' +(i+1)+'/a'; } if ($('page' + p_number).innerHTML == '') { new Ajax.Request('article.php', { method: 'post', parameters: {page:p_number }, onSuccess: function(xhrResponse) { var response = xhrResponse.responseXML; var newNode; if (!window.ActiveXObject) { newNode = document.importNode(response.getElementsByTagName('page')[0].childNodes[1], true); $('page' + p_number).appendChild(newNode); } else { newNode = importNode(response.getElementsByTagName('page')[0].childNodes[0], true); $('page' + p_number).appendChild(newNode); } $('l' + p_number).innerHTML = p_number; $('page' + p_number).setStyle({display: 'block' }); }, onFailure: function(xhrResponse) { $('page').innerHTML = xhrResponse.statusText; } }); } else { $('l' + p_number).innerHTML = p_number; $('page'+ p_number).setStyle({display: 'block' }); } return (false); }/script The rest of this is a salad of Prototype and non-Prototype coding styles. There's nothing wrong with a for loop, until you try to loop over a collection of Prototype-extended elements. That's when you meet the salt as opposed to the syntactic sugar of Prototype's each() method. If you can write out, in English as opposed to JavaScript, what it is you're trying to accomplish here with this code, I might be able to point
Re: [Proto-Scripty] Google+ Group Created
On Dec 14, 2012, at 12:16 PM, kstubs wrote: Any Google+ users on this forum? I've started a community there called PrototypeJS. https://plus.google.com/u/0/communities/117299565971807136426 Come join! Serious question: what would the benefit be versus mail? How would you receive notification of new messages? Would you have to keep reloading the page? Walter -- 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] Google+ Group Created
On Dec 14, 2012, at 12:55 PM, Joseph Spandrusyszyn wrote: You can turn notifications on for Google+ communities if you want notifications. Those who don't want notifications, but want to look occasionally could join and not turn on notifications. Although having the community set so that you need to ask to join will limit participation. - Joe It's been my experience (since i got this address in 1994) that things that come to me, like mailing lists, get and maintain my attention; while things like forums (and their direct descendants -- Facebook and G+ and so forth) that require me to go look at them to find if anything is new fade away. I have lost count of the number of fora I have joined over the years, often to get community support for a particular problem, that I have never returned to again after my question was answered. Contrast that with my interaction with this mailing list, which has survived three platforms and two name changes, and by my count has resulted in me writing 791 posts since 2006. My initial messages were questions, and I stood on the shoulders of giants here. Lately the majority of my posts are answers to other people's questions. It's that part of the equation that I fear gets lost in a non-push environment, to the detriment of all. Walter On Fri, Dec 14, 2012 at 12:45 PM, Walter Lee Davis wa...@wdstudio.com wrote: On Dec 14, 2012, at 12:16 PM, kstubs wrote: Any Google+ users on this forum? I've started a community there called PrototypeJS. https://plus.google.com/u/0/communities/117299565971807136426 Come join! Serious question: what would the benefit be versus mail? How would you receive notification of new messages? Would you have to keep reloading the page? Walter -- 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. -- 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] Future of Prototyp.js
That's an excellent idea. You should see if Kangax wants to pitch in, since he created Scripteka, and he's still involved a bit in Prototype. Walter On Dec 2, 2012, at 12:32 PM, Jason Westbrook wrote: I'm actually planning on taking whatever is still available on scripteka and rehosting it on github so that others can find it, see examples of it working, post issues and comment on the scripts Jason Westbrook | T: 313-799-3770 | jwestbr...@gmail.com On Sat, Dec 1, 2012 at 7:21 AM, kstubs kst...@gmail.com wrote: ..and related to all of this is a site like this: http://scripteka.com Where a ton of the script that use to be available, well the underlying/host site for the code have dropped off the WWW universe. Very sad :( A lot of broken links. Karl.. On Saturday, December 1, 2012 6:54:42 AM UTC-7, isurge wrote: We let our IE 6 clients go. On 12/1/12 1:48 AM, petrob wrote: I understood why a lot of companies still insist on using IE6 when at a large hypermarket chain the accounting staff pointed out that their very expensive accounting software can only be run on IE6 or on IE9+. The cost efficient solution for them is to go on running their legal copies of XP on some hundreds of computers with IE6 and ban any acive-x objects and script (java, javascript, flash etc) on the company server. So, it is the operating system that is behind the longevity of IE in the corporate field and , unfortunately, it will remain the same for a long time. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/--r_rxEpnswJ. To post to this group, send email to prototype-s...@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 view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/mmHzcI7zWxMJ. 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. -- 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] string variable transform in code
Leave the quotes off of the variable when you are setting the value, and you should have it working (assuming that field is the ID of an input on your page. It's also safer to use $('field').getValue() or the shortcut $F('field') because that works around some edge cases in older browsers. Walter On Dec 2, 2012, at 3:55 PM, Laurent Barre wrote: Hi, I don't know,it's possible ? I have this : param : { field_value : $('field').value } and in function I try to : alert(param.field_value); but the reponse is the string $('field').value. I'd like have the value of the field. 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-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.
[Proto-Scripty] Element.wrap instance method appears to fail in Safari 6
There's a warning on the API site about IE: Using Element.wrap as an instance method (e.g., $('foo').wrap('p')) causes errors in Internet Explorer when used on textarea elements. The wrap property is reserved ontextarea's as a proprietary extension to HTML. As a workaround, use the generic version instead (Element.wrap('foo', 'p')). This appears to be an issue on Safari 6.latest, too. Can anyone confirm? Walter -- 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] unsafe header error in Safari
I am using Amazon S3, with a cross-domain request allowed there, and am able to load HTML from a static file hosted there into a shell page hosted on my own server using Prototype Ajax.Updater. Recently, I started getting an error in Safari (latest version) of Refused to get unsafe header 'X-JSON'. This error repeats hundreds of times before the content loads. It doesn't stop the load, but it annoys me. Has anyone else seen this, and how did you stop it if so? Thanks, Walter -- 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] unsafe header error in Safari
Here's my CORS config: ?xml version=1.0 encoding=UTF-8? CORSConfiguration xmlns=http://s3.amazonaws.com/doc/2006-03-01/; CORSRule AllowedOrigin*/AllowedOrigin AllowedMethodGET/AllowedMethod AllowedHeader*/AllowedHeader /CORSRule /CORSConfiguration Walter On Nov 19, 2012, at 11:35 AM, Walter Lee Davis wrote: I am using Amazon S3, with a cross-domain request allowed there, and am able to load HTML from a static file hosted there into a shell page hosted on my own server using Prototype Ajax.Updater. Recently, I started getting an error in Safari (latest version) of Refused to get unsafe header 'X-JSON'. This error repeats hundreds of times before the content loads. It doesn't stop the load, but it annoys me. Has anyone else seen this, and how did you stop it if so? Thanks, Walter -- 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] Event On click behavior with selector
On Nov 3, 2012, at 1:51 PM, kstubs wrote: If I define an on click event for a given css selector did I disable or trap the default click event? Reason I'm asking is I have a form and I have wired up a click event for a given input type like this: this.form.on('click', 'input[type=checkbox]' ,functionChkClicked); Now my radio clicks aren't working. I can click one item in a radio group but when I try to click a different item in the same group it doesn't work. Can you show the definition of your method functionChkClicked? Also, what do your see in your browser console? You should see an error there if that's why your function isn't returning. And no, an observer like this will only stop the default behavior if that's what you tell it to do. Otherwise, the event bubbles right on through. Walter -- 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] Attach Ajax.Updater to link
On Oct 28, 2012, at 4:15 AM, donnek wrote: I'm new to Prototype, and I'm trying to use AJAX to update divs inthe background, pulling data from a database. I've got Ajax.Updater to work with the output of a form, but I'm having difficulty with adpting it for use with a link. Basically, I have a list of words produced by the db, each of them a clickable link, and when I click on the word I want the context of the word (likewise drawn from the db) to come up in a div below the list. What I have at the minute: calling page: diva href=javascript:void(0); class='textword' id='myword1' onclick=get_word()myword1/a/div diva href=javascript:void(0); class='textword' id='myword2' onclick=get_word()myword2/a div id=output[Results appear here.]/div script function get_word() { new Ajax.Updater ( 'output', 'mylist.php', { method: 'get', parameters: { word: $(this).attr(id) } I'm pretty sure your problem is right here. There's no attr() method in Prototype. Try readAttribute() instead, and you appear to have everything right besides. Walter } ); } /script mylist.php: [db connection stuff] $word=trim($_GET['word']); $sql=query(select * from mytable where word~'$word';); while ($row=pg_fetch_object($sql)) { echo $context.br /; } Run by itself, mylist.php gives the results I want, so I think I haven't got the right invocation for the link, but after several hours searching and experimenting, I have to ask! -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/z616OxDuu6oJ. 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] Attach Ajax.Updater to link
On Oct 28, 2012, at 12:05 PM, donnek wrote: On Sunday, 28 October 2012 15:53:37 UTC, Walter Lee Davis wrote: I'm pretty sure your problem is right here. There's no attr() method in Prototype. Try readAttribute() instead, and you appear to have everything right besides. Thanks, Walter, but unfortunately changing that line to: parameters: { word: $(this).readAttribute(id) } doesn't help. What does Firebug say your request looks like? What does your server respond with? Walter -- 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] Attach Ajax.Updater to link
Okay, that means that 'this' inside the Ajax.Updater is not set to what you think it is. Try this: function get_word(elm) { new Ajax.Updater ( 'output', 'mylist.php', { method: 'get', parameters: { word: $(elm).readAttribute(id) } } ); } call it with get_word(this) in your inline handler example. A much neater way to handle this is with an unobtrusive handler. For this HTML (note the differences): divp class='textword' id='myword1'myword1/p p class='textword' id='myword2'myword2/p/div div id=output[Results appear here.]/div could be handled with this JavaScript: script type=text/javascript document.observe('dom:loaded', function(){ document.on('click','.textword', function(evt, elm){ new Ajax.Updater( 'output', 'mylist.php', { method: 'get', parameters: { word: elm.readAttribute('id') } } ); }); }); /script Much cleaner and fewer global variables are massacred. Walter On Oct 28, 2012, at 3:23 PM, donnek wrote: On Sunday, 28 October 2012 15:53:37 UTC, Walter Lee Davis wrote: What does Firebug say your request looks like? What does your server respond with? TypeError: $(this).readAttribute is not a function parameters: { word: $(this).readAttribute(id) } There's no change to the calling page - it shows nothing in the output div. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/23HHumtY6uYJ. 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] Attach Ajax.Updater to link
I use elm to stand for element, and evt to stand for event. It's just a habit I have, to keep clear in my head what I am dealing with when I use an observer or an iterator. If I am iterating over a collection of elements with each, I will usually write this: $$('.foo').each(function(elm){ /* do something to elm here */ }); Using elm here reminds me that I am dealing with an element, rather than an event, and that I will have direct access to the element. Using the same collection and observing the click on it, I would write this: $$('.foo').invoke('observe', 'click', function(evt){ // inside here, evt is the click event evt.stop(); // and 'this' is the element that received the click: one of the .foo elements this.highlight(); }); I prefer unobtrusive observers for several reasons. First, they remove the masses of repeating inline code from the HTML, where all it does is bloat the page without adding any value. Any time you find yourself writing the same thing more than once, that's an opportunity for improvement. Second, if your observer is all in one place, you can make sweeping changes without having to go back and rewrite every invocation of the method. Imagine if you changed your function definition to need two variables passed to it rather than one. With your method, that means touching every row of your interface, while with mine, you just rewrite it in one place. Walter On Oct 28, 2012, at 5:51 PM, donnek wrote: On Sunday, 28 October 2012 20:32:34 UTC, Walter Lee Davis wrote: Okay, that means that 'this' inside the Ajax.Updater is not set to what you think it is. Try this: snip Much cleaner and fewer global variables are massacred. Hey, thanks! Both of those work. But I don't understand what elm (not the tree, I assume!) and evt are/do. And why is the second cleaner (because I find the first easier to understand). Thanks again for taking the time on this. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/eGR_Yuma92gJ. 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] Transparency e Opacity don´t work in IE 8
On Oct 24, 2012, at 3:40 PM, JB wrote: Hi I'm using Prototype 1.2 Wow, that's quite old! 1.7.1 is current, and given the pace of development, it too is getting long in the tooth. And the transparency and opacity not work in ie8 That's your problem right there. You're not using Prototype to make the element less than opaque, you're trying to use rgba color to do that, and IE doesn't support that natively. There are filter styles you can use to make a semi-opaque color in IE, but there's nothing magical about Prototype that suddenly makes IE capable of handling rgba. What you might be confusing here is that Prototype does shim the opacity attribute for IE. But that doesn't behave the same way as rgba -- when you set an element to opacity: 0.4, that makes everything -- type, images, background color, border -- 40% opaque. Rgba backgrounds merely make the background semi-opaque, and leave the contents of the box opaque. Walter My code: $('av-img').addEvent('mouseover', function(event){ $('avatar_upload').setStyle('background', 'rgba(0, 0, 0, 0.6)'); $('select-0').setStyle('color', '#fff'); }); $('av-img').addEvent('mouseout', function(event){ $('avatar_upload').setStyle('background', 'transparent'); $('select-0').setStyle('color', 'transparent'); }); $('avatar_upload').addEvent('mouseover', function(event){ $('avatar_upload').setStyle('background', 'rgba(0, 0, 0, 0.6)'); $('select-0').setStyle('color', '#fff'); }); $('avatar_upload').addEvent('mouseout', function(event){ $('avatar_upload').setStyle('background', 'rgba(0, 0, 0, 0.6)'); $('select-0').setStyle('color', '#fff'); }); How fix this bug? Tks -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/MkGnHbV-4SwJ. 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] Prototype, addClassName on future elements
Can you describe what you mean by future elements on the page? Do you mean elements that are later in the source order than the script? If so, that's pretty simple: document.observe('dom:loaded', function(){ $$('div.foo').invoke('addClassName', 'bar'); }); Walter On Oct 24, 2012, at 7:52 AM, Henrik Aagaard Sørensen wrote: I'm trying to append a class via addClassName on future elements on a page with Prototype, however I do seem to struggle a bit with it. I know of jQuery's .live feature, but I cannot find a similar feature in Prototype. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/3R9rCrWTjaIJ. 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] Prototype, addClassName on future elements
You can add this transformation in the onSuccess callback of your Ajax call: new Ajax.Updater('foo', '/get/more/foo', {onSuccess: function(){ $$('.foo').invoke('addClassName', 'bar'); }); As long as you don't have a ton of DOM changes happening, this should just work. Otherwise, you may want to wrap it in a Defer to ensure that the DOM is stable before you run it. Walter On Oct 24, 2012, at 8:00 AM, Henrik Aagaard Sørensen wrote: No, unfortunately it's not that. It's elements being loaded into the dom later. I'm already using dom:loaded and I've placed the JS jus before /body as the last element. However, there are several Ajax-calls which later (in the future, after everything is loaded) creates new elements (which I have no control over), so I need to have Prototype adding specific class-names in elements which fullfill CSS selector at all time. On Wed, Oct 24, 2012 at 1:57 PM, Walter Lee Davis wa...@wdstudio.com wrote: Can you describe what you mean by future elements on the page? Do you mean elements that are later in the source order than the script? If so, that's pretty simple: document.observe('dom:loaded', function(){ $$('div.foo').invoke('addClassName', 'bar'); }); Walter On Oct 24, 2012, at 7:52 AM, Henrik Aagaard Sørensen wrote: I'm trying to append a class via addClassName on future elements on a page with Prototype, however I do seem to struggle a bit with it. I know of jQuery's .live feature, but I cannot find a similar feature in Prototype. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/3R9rCrWTjaIJ. 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. -- 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] Prototype, addClassName on future elements
Okay, then try this (wasteful but should do the job): new PeriodicalExecuter(function(){ $$('.foo').invoke('addClassName', 'bar'); }, 0.3); There's also an event (not uniformly covered by the browsers) that is fired when a DOM element is changed. Try observing DomSubtreeModified and hooking off of that to fire your class modification. Walter On Oct 24, 2012, at 8:34 AM, Henrik Aagaard Sørensen wrote: Hi Walter. Thank you for your answer, however, I do not have the ability to change the Ajax-calls. It's external scripts which is being loaded. On Wed, Oct 24, 2012 at 2:32 PM, Walter Lee Davis wa...@wdstudio.com wrote: You can add this transformation in the onSuccess callback of your Ajax call: new Ajax.Updater('foo', '/get/more/foo', {onSuccess: function(){ $$('.foo').invoke('addClassName', 'bar'); }); As long as you don't have a ton of DOM changes happening, this should just work. Otherwise, you may want to wrap it in a Defer to ensure that the DOM is stable before you run it. Walter On Oct 24, 2012, at 8:00 AM, Henrik Aagaard Sørensen wrote: No, unfortunately it's not that. It's elements being loaded into the dom later. I'm already using dom:loaded and I've placed the JS jus before /body as the last element. However, there are several Ajax-calls which later (in the future, after everything is loaded) creates new elements (which I have no control over), so I need to have Prototype adding specific class-names in elements which fullfill CSS selector at all time. On Wed, Oct 24, 2012 at 1:57 PM, Walter Lee Davis wa...@wdstudio.com wrote: Can you describe what you mean by future elements on the page? Do you mean elements that are later in the source order than the script? If so, that's pretty simple: document.observe('dom:loaded', function(){ $$('div.foo').invoke('addClassName', 'bar'); }); Walter On Oct 24, 2012, at 7:52 AM, Henrik Aagaard Sørensen wrote: I'm trying to append a class via addClassName on future elements on a page with Prototype, however I do seem to struggle a bit with it. I know of jQuery's .live feature, but I cannot find a similar feature in Prototype. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/3R9rCrWTjaIJ. 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. -- 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. -- 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] Prototype, addClassName on future elements
DOM should be all caps. I just tried this in Safari 6, and while I couldn't get SubtreeModified to work, DOMNodeInserted worked great. You might want to try that. It works no matter what sort of content you insert -- even a bare string is a new DOM node. Walter On Oct 24, 2012, at 8:52 AM, Henrik Aagaard Sørensen wrote: PeriodicalExecuter does the job, thank you. However, I would like to try DomSubtreeModified. But this doesn't work in Chrome: document.observe('DomSubtreeModified ', function () { //Do stuff }); Am I doing something wrong? On Wed, Oct 24, 2012 at 2:47 PM, Walter Lee Davis wa...@wdstudio.com wrote: Okay, then try this (wasteful but should do the job): new PeriodicalExecuter(function(){ $$('.foo').invoke('addClassName', 'bar'); }, 0.3); There's also an event (not uniformly covered by the browsers) that is fired when a DOM element is changed. Try observing DomSubtreeModified and hooking off of that to fire your class modification. Walter On Oct 24, 2012, at 8:34 AM, Henrik Aagaard Sørensen wrote: Hi Walter. Thank you for your answer, however, I do not have the ability to change the Ajax-calls. It's external scripts which is being loaded. On Wed, Oct 24, 2012 at 2:32 PM, Walter Lee Davis wa...@wdstudio.com wrote: You can add this transformation in the onSuccess callback of your Ajax call: new Ajax.Updater('foo', '/get/more/foo', {onSuccess: function(){ $$('.foo').invoke('addClassName', 'bar'); }); As long as you don't have a ton of DOM changes happening, this should just work. Otherwise, you may want to wrap it in a Defer to ensure that the DOM is stable before you run it. Walter On Oct 24, 2012, at 8:00 AM, Henrik Aagaard Sørensen wrote: No, unfortunately it's not that. It's elements being loaded into the dom later. I'm already using dom:loaded and I've placed the JS jus before /body as the last element. However, there are several Ajax-calls which later (in the future, after everything is loaded) creates new elements (which I have no control over), so I need to have Prototype adding specific class-names in elements which fullfill CSS selector at all time. On Wed, Oct 24, 2012 at 1:57 PM, Walter Lee Davis wa...@wdstudio.com wrote: Can you describe what you mean by future elements on the page? Do you mean elements that are later in the source order than the script? If so, that's pretty simple: document.observe('dom:loaded', function(){ $$('div.foo').invoke('addClassName', 'bar'); }); Walter On Oct 24, 2012, at 7:52 AM, Henrik Aagaard Sørensen wrote: I'm trying to append a class via addClassName on future elements on a page with Prototype, however I do seem to struggle a bit with it. I know of jQuery's .live feature, but I cannot find a similar feature in Prototype. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/3R9rCrWTjaIJ. 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. -- 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. -- 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
Re: [Proto-Scripty] Old 1.6.1 library
On Oct 16, 2012, at 5:32 PM, Trik wrote: Hi there, I'm a littlebit confused, i'm not a prototype expert and i would like to solve a problem. I have an old library based on 1.6.1 version. There is a method that make an error when i try to upgrade to 1.7.1 : function onMousedown(event) { var draggable = event.findElement('[ui:draggable=true]'); if (draggable) { event.stop(); currentDraggable = draggable; initPointer = event.pointer(); document.observe(mousemove, onMousemove) .observe(mouseup, onMouseup); } }; Seems the new selector Sizzle don't like the '[ui:draggable=true]' expression. -- Syntax error, unrecognized expression: [ui:draggable=true] Do you have an idea what could be a good syntax ? Sizzle (or even other selector engines) base their behavior on CSS selectors. If ui:draggable is an attribute that can be applied in HTML to an element, then they can select it, usually. Can you show the HTML that this is supposed to match? Is that HTML valid according to W3C's validator? That's another very important place to start. While browsers put up with almost any sort of crap HTML, JavaScript DOM is a more unforgiving taskmaster. Walter Hope this will be enought as informations to help me. Thanks in advance guys :) -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/dOlp2b2JeaEJ. 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] Zoom
Are you asking if you can write one, or if one exists you could use? Walter On Oct 8, 2012, at 8:11 AM, Erika Will wrote: Hello can I include a zoom function? -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/41bgj3YoR0gJ. 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] Form submit bubble
On Sep 26, 2012, at 5:00 AM, kstubs wrote: Does a form submit bubble up to the containing element? I'd like to capture form submit on a container div for a form submit. Reason being: I create the form on the fly based on whichever child element the user has selected (if any). I'd like to add a form submit handler to the container, much like I do for click events, to handle and setup the form submission one time. I'm not sure if it does in every browser. You may be able to simulate this with synthetic events, using fire() on the form to send out the broadcast, and observe() on the DIV to receive. Walter -- 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] Prototype's selector as well as eq in Jquery
Sure. if you start at the tr that holds the tds, you can use down() to do this. If you want the second td to have a certain width, you could do this: $$('tr').each(function(elm){ elm.down('td', 2).setStyle('width:122px'); }); Walter On Sep 23, 2012, at 12:59 PM, Евгений Шморгун wrote: I have to assign the different sizes to the td, and the width of them depends on the number's position of the tag in table. In Jquery I can write $$('td .yui-dt-liner div[id^=yui-gen]').eq(2).invoke(setStyle,{'width':'122px'}); changing the argument in eq. is there analogue expression in prototype.js ? Thanks! -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/rjXTGT4Eu94J. 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] Remove horizontal gaps in puzzle demo
Whenever you place an image (or text) inside a div without wrapping it in a P tag, the browser will add an implicit P tag around the image, and treat it to the default line-height and padding for a P on your page. I am pretty sure that's what's going on here, and you should be able to get rid of it by adding a style like this to the page: #puzzle { font-size: 0.1px; line-height: 1; } Walter On Aug 15, 2012, at 1:28 AM, pmolsen wrote: Anyone know how to remove the blank horizontal gaps between the rows in the puzzle example here please: http://madrobby.github.com/scriptaculous/puzzle-demo/ -- 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] Any reason why this might not work?
On Aug 9, 2012, at 5:28 AM, Victor wrote: It may fail because this code may overwrite element's properties (and in some browsers like IE and Opera some attributes, mapped as element properties). That's an excellent point. E.g. $(someInput).store(name, foo).store(type, bar); Better will be some separate container to store values inside, but this leads to back-porting element storage back to Prototype 1.6: // storage container nested in each element if(typeof Element.store == 'undefined'){ Element.addMethods({ store: function(e, k, v){ e._prototypeStorage = e._prototypeStorage || {}; e._prototypeStorage[k] = v; }, retrieve: function(e, k){ e._prototypeStorage = e._prototypeStorage || {}; return (e._prototypeStorage[k]); } }); } Would this construction: e._prototypeStorage = e._prototypeStorage || {} fall afoul of the issue that Jason pointed out? Would IE bork the assignment because the key wasn't in hash form and quoted? Walter // storage container in closure (function(){ if(typeof Element.store == 'undefined'){ var storage = {}; function uid(e) { // TODO return some uid for element like in Prototype 1.7 } Element.addMethods({ store: function(e, k, v){ var id = uid(e); storage[id] = storage[id] || {}; storage[id][k] = v; }, retrieve: function(e, k){ var id = uid(e); storage[id] = storage[id] || {}; return (storage[id][k]); } }); } })(); -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/TH_WyncdHx0J. 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.