Hello, here is the initial patch for support for sortable trees. Please as many people download this code and test with your lists and feel free to add more list tests. Files modified were dragdrop.js and prototype.js. Some new options have been added. ''treeTag'' specifies the tag used to contain children elements. ''tree'' must be set to true for this additional functionality to work. Greedy has been removed as it does not work with tree lists. There are severe performance problems with dragdrop which need to be addressed, but I don''t have the time at the moment. I have optimized some basic parts of the code, I''ve done profiling also using the Venkman javascript debugger. Please send me or fix any bugs, please send as a zip with the HTML causing the problem along with any code you have adjusted from the repository. If anyone has any serious ideas about how to improve performance, feel free to submit them as they would be very welcome. http://www.oriontransfer.co.nz/Sortable+List+v2.zip Sammi _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
On 2/17/06, Sammi Williams <ioquatix-EeRYXuc1dym5PgFUrJwY1aU/zSkkHjvu@public.gmane.org> wrote:> Files modified were dragdrop.js and prototype.js. >Is it a real need ? I am not really happy with having to modify external library :(
On 2/17/06, Sammi Williams <ioquatix-EeRYXuc1dym5PgFUrJwY1aU/zSkkHjvu@public.gmane.org> wrote:> Files modified were dragdrop.js and prototype.js.Unless your modifications to prototype.js are /very/ generic and useful to a wider audience than just people who want to sort trees, then it''s not likely to happen.> http://www.oriontransfer.co.nz/Sortable+List+v2.zipI got a 404 when trying to download that file. Todd
Remove the "+" and change it to " " (space) http://www.oriontransfer.co.nz/Sortable List v2.zip
On 2/17/06, Maninder, Singh <mandiv-W2hqgAdRMsX2eFz/2MeuCQ@public.gmane.org> wrote:> Remove the "+" and change it to " " (space) > http://www.oriontransfer.co.nz/Sortable List v2.zipThat did the trick. Thanks. So, onto the feedback for Sammi: 48,62d47> /* Copyright Sammi Williams 2006 Released under GPLv2 */ > Object.keys = function(object) { > var keys = new Array(); > for (key in object) > keys.push (key); > return keys; > } > > Object.values = function(object) { > var values = new Array(); > for (key in object) > values.push (object[key]) > return values; > }Prototype is a BSD-licensed package; why would they accept code licensed under a different license? Neither of those functions are written in the style of the rest of the Prototype code. The way they''re declared and the indenting you''re using isn''t consistant with Prototype. They''re also unnecessary ... var keys = $H(object).keys(); ... will give you what you want. Same with values(). 413,414c428,429 < for (var i = 0; i < this.length; i++) < iterator(this[i]); ---> for (var i = 0; i < this.length; i++) > iterator(this[i]);1785c1800 < } ---> }You just changed the indenting for the fun of it? Todd
> Prototype is a BSD-licensed package; why would they accept codeBad form to reply to yourself, but I caught this after sending it. Prototype is MIT-licensed. Todd
Hey Sammi, Haven''t had a chance to look at the details yet, but thanks in advance...I was looking at doing some of this crap myself, so regardless of the outcome, if your code works at all, it has saved me some time :-D. -Jerod On 2/17/06, Todd Ross <rails-spinoffs-25kFIyuv2iRiLUuM0BA3LQ@public.gmane.org> wrote:> > > Prototype is a BSD-licensed package; why would they accept code > > Bad form to reply to yourself, but I caught this after sending it. > Prototype is MIT-licensed. > > Todd > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Sammi, check out some of my recent past posts in the archives RE: improving the performance of dragdrop.js... -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Sammi Williams Sent: Friday, February 17, 2006 4:33 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails-spinoffs] Sortable Tree Addition [PATCH] Hello, here is the initial patch for support for sortable trees. Please as many people download this code and test with your lists and feel free to add more list tests. Files modified were dragdrop.js and prototype.js. Some new options have been added. ''treeTag'' specifies the tag used to contain children elements. ''tree'' must be set to true for this additional functionality to work. Greedy has been removed as it does not work with tree lists. There are severe performance problems with dragdrop which need to be addressed, but I don''t have the time at the moment. I have optimized some basic parts of the code, I''ve done profiling also using the Venkman javascript debugger. Please send me or fix any bugs, please send as a zip with the HTML causing the problem along with any code you have adjusted from the repository. If anyone has any serious ideas about how to improve performance, feel free to submit them as they would be very welcome. http://www.oriontransfer.co.nz/Sortable+List+v2.zip Sammi The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.
If said library is not performing the tasks you need it to in an optimal manner, modify and modify now. The alternative is what, live with a slow application without the features you need? -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Nicolas Terray Sent: Friday, February 17, 2006 4:37 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] Sortable Tree Addition [PATCH] On 2/17/06, Sammi Williams <ioquatix-EeRYXuc1dym5PgFUrJwY1aU/zSkkHjvu@public.gmane.org> wrote:> Files modified were dragdrop.js and prototype.js. >Is it a real need ? I am not really happy with having to modify external library :( _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.
Sammi, I didn''t look at the code, but I would say, keep sending your stuff, good stuff. As far as any official patch, who knows. The people that need/want the functionality you are offering will take it and run with it. Those that don''t want a modified core file will figure out how to take your stuff and factor it into a separate file. Just keep contributing like this. As far as indenting... the fact that the author(s) used spaces for indentation in the first place has always been an annoyance. Why not just hit the TAB key once and make all tabs equal rather than hitting space multiple times and ending up with all sorts of inconsistent indentation? -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Todd Ross Sent: Friday, February 17, 2006 5:53 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] Sortable Tree Addition [PATCH] On 2/17/06, Maninder, Singh <mandiv-W2hqgAdRMsX2eFz/2MeuCQ@public.gmane.org> wrote:> Remove the "+" and change it to " " (space) > http://www.oriontransfer.co.nz/Sortable List v2.zipThat did the trick. Thanks. So, onto the feedback for Sammi: 48,62d47> /* Copyright Sammi Williams 2006 Released under GPLv2 */ > Object.keys = function(object) { > var keys = new Array(); > for (key in object) > keys.push (key); > return keys; > } > > Object.values = function(object) { > var values = new Array(); > for (key in object) > values.push (object[key]) > return values; > }Prototype is a BSD-licensed package; why would they accept code licensed under a different license? Neither of those functions are written in the style of the rest of the Prototype code. The way they''re declared and the indenting you''re using isn''t consistant with Prototype. They''re also unnecessary ... var keys = $H(object).keys(); ... will give you what you want. Same with values(). 413,414c428,429 < for (var i = 0; i < this.length; i++) < iterator(this[i]); ---> for (var i = 0; i < this.length; i++) > iterator(this[i]);1785c1800 < } ---> }You just changed the indenting for the fun of it? Todd _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.
On 2/17/06, Ryan Gahl <Ryan.Gahl-nlycWCgr5/vuufBYgWm87A@public.gmane.org> wrote:> If said library is not performing the tasks you need it to in an optimal > manner, modify and modify now. The alternative is what, live with a slow > application without the features you need? >Yes, I understand. But why does your modifications have not been integrated ? If they rock, they should be part of the official release. Did you receive any answer from prototype and/or scriptaculous "maintainers" ?
Not my modifications... I was just replying to your comment. I have no desire to get my modifications in any official release. I contribute my improvements to this list... those that want to use them can, and that''s that. -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Nicolas Terray Sent: Friday, February 17, 2006 8:40 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] Sortable Tree Addition [PATCH] On 2/17/06, Ryan Gahl <Ryan.Gahl-nlycWCgr5/vuufBYgWm87A@public.gmane.org> wrote:> If said library is not performing the tasks you need it to in anoptimal> manner, modify and modify now. The alternative is what, live with aslow> application without the features you need? >Yes, I understand. But why does your modifications have not been integrated ? If they rock, they should be part of the official release. Did you receive any answer from prototype and/or scriptaculous "maintainers" ? _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.
Tabs are evil, because they''re formatted in different ways on different editors. Your text editor should allow for switching to soft spaces when you hit tab. The official scriptaculous/prototype/rails style is 2 spaces instead of a tab. You do use an editor that allows for this, do you...? :) -Thomas Am 17.02.2006 um 15:38 schrieb Ryan Gahl:> As far as indenting... the fact that the author(s) used spaces for > indentation in the first place has always been an annoyance. Why not > just hit the TAB key once and make all tabs equal rather than hitting > space multiple times and ending up with all sorts of inconsistent > indentation?
On 2/17/06, Ryan Gahl <Ryan.Gahl-nlycWCgr5/vuufBYgWm87A@public.gmane.org> wrote:> Not my modifications... I was just replying to your comment. I have no > desire to get my modifications in any official release. I contribute my > improvements to this list... those that want to use them can, and that''s > that. >Sorry, I think that you are not the person who I was thinking at. I saw in the past a thread explaining how to improve performance of prototype by removing <array>.length evaluation from loops. I don''t remember the thread and I thought that it was you. Sorry.
Oh ok, that explains it. I guess I never thought tabs were formatted so differently across IDEs/editors... shouldn''t most editors allow changing how tabs behave (just like as you mentioned for soft tabs)? Anyway, my point was, Sammi offered a great contribution and was replied to with "...and did you just change the indentation for the fun of it"? I change the indentation in my stuff to tabs (which in all my experience have worked across editors), and I also change the bracket styles from function() { } To... function() { } ...Those are such matters of preference I think there is no point bringing that up in reply to someone''s functional contributions. That was my real point, just sticking up for Sammi in those matters of preference. It just makes someone feel like not wanting to contribute further when they are picked at for such meaningless stuff. And big deal about his licensing line... we all know this stuff is all free for anyone who wants it. No one here (or very very FEW if any) of us are lawyers... give the guy a break and reply constructively to the functionality, not nit-picking... Sorry. -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Thomas Fuchs Sent: Friday, February 17, 2006 8:44 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] Sortable Tree Addition [PATCH] Tabs are evil, because they''re formatted in different ways on different editors. Your text editor should allow for switching to soft spaces when you hit tab. The official scriptaculous/prototype/rails style is 2 spaces instead of a tab. You do use an editor that allows for this, do you...? :) -Thomas Am 17.02.2006 um 15:38 schrieb Ryan Gahl:> As far as indenting... the fact that the author(s) used spaces for > indentation in the first place has always been an annoyance. Why not > just hit the TAB key once and make all tabs equal rather than hitting > space multiple times and ending up with all sorts of inconsistent > indentation?_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.
Nope that wasn''t me, although that is a fair thing to say. var len = myArray.length; for (var i = 0; i < len; i++) { ..doSomething } Is more efficient than... for (var i = 0; i < myArray.length; i++) { ..doSomething } And in fact, I have modified my copy of prototype.js, replacing all the loops with the 1st syntax. But no, I wasn''t the original poster of that topic. I don''t know, I just don''t understand this mentality of not wanting to modify any of this stuff, because of "maintainability". If you recognize something that can be done better, what not just do it? These are scripts, not compiled 3rd party binaries. Everything is right there for you to change, or take out what you don''t need, etc... just always keep an un-modified original copy somewhere and you really can''t go wrong. -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Nicolas Terray Sent: Friday, February 17, 2006 8:47 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] Sortable Tree Addition [PATCH] On 2/17/06, Ryan Gahl <Ryan.Gahl-nlycWCgr5/vuufBYgWm87A@public.gmane.org> wrote:> Not my modifications... I was just replying to your comment. I have no > desire to get my modifications in any official release. I contributemy> improvements to this list... those that want to use them can, andthat''s> that. >Sorry, I think that you are not the person who I was thinking at. I saw in the past a thread explaining how to improve performance of prototype by removing <array>.length evaluation from loops. I don''t remember the thread and I thought that it was you. Sorry. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.
Ryan Gahl wrote:> Anyway, my point was, Sammi offered a great contribution and was replied > to with "...and did you just change the indentation for the fun of it"?That wasn''t in relation to my tabs vs spaces critique. It was a changed line that had no functional differences.> I change the indentation in my stuff to tabs (which in all my experience > have worked across editors), and I also change the bracket styles from > > function() { > } > > To... > > function() > { > }And in the process have created for yourself a maintenance nightmare if you ever intend to upgrade the components that you made "preference changes" to. (There are, actually a few outcomes of upgrading a public component after you''ve made changes to it. You can replace the component outright, at which point, your changes get lost, so why make the changes in the first place? You can attempt to merge the changes, but you can''t do it using the utilities available (such as diff and patch), which is a maintenance problem because it''s manual and error prone. You can choose not to upgrade, at which point, you''re losing out on the useful functionality that others are providing through the proper means.) In any case, you made that decision for yourself; don''t force it on others if you release changes to a public component that you think others would find useful.> ...Those are such matters of preference I think there is no point > bringing that up in reply to someone''s functional contributions. That > was my real point, just sticking up for Sammi in those matters of > preference.I commented on this code with an eye towards inclusion. It was a /technical/ review of the bits that I cared about (prototype). That means honoring the coding style of the existing code base and following their conventions. Releasing code that changes "public" components (prototype / scriptaculous) without the intention of merging those changes back into the public component is doing everyone who adopts those changes a disservice. Now, you could argue that the people who adopt said changes are taking this burden upon themselves, but I would in turn argue that having useful changes merged back into the public component is more efficient for everyone. Yes, it''s a cool new feature, but it''s also a maintenance problem.> It just makes someone feel like not wanting to contribute further when > they are picked at for such meaningless stuff. And big deal about his > licensing line... we all know this stuff is all free for anyone who > wants it. No one here (or very very FEW if any) of us are lawyers... > give the guy a break and reply constructively to the functionality, not > nit-picking...My goal was not to discourage contributions. It was to provide a technical review. The result of which is that /none/ of the changes made to prototype.js needed to have been made. I provided examples of the alternative code that prototype is already providing. I hope that provides the context you need to understand my comments. Todd -- Posted via http://www.ruby-forum.com/.
How can anything related to a such a small little script library like prototype and scriptaculous be viewed as a maintenance nightmare? I mean we''re talking about 6, 7 files tops, none of which are any larger than a few hundred lines. So it takes all of 30 minutes, maybe an hour, to incorporate the changes I need/want when a new release comes out, or someone posts a nice addition that I want for my project. Hardly a nightmare. We are not talking about massive frameworks here, not by any stretch of the imagination. Anyway, not meaning to start a war. Thank you for putting your comments into context for me. I still don''t think they offered anyone any constructive help.> Releasing code that changes "public" components > (prototype / scriptaculous) without the intention of merging those > changes back into the public component is doing everyone who adopts > those changes a disserviceReleasing code that offers new functionality at a cost of $0 to anyone who wants to use it is doing everyone a HUGE service, no matter what way you want to look at it. -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Todd Ross Sent: Friday, February 17, 2006 10:03 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails-spinoffs] Re: RE: Sortable Tree Addition [PATCH] Ryan Gahl wrote:> Anyway, my point was, Sammi offered a great contribution and wasreplied> to with "...and did you just change the indentation for the fun ofit"? That wasn''t in relation to my tabs vs spaces critique. It was a changed line that had no functional differences.> I change the indentation in my stuff to tabs (which in all myexperience> have worked across editors), and I also change the bracket styles from > > function() { > } > > To... > > function() > { > }And in the process have created for yourself a maintenance nightmare if you ever intend to upgrade the components that you made "preference changes" to. (There are, actually a few outcomes of upgrading a public component after you''ve made changes to it. You can replace the component outright, at which point, your changes get lost, so why make the changes in the first place? You can attempt to merge the changes, but you can''t do it using the utilities available (such as diff and patch), which is a maintenance problem because it''s manual and error prone. You can choose not to upgrade, at which point, you''re losing out on the useful functionality that others are providing through the proper means.) In any case, you made that decision for yourself; don''t force it on others if you release changes to a public component that you think others would find useful.> ...Those are such matters of preference I think there is no point > bringing that up in reply to someone''s functional contributions. That > was my real point, just sticking up for Sammi in those matters of > preference.I commented on this code with an eye towards inclusion. It was a /technical/ review of the bits that I cared about (prototype). That means honoring the coding style of the existing code base and following their conventions. Releasing code that changes "public" components (prototype / scriptaculous) without the intention of merging those changes back into the public component is doing everyone who adopts those changes a disservice. Now, you could argue that the people who adopt said changes are taking this burden upon themselves, but I would in turn argue that having useful changes merged back into the public component is more efficient for everyone. Yes, it''s a cool new feature, but it''s also a maintenance problem.> It just makes someone feel like not wanting to contribute further when > they are picked at for such meaningless stuff. And big deal about his > licensing line... we all know this stuff is all free for anyone who > wants it. No one here (or very very FEW if any) of us are lawyers... > give the guy a break and reply constructively to the functionality,not> nit-picking...My goal was not to discourage contributions. It was to provide a technical review. The result of which is that /none/ of the changes made to prototype.js needed to have been made. I provided examples of the alternative code that prototype is already providing. I hope that provides the context you need to understand my comments. Todd -- Posted via http://www.ruby-forum.com/. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.
* Ryan Gahl wrote (17/02/06 16:26):> > Releasing code that offers new functionality at a cost of $0 to anyone > who wants to use it is doing everyone a HUGE service, no matter what way > you want to look at it.... and I''m a beneficiary. I''ve incorporated Ryan Gahl''s dragdrop.js enhancements myself. But I did change the bracketing style and the indenting as I went along :-) Chris
Ryan Gahl wrote:> How can anything related to a such a small little script library like > prototype and scriptaculous be viewed as a maintenance nightmare? I mean > we''re talking about 6, 7 files tops, none of which are any larger than a > few hundred lines. So it takes all of 30 minutes, maybe an hour, to > incorporate the changes I need/want when a new release comes out, or > someone posts a nice addition that I want for my project. Hardly a > nightmare.You''re marginalizing the issue. prototype.js, alone, weighs in at 1781 lines and precious few of those are comments. Being conservative, let''s estimate it at 1500 functional / code lines. Now, add in scriptaculous.>> Releasing code that changes "public" components >> (prototype / scriptaculous) without the intention of merging those >> changes back into the public component is doing everyone who adopts >> those changes a disservice > > Releasing code that offers new functionality at a cost of $0 to anyone > who wants to use it is doing everyone a HUGE service, no matter what way > you want to look at it.It would /truly/ be a cost of $0 (minus the developer''s time, but that''s already been donated) if the changes were merged back into prototype / scriptaculous proper. As it is, it''s introducing maintenance time for /each/ person that adopted the changes. Spread out, the time is insignificant (you estimated your own time as 30 - 60 minutes). Add up the time spent by everyone, and it''s not as efficient as merging the changes, is it? Todd -- Posted via http://www.ruby-forum.com/.
The solution to this is simple. You make your own js file that overrides functions from the trunk. Then you can update the trunk and your changes are still included in your own file. Greg
Alright alright, let''s call a truce... I appreciate where you''re coming from, but I still stand on my points too. Gregory Hill wrote:> The solution to this is simple. > > You make your own js file that overrides functions from the trunk.Then> you can update the trunk and your changes are still included in yourown> file. > > GregThanks, Greg, perfect solution =). And thanks, Sammi, for your contribution, I''m sure plenty of people will find it useful. -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Todd Ross Sent: Friday, February 17, 2006 10:36 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails-spinoffs] RE: Re: RE: Sortable Tree Addition [PATCH] Ryan Gahl wrote:> How can anything related to a such a small little script library like > prototype and scriptaculous be viewed as a maintenance nightmare? Imean> we''re talking about 6, 7 files tops, none of which are any larger thana> few hundred lines. So it takes all of 30 minutes, maybe an hour, to > incorporate the changes I need/want when a new release comes out, or > someone posts a nice addition that I want for my project. Hardly a > nightmare.You''re marginalizing the issue. prototype.js, alone, weighs in at 1781 lines and precious few of those are comments. Being conservative, let''s estimate it at 1500 functional / code lines. Now, add in scriptaculous.>> Releasing code that changes "public" components >> (prototype / scriptaculous) without the intention of merging those >> changes back into the public component is doing everyone who adopts >> those changes a disservice > > Releasing code that offers new functionality at a cost of $0 to anyone > who wants to use it is doing everyone a HUGE service, no matter whatway> you want to look at it.It would /truly/ be a cost of $0 (minus the developer''s time, but that''s already been donated) if the changes were merged back into prototype / scriptaculous proper. As it is, it''s introducing maintenance time for /each/ person that adopted the changes. Spread out, the time is insignificant (you estimated your own time as 30 - 60 minutes). Add up the time spent by everyone, and it''s not as efficient as merging the changes, is it? Todd -- Posted via http://www.ruby-forum.com/. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.
:-) -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Chris Lear Sent: Friday, February 17, 2006 10:34 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails-spinoffs] Re: Sortable Tree Addition [PATCH] * Ryan Gahl wrote (17/02/06 16:26):> > Releasing code that offers new functionality at a cost of $0 to anyone > who wants to use it is doing everyone a HUGE service, no matter whatway> you want to look at it.... and I''m a beneficiary. I''ve incorporated Ryan Gahl''s dragdrop.js enhancements myself. But I did change the bracketing style and the indenting as I went along :-) Chris _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.
Why does it matter how a tab is displayed in a different editor? A tab is a tab, it denotes "indent". Furthermore, tabs are semantically accurate, allowing different users to choose how much indentation they want. For people with keen eyesight they can set tabs to be displayed at one-space. People with wide monitors can use 4 spaces. Etc. Hit tab and you go right one. Hit backspace and you go left one - unlike using softtabs. Soft tabs are tables. Tabs are CSS Anyone who thinks spacing is better than tabs is unequivocally wrong. No-one will ever sway me from this opinion, I am *that damn sure*. Thomas Fuchs wrote:> Tabs are evil, because they''re formatted in different ways on > different editors. > Your text editor should allow for switching to soft spaces when you > hit tab. > The official scriptaculous/prototype/rails style is 2 spaces instead > of a tab. > > You do use an editor that allows for this, do you...? :) > > -Thomas > > Am 17.02.2006 um 15:38 schrieb Ryan Gahl: > >> As far as indenting... the fact that the author(s) used spaces for >> indentation in the first place has always been an annoyance. Why not >> just hit the TAB key once and make all tabs equal rather than hitting >> space multiple times and ending up with all sorts of inconsistent >> indentation? > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
> Why does it matter how a tab is displayed in a different editor? A tab > is a tab, it denotes "indent". Furthermore, tabs are semantically > accurate, allowing different users to choose how much indentation they > want. For people with keen eyesight they can set tabs to be displayedat> one-space. People with wide monitors can use 4 spaces. Etc. Hit taband> you go right one. Hit backspace and you go left one - unlike using > softtabs.Everyone has their own opinion on coding standards. I''m of the opinion that coding standards are bunk and any programmer worth his paycheck can read code no matter how it is indented or where the friggin squirly brackets are placed. If the owner of a project chooses to enforce certain ones, though, then contributors to the project should abide by them. Otherwise, do whatever you want with your own stuff. But, since most people have very strong opinions on this matter, I realize that this argument is going to just get worse if continued. Can we end it now, please? Thanks. Greg
Robin Haswell wrote:> Anyone who thinks spacing is better than tabs is unequivocally wrong. > No-one will ever sway me from this opinion, I am *that damn sure*.Wow, I haven''t felt *that sure* about anything since I was 13... Must be nice :) -- Michael Peters Developer Plus Three, LP
Lets forget about the TAB issue, it isn''t really relevant on this thread. More actual feedback would be appreciated. I''ve replied to everything below, rather than sending individual emails. In summary, I am hoping this can become an official addition. I didn''t know about $H. I don''t need to make modifications to prototype.js - it has caused a big problem so I will remove this modification in the next test version I release. Sammi On 17/02/2006, at 11:37 PM, Nicolas Terray wrote:> Is it a real need ? I am not really happy with having to modify > external library :(Well, hopefully it becomes a patch, but someone further down has said I can use $H, which I did not know about, so it may not be necessary to modify prototype.js On 18/02/2006, at 12:41 AM, Maninder, Singh wrote:> Remove the "+" and change it to " " (space) > http://www.oriontransfer.co.nz/Sortable List v2.zipSweet thanks for that I have no idea why that didn''t work.. weird. Otherwise no one would be able to download it. On the comment of why I use tabs rather than spaces, I''d rather not go into details but I found that it got pretty messy in web browsers using spaces for some reason - possibly because there is the occasional tag. I also feel that spaces should be used for separating things, while tabs should be used for formatting. For example, in HTML it is impossible to use more than one space without going to special lengths. Also, when using tabs, it allows you to set them to whatever size you want and the code will automaticallly re-adjust. On 18/02/2006, at 12:39 AM, Todd Ross wrote:>> Files modified were dragdrop.js and prototype.js. > > Unless your modifications to prototype.js are /very/ generic and > useful to a wider audience than just people who want to sort trees, > then it''s not likely to happen.The generic modifications I made were Object.values and Object.keys - but as someone has already pointed out $H should work fine. I figured they would be pretty useful to anyone. There are also other modifications to Element but I left them in dragdrop.js for this reason. On 18/02/2006, at 12:52 AM, Todd Ross wrote:> You just changed the indenting for the fun of it? > > ToddUm that was from me debugging some weird exceptions thrown by Safari. But that is fixed now - I didn''t realise I made a modification. On 18/02/2006, at 12:54 AM, Todd Ross wrote:>> Prototype is a BSD-licensed package; why would they accept code > > Bad form to reply to yourself, but I caught this after sending it. > Prototype is MIT-licensed.I don''t know if I would be happy releasing hours of work under the MIT license. I prefer the GPL for various reasons, so I''m not sure what the possibilities are here. Obviously, any changes to prototype.js can be removed in the new version as $H will be suitable. On 18/02/2006, at 3:26 AM, Ryan Gahl wrote:> Sammi, check out some of my recent past posts in the archives RE: > improving the performance of dragdrop.js...Yep, I''ve tried to get in touch with various people who have had ideas but no one has responded to me. On 18/02/2006, at 3:28 AM, Ryan Gahl wrote:> If said library is not performing the tasks you need it to in an > optimal > manner, modify and modify now. The alternative is what, live with a > slow > application without the features you need?Yes I would like to optimize it but it would probably require API changes in dragdrop.js. Unfortunately, in my opinion, there is no obvious way to optimize this across browsers - but with extensive profiling and modifications (I have done profiling already and found some places which need work) it may be possible to make some ground. On 18/02/2006, at 3:38 AM, Ryan Gahl wrote:> Sammi, I didn''t look at the code, but I would say, keep sending your > stuff, good stuff. As far as any official patch, who knows. The people > that need/want the functionality you are offering will take it and run > with it. Those that don''t want a modified core file will figure out > how > to take your stuff and factor it into a separate file. Just keep > contributing like this. > > As far as indenting... the fact that the author(s) used spaces for > indentation in the first place has always been an annoyance. Why not > just hit the TAB key once and make all tabs equal rather than hitting > space multiple times and ending up with all sorts of inconsistent > indentation?Thanks for your supportive reply, it is nice to hear that you like the addition - a good three or four weeks went into this modification - reading through prototype.js and dragdrop.js to figure out how it was doing things. I think TAB is much better for indentation, that is what it was created for.. but then let''s not get into a flame war about it. On 18/02/2006, at 3:40 AM, Nicolas Terray wrote:> Yes, I understand. But why does your modifications have not been > integrated ? If they rock, they should be part of the official > release. Did you receive any answer from prototype and/or > scriptaculous "maintainers" ?Yes I have been working with madrobby (Thomas) throughout this whole process and I guess he will make the final decision of whether it gets integrated into the main source tree. We are also going to discuss optimization (the problem of). On 18/02/2006, at 3:44 AM, Thomas Fuchs wrote:> Tabs are evil, because they''re formatted in different ways on > different editors. > Your text editor should allow for switching to soft spaces when you > hit tab. > The official scriptaculous/prototype/rails style is 2 spaces > instead of a tab. > > You do use an editor that allows for this, do you...? :) > > -ThomasI use Textmate which has great support for TABs - I can choose what size I want them to be, and so on. Tabs shouldn''t be formatted in different ways in different editors. A tab can have its width altered. For example, in Textmate, I can choose for my tab to be 2 spaces, 3 spaces, and so on. I don''t see why this is evil? Hitler was probably evil.. but TAB spacing? On 18/02/2006, at 4:05 AM, Ryan Gahl wrote:> Oh ok, that explains it. I guess I never thought tabs were > formatted so > differently across IDEs/editors... shouldn''t most editors allow > changing > how tabs behave (just like as you mentioned for soft tabs)? >Exactly!! That is what TABs allow - to easily set your personal preference. Work on an 80 column terminal? Set your TAB spacing to 1. Work on a 23" Display? Set your tab spacing to 6. Whatever you need.> Anyway, my point was, Sammi offered a great contribution and was > replied > to with "...and did you just change the indentation for the fun of > it"?Yes to be honest I felt a little bit ''breathless'' when this guy was nitpicking without really making his comments constructive.> > I change the indentation in my stuff to tabs (which in all my > experience > have worked across editors), and I also change the bracket styles from > > function() { > } > > To... > > function() > { > } > > ...Those are such matters of preference I think there is no point > bringing that up in reply to someone''s functional contributions. That > was my real point, just sticking up for Sammi in those matters of > preference.Personal choice is great. Thanks for sticking up for me!!> > It just makes someone feel like not wanting to contribute further when > they are picked at for such meaningless stuff. And big deal about his > licensing line... we all know this stuff is all free for anyone who > wants it. No one here (or very very FEW if any) of us are lawyers... > give the guy a break and reply constructively to the functionality, > not > nit-picking... > > Sorry.Thanks, I agree with what you are saying. I put a lot of work into this, so it should be my right to choose what license I release it under. On 18/02/2006, at 5:38 AM, Gregory Hill wrote:> The solution to this is simple. > > You make your own js file that overrides functions from the trunk. > Then > you can update the trunk and your changes are still included in > your own > file. > > GregYep, I''ve done this for some Element.* functions, I realized this was probably the best way to go. I didn''t know about $H. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Oh, I just realised, the modifications to prototype.js that I made are not actually even in use!! Well I am pretty stupid then, so this should work without modifications to prototype.js ばかね。。。 Sammi _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
The only actual file you need to update is dragdrop.js It should be backwards compatible with your current version, but I haven''t tested this on browsers other than Safari and Mozilla. Remember this patch will hopefully be integrated with the main code, and isn''t a final version for use in production code. Sammi On 18/02/2006, at 10:20 AM, Danger Stevens wrote:> I really appreciate the work you put into this and, while I''m just > getting into this and have no idea what should be worthy of being > added to an official release, I''d really like to use your code. > > Have you extracted your changes to a single .js file that can be > included after prototype.js and scriptaculous.js? If you have (and > I recommend the name: sammi_super_solutions.js) I''d love to use it! > > Thanks again! > - Danger > http://dangerstevens.com > > On 2/17/06, Sammi Williams <ioquatix-EeRYXuc1dym5PgFUrJwY1aU/zSkkHjvu@public.gmane.org> wrote: > Lets forget about the TAB issue, it isn''t really relevant on this > thread. > > More actual feedback would be appreciated. > > I''ve replied to everything below, rather than sending individual > emails. > > In summary, I am hoping this can become an official addition. I > didn''t know about $H. I don''t need to make modifications to > prototype.js - it has caused a big problem so I will remove this > modification in the next test version I release. > > Sammi > > On 17/02/2006, at 11:37 PM, Nicolas Terray wrote: > > Is it a real need ? I am not really happy with having to modify > > external library :( > > Well, hopefully it becomes a patch, but someone further down has said > I can use $H, which I did not know about, so it may not be necessary > to modify prototype.js > > On 18/02/2006, at 12:41 AM, Maninder, Singh wrote: > > > Remove the "+" and change it to " " (space) > > http://www.oriontransfer.co.nz/Sortable List v2.zip > > Sweet thanks for that I have no idea why that didn''t work.. weird. > Otherwise no one would be able to download it. > > On the comment of why I use tabs rather than spaces, I''d rather not > go into details but I found that it got pretty messy in web browsers > using spaces for some reason - possibly because there is the > occasional tag. I also feel that spaces should be used for separating > things, while tabs should be used for formatting. For example, in > HTML it is impossible to use more than one space without going to > special lengths. Also, when using tabs, it allows you to set them to > whatever size you want and the code will automaticallly re-adjust. > > > On 18/02/2006, at 12:39 AM, Todd Ross wrote: > >> Files modified were dragdrop.js and prototype.js. > > > > Unless your modifications to prototype.js are /very/ generic and > > useful to a wider audience than just people who want to sort trees, > > then it''s not likely to happen. > > The generic modifications I made were Object.values and Object.keys - > but as someone has already pointed out $H should work fine. I figured > they would be pretty useful to anyone. There are also other > modifications to Element but I left them in dragdrop.js for this > reason. > > > On 18/02/2006, at 12:52 AM, Todd Ross wrote: > > You just changed the indenting for the fun of it? > > > > Todd > > Um that was from me debugging some weird exceptions thrown by Safari. > But that is fixed now - I didn''t realise I made a modification. > > > On 18/02/2006, at 12:54 AM, Todd Ross wrote: > >> Prototype is a BSD-licensed package; why would they accept code > > > > Bad form to reply to yourself, but I caught this after sending it. > > Prototype is MIT-licensed. > > I don''t know if I would be happy releasing hours of work under the > MIT license. I prefer the GPL for various reasons, so I''m not sure > what the possibilities are here. Obviously, any changes to > prototype.js can be removed in the new version as $H will be suitable. > > On 18/02/2006, at 3:26 AM, Ryan Gahl wrote: > > Sammi, check out some of my recent past posts in the archives RE: > > improving the performance of dragdrop.js... > > Yep, I''ve tried to get in touch with various people who have had > ideas but no one has responded to me. > > On 18/02/2006, at 3:28 AM, Ryan Gahl wrote: > > If said library is not performing the tasks you need it to in an > > optimal > > manner, modify and modify now. The alternative is what, live with a > > slow > > application without the features you need? > > Yes I would like to optimize it but it would probably require API > changes in dragdrop.js. Unfortunately, in my opinion, there is no > obvious way to optimize this across browsers - but with extensive > profiling and modifications (I have done profiling already and found > some places which need work) it may be possible to make some ground. > > > On 18/02/2006, at 3:38 AM, Ryan Gahl wrote: > > Sammi, I didn''t look at the code, but I would say, keep sending your > > stuff, good stuff. As far as any official patch, who knows. The > people > > that need/want the functionality you are offering will take it > and run > > with it. Those that don''t want a modified core file will figure out > > how > > to take your stuff and factor it into a separate file. Just keep > > contributing like this. > > > > As far as indenting... the fact that the author(s) used spaces for > > indentation in the first place has always been an annoyance. Why not > > just hit the TAB key once and make all tabs equal rather than > hitting > > space multiple times and ending up with all sorts of inconsistent > > indentation? > > Thanks for your supportive reply, it is nice to hear that you like > the addition - a good three or four weeks went into this modification > - reading through prototype.js and dragdrop.js to figure out how it > was doing things. I think TAB is much better for indentation, that is > what it was created for.. but then let''s not get into a flame war > about it. > > On 18/02/2006, at 3:40 AM, Nicolas Terray wrote: > > Yes, I understand. But why does your modifications have not been > > integrated ? If they rock, they should be part of the official > > release. Did you receive any answer from prototype and/or > > scriptaculous "maintainers" ? > > Yes I have been working with madrobby (Thomas) throughout this whole > process and I guess he will make the final decision of whether it > gets integrated into the main source tree. We are also going to > discuss optimization (the problem of). > > On 18/02/2006, at 3:44 AM, Thomas Fuchs wrote: > > Tabs are evil, because they''re formatted in different ways on > > different editors. > > Your text editor should allow for switching to soft spaces when you > > hit tab. > > The official scriptaculous/prototype/rails style is 2 spaces > > instead of a tab. > > > > You do use an editor that allows for this, do you...? :) > > > > -Thomas > > I use Textmate which has great support for TABs - I can choose what > size I want them to be, and so on. Tabs shouldn''t be formatted in > different ways in different editors. A tab can have its width > altered. For example, in Textmate, I can choose for my tab to be 2 > spaces, 3 spaces, and so on. I don''t see why this is evil? Hitler was > probably evil.. but TAB spacing? > > On 18/02/2006, at 4:05 AM, Ryan Gahl wrote: > > Oh ok, that explains it. I guess I never thought tabs were > > formatted so > > differently across IDEs/editors... shouldn''t most editors allow > > changing > > how tabs behave (just like as you mentioned for soft tabs)? > > > > Exactly!! That is what TABs allow - to easily set your personal > preference. Work on an 80 column terminal? Set your TAB spacing to 1. > Work on a 23" Display? Set your tab spacing to 6. Whatever you need. > > > Anyway, my point was, Sammi offered a great contribution and was > > replied > > to with "...and did you just change the indentation for the fun of > > it"? > > Yes to be honest I felt a little bit ''breathless'' when this guy was > nitpicking without really making his comments constructive. > > > > > I change the indentation in my stuff to tabs (which in all my > > experience > > have worked across editors), and I also change the bracket styles > from > > > > function() { > > } > > > > To... > > > > function() > > { > > } > > > > ...Those are such matters of preference I think there is no point > > bringing that up in reply to someone''s functional contributions. > That > > was my real point, just sticking up for Sammi in those matters of > > preference. > > Personal choice is great. Thanks for sticking up for me!! > > > > > It just makes someone feel like not wanting to contribute further > when > > they are picked at for such meaningless stuff. And big deal about > his > > licensing line... we all know this stuff is all free for anyone who > > wants it. No one here (or very very FEW if any) of us are lawyers... > > give the guy a break and reply constructively to the functionality, > > not > > nit-picking... > > > > Sorry. > > Thanks, I agree with what you are saying. I put a lot of work into > this, so it should be my right to choose what license I release it > under. > > > On 18/02/2006, at 5:38 AM, Gregory Hill wrote: > > The solution to this is simple. > > > > You make your own js file that overrides functions from the trunk. > > Then > > you can update the trunk and your changes are still included in > > your own > > file. > > > > Greg > > Yep, I''ve done this for some Element.* functions, I realized this was > probably the best way to go. I didn''t know about $H. > > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
On 2/17/06, Sammi Williams <ioquatix-EeRYXuc1dym5PgFUrJwY1aU/zSkkHjvu@public.gmane.org> wrote:> The only actual file you need to update is dragdrop.js > > It should be backwards compatible with your current version, but I haven''t > tested this on browsers other than Safari and Mozilla. > > Remember this patch will hopefully be integrated with the main code, and > isn''t a final version for use in production code. > > Sammi >Thank you for your work, I''ve appreciated the highlighted zones which let me to understand how your stuff work! Thanks, Nicolas