[Proto-Scripty] Re: News Items List
Hi Walter, Thanks so much for this. It is working perfectly. There is only one issue I am having: While it works in Firefox and Safari, I tried using IE8 and noticed that it works on one computer, but not on another. Do you have any experiences with this script and IE8, anything to watch out for? Thanks! On Mar 12, 5:02 pm, Walter Lee Davis wa...@wdstudio.com wrote: Here's a cut-down version of the code generated by my NewsCycle plug- in for Softpress Freeway. document.observe('dom:loaded',function(){ var newsSource = $('yourListId'); var delayBetweenItems = 3; var effectSpeed = 0.6; var tag = newsSource.firstDescendant().tagName.toLowerCase(); var data = newsSource.select(tag).invoke('hide').pluck('innerHTML'); var news = newsSource.down(tag).show(); var index = 0; var newsCycle = function(){ index = (++index = data.length ? 0 : index) new Effect.Fade(news,{ delay:delayBetweenItems, duration:effectSpeed, afterFinish:function(){ new Effect.BlindDown(news,{ duration:effectSpeed, beforeStart:function(){ news.update(data[index]); }, afterFinish:newsCycle }); } }); }; newsCycle(); }); You need prototype and scriptaculous effects in the page first, obviously, and you need to fill in the id of your list. My plug-in has extra code to make it list agnostic, so you could simplify this a lot if you knew that your effect was only ever being applied to a list. You could also use this as written on a DIV with a bunch of P tags in it, or a DIV with a bunch of DIVs in it -- there's no end to the possible combinations. Walter On Mar 11, 2011, at 11:35 AM, PartisanEntity wrote: Hi all, I am relatively new to scriptaculous and would like to know if the following is possible. I would like to create a list of news items on my website. Instead of showing all items in my ul list, I would like for each item to appear using the slide down effect, then for it to disappear and for the next item to appear by sliding down. Is this possible? Has this been done before, perhaps there is some code I could copy as I have no idea how to build something like this. Thank you very much for you time and effort. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group athttp://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: News Items List
No, but please define doesn't work. Does the animation fail, does the text not change...? Walter On Mar 14, 2011, at 8:34 AM, PartisanEntity wrote: Hi Walter, Thanks so much for this. It is working perfectly. There is only one issue I am having: While it works in Firefox and Safari, I tried using IE8 and noticed that it works on one computer, but not on another. Do you have any experiences with this script and IE8, anything to watch out for? Thanks! On Mar 12, 5:02 pm, Walter Lee Davis wa...@wdstudio.com wrote: Here's a cut-down version of the code generated by my NewsCycle plug- in for Softpress Freeway. document.observe('dom:loaded',function(){ var newsSource = $('yourListId'); var delayBetweenItems = 3; var effectSpeed = 0.6; var tag = newsSource.firstDescendant().tagName.toLowerCase(); var data = newsSource.select(tag).invoke('hide').pluck('innerHTML'); var news = newsSource.down(tag).show(); var index = 0; var newsCycle = function(){ index = (++index = data.length ? 0 : index) new Effect.Fade(news,{ delay:delayBetweenItems, duration:effectSpeed, afterFinish:function(){ new Effect.BlindDown(news,{ duration:effectSpeed, beforeStart:function(){ news.update(data[index]); }, afterFinish:newsCycle }); } }); }; newsCycle(); }); You need prototype and scriptaculous effects in the page first, obviously, and you need to fill in the id of your list. My plug-in has extra code to make it list agnostic, so you could simplify this a lot if you knew that your effect was only ever being applied to a list. You could also use this as written on a DIV with a bunch of P tags in it, or a DIV with a bunch of DIVs in it -- there's no end to the possible combinations. Walter On Mar 11, 2011, at 11:35 AM, PartisanEntity wrote: Hi all, I am relatively new to scriptaculous and would like to know if the following is possible. I would like to create a list of news items on my website. Instead of showing all items in my ul list, I would like for each item to appear using the slide down effect, then for it to disappear and for the next item to appear by sliding down. Is this possible? Has this been done before, perhaps there is some code I could copy as I have no idea how to build something like this. Thank you very much for you time and effort. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group athttp://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@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] Re: News Items List
The list is displayed in its entirety without animations. It's almost as if the JavaScript it being ignored completely in IE8. I pasted your JavaScript into a file which I called newslist.js. I linked to it in the head section of my html file like so: script type=text/javascript src=http://www.test.com/_includes/ newsbox/newslist.js/script On Mar 14, 3:43 pm, Walter Lee Davis wa...@wdstudio.com wrote: No, but please define doesn't work. Does the animation fail, does the text not change...? Walter On Mar 14, 2011, at 8:34 AM, PartisanEntity wrote: Hi Walter, Thanks so much for this. It is working perfectly. There is only one issue I am having: While it works in Firefox and Safari, I tried using IE8 and noticed that it works on one computer, but not on another. Do you have any experiences with this script and IE8, anything to watch out for? Thanks! On Mar 12, 5:02 pm, Walter Lee Davis wa...@wdstudio.com wrote: Here's a cut-down version of the code generated by my NewsCycle plug- in for Softpress Freeway. document.observe('dom:loaded',function(){ var newsSource = $('yourListId'); var delayBetweenItems = 3; var effectSpeed = 0.6; var tag = newsSource.firstDescendant().tagName.toLowerCase(); var data = newsSource.select(tag).invoke('hide').pluck('innerHTML'); var news = newsSource.down(tag).show(); var index = 0; var newsCycle = function(){ index = (++index = data.length ? 0 : index) new Effect.Fade(news,{ delay:delayBetweenItems, duration:effectSpeed, afterFinish:function(){ new Effect.BlindDown(news,{ duration:effectSpeed, beforeStart:function(){ news.update(data[index]); }, afterFinish:newsCycle }); } }); }; newsCycle(); }); You need prototype and scriptaculous effects in the page first, obviously, and you need to fill in the id of your list. My plug-in has extra code to make it list agnostic, so you could simplify this a lot if you knew that your effect was only ever being applied to a list. You could also use this as written on a DIV with a bunch of P tags in it, or a DIV with a bunch of DIVs in it -- there's no end to the possible combinations. Walter On Mar 11, 2011, at 11:35 AM, PartisanEntity wrote: Hi all, I am relatively new to scriptaculous and would like to know if the following is possible. I would like to create a list of news items on my website. Instead of showing all items in my ul list, I would like for each item to appear using the slide down effect, then for it to disappear and for the next item to appear by sliding down. Is this possible? Has this been done before, perhaps there is some code I could copy as I have no idea how to build something like this. Thank you very much for you time and effort. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group athttp://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group athttp://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: News Items List
And you also loaded Prototype and Scriptaculous before that, in that order, right? Can you post a link? I have IE8 with a debugger enabled here on a VM, I could see if any errors suggest themselves. Walter On Mar 14, 2011, at 12:20 PM, PartisanEntity wrote: The list is displayed in its entirety without animations. It's almost as if the JavaScript it being ignored completely in IE8. I pasted your JavaScript into a file which I called newslist.js. I linked to it in the head section of my html file like so: script type=text/javascript src=http://www.test.com/_includes/ newsbox/newslist.js/script On Mar 14, 3:43 pm, Walter Lee Davis wa...@wdstudio.com wrote: No, but please define doesn't work. Does the animation fail, does the text not change...? Walter On Mar 14, 2011, at 8:34 AM, PartisanEntity wrote: Hi Walter, Thanks so much for this. It is working perfectly. There is only one issue I am having: While it works in Firefox and Safari, I tried using IE8 and noticed that it works on one computer, but not on another. Do you have any experiences with this script and IE8, anything to watch out for? Thanks! On Mar 12, 5:02 pm, Walter Lee Davis wa...@wdstudio.com wrote: Here's a cut-down version of the code generated by my NewsCycle plug- in for Softpress Freeway. document.observe('dom:loaded',function(){ var newsSource = $('yourListId'); var delayBetweenItems = 3; var effectSpeed = 0.6; var tag = newsSource.firstDescendant().tagName.toLowerCase(); var data = newsSource.select(tag).invoke('hide').pluck('innerHTML'); var news = newsSource.down(tag).show(); var index = 0; var newsCycle = function(){ index = (++index = data.length ? 0 : index) new Effect.Fade(news,{ delay:delayBetweenItems, duration:effectSpeed, afterFinish:function(){ new Effect.BlindDown(news,{ duration:effectSpeed, beforeStart:function(){ news.update(data[index]); }, afterFinish:newsCycle }); } }); }; newsCycle(); }); You need prototype and scriptaculous effects in the page first, obviously, and you need to fill in the id of your list. My plug-in has extra code to make it list agnostic, so you could simplify this a lot if you knew that your effect was only ever being applied to a list. You could also use this as written on a DIV with a bunch of P tags in it, or a DIV with a bunch of DIVs in it -- there's no end to the possible combinations. Walter On Mar 11, 2011, at 11:35 AM, PartisanEntity wrote: Hi all, I am relatively new to scriptaculous and would like to know if the following is possible. I would like to create a list of news items on my website. Instead of showing all items in my ul list, I would like for each item to appear using the slide down effect, then for it to disappear and for the next item to appear by sliding down. Is this possible? Has this been done before, perhaps there is some code I could copy as I have no idea how to build something like this. Thank you very much for you time and effort. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group athttp://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group athttp://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@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
[Proto-Scripty] [OT] Rails 3.1 - Prototype = WTF?
Sorry for the rant, but I came to Prototype by way of early exploration with Rails. I found Prototype approachable and learn-able in a way that I didn't (and don't) find jQuery to be. I've invested years in learning Prototype and it has trained and patterned my JavaScript brain. I'm quite cheesed about the notion of having to learn another way to look at JavaScript. At the same time, I can't help but notice the crickets around here lately. When I joined this list (back in the rails-spinoff days) there were dozens of posts per day, now we're lucky to get there in a week. What the heck is going on here? 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] [OT] Rails 3.1 - Prototype = WTF?
I can tell you my experience, perhaps others have had a similar ones. I tried jquery and found that I liked its ability to chain a lot. It toggles more powerfully than prototype. I also like the fact that I only need one reference for plenty of effects -- as many as I'll ever care about.Jquery does have some really aggravating aspects. In a couple of instances I have been able to find an element with plain old javascript that defied jquery and I'm still figuring out how to manage its events. Beyond a nice scrollbar, which is only a couple of hundred bytes, I haven't explored JQuery's plugins, because I like to make my own stuff. Additionally, because I plan to do freelance asp.net and javascript work when I retire (soon), I decided that because JQuery is so much more prevalent and because Microsoft is beginning to facilitate using it, that's what I should spend time learning. Jane On Mon, Mar 14, 2011 at 1:53 PM, Walter Lee Davis wa...@wdstudio.comwrote: Sorry for the rant, but I came to Prototype by way of early exploration with Rails. I found Prototype approachable and learn-able in a way that I didn't (and don't) find jQuery to be. I've invested years in learning Prototype and it has trained and patterned my JavaScript brain. I'm quite cheesed about the notion of having to learn another way to look at JavaScript. At the same time, I can't help but notice the crickets around here lately. When I joined this list (back in the rails-spinoff days) there were dozens of posts per day, now we're lucky to get there in a week. What the heck is going on here? 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.
[Proto-Scripty] Re: Rails 3.1 - Prototype = WTF?
Another anecdote along with Jane's... i make a lot of comparisons to jQuery as well because it's the only other library i've gotten familiar with. i still really like Prototype's robust set of utility data storage functions. i get wary of storing data directly on elements [jQuery.data()] and sometimes it's simply not appropriate to do so, so having Prototype's pseudo-class structure to drive the overall functionality of a page is very helpful, because i can create class members and manage data there, rather than in the HTML area of the DOM. Classes really helped me build complex JS applications when i was still brand new to application-style Javascript AJAX. That said, Prototype is bloated, and doesn't play nice with others. Scriptaculous is old, just as bloated, and i think 1 or 2 lines of code have been updated in the last year, to provide Pt 1.7 compatibility. Plus Scriptaculous doesn't provide an actual UI, just some enhanced visual effects other tools. And you have to be careful of a lot of gotchas in those effects because Scriptaculous doesn't wrap your code into HTML object references that it will need to make those effects work. jQuery's UI does that. One of the bigger advantages of Scriptaculous is Builder. i much prefer creating HTML through a node/tree structure than slapping an HTML string into an element. However, someone went and built a jQuery plugin to do what Builder does. /shrug i've noted elsewhere in this group that i don't like that there are several aliases for many of Prototype's functions, most of which are unnecessary Rails translations for otherwise sensible names. i get that it's supposed to help Rails devs use Prototype efficiently, so why not just keep only the Rails versions of functions and drop the aliases? jQuery tends to provide one way to do a lot of things. Prototype tends to provide a lot of ways to do one thing. i didn't like jQuery at first for all the reasons i stated above for liking Prototype. Once i got the hang of the major differences slight syntax variations, i've found it to really save time in a lot of ways. Granted, i also haven't built any huge application-level code using jQuery yet, but i feel like i could now that i understand the inner workings better. Jane mentioned event handling. i can go either way with that. Prototype's Function#bind makes it easy to incorporate the Class object into an event handler, but you lose context of the element unless you use Event#findElement. And i really like Event#on, but haven't done any heavy lifting with Prototype since 1.7 was released. So jQuery's handlers work fine for me. i've also never developed with Rails, and maybe because of that i don't feel a particular loyalty. i want the right tool for the job at hand, and lately that has been jQuery. Especially the ease of using plugins for missing functionality, and the UI library which amazes me. But to address your actual question: Why has traffic died down in this group? My personal observation would be that jQuery has simply gained traction over the last couple years. Prototype... i don't know. Kinda feels stale, neglected, and maybe a bit stuck in its ways? It seems like there's a lot of push to make JS libraries cooperate with each other so you can get the best each has to offer, yet Prototype can't get itself away from modifying native objects, which forces everyone else to provide safety schemes to accommodate. Also, where most libraries provide compression-safe code, Prototype stays pretty rotund at ~160K. Add Scriptaculous and you can hit 1MB of library before you get to any of your own code. In spite of criticisms, i don't want this to feel like a slam against Prototype. Obviously i still get something out of it or i'd drop my subscription to the groups. But you ask why the traffic has slowed to a crawl, and that's my opinion: Prototype itself has also slowed down. Check the dev group if you don't believe me (http://groups.google.com/ group/prototype-core/topics?hl=engvc=2). Two legitimate threads with posts in 2011, and those being about bugs, not additional development. So there's my $0.02+... i feel your frustration, though. -joe t. On Mar 14, 1:53 pm, Walter Lee Davis wa...@wdstudio.com wrote: Sorry for the rant, but I came to Prototype by way of early exploration with Rails. I found Prototype approachable and learn-able in a way that I didn't (and don't) find jQuery to be. I've invested years in learning Prototype and it has trained and patterned my JavaScript brain. I'm quite cheesed about the notion of having to learn another way to look at JavaScript. At the same time, I can't help but notice the crickets around here lately. When I joined this list (back in the rails-spinoff days) there were dozens of posts per day, now we're lucky to get there in a week. What the heck is going on here? Walter -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us